Skip to content

Commit 54b3e73

Browse files
author
Chao Liu
committed
rename
1 parent f6edda6 commit 54b3e73

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+118
-119
lines changed

external/half/include/half.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2404,8 +2404,7 @@ unsigned int gamma(unsigned int arg)
24042404
0.0114684895434781459556 }; double t = arg + 4.65, s = p[0]; for(unsigned int i=0; i<5; ++i)
24052405
s += p[i+1] / (arg+i);
24062406
return std::log(s) + (arg-0.5)*std::log(t) - t;
2407-
*/ static const f31 pi(0xC90FDAA2, 1),
2408-
lbe(0xB8AA3B29, 0);
2407+
*/ static const f31 pi(0xC90FDAA2, 1), lbe(0xB8AA3B29, 0);
24092408
unsigned int abs = arg & 0x7FFF, sign = arg & 0x8000;
24102409
bool bsign = sign != 0;
24112410
f31 z(abs), x = sign ? (z + f31(0x80000000, 0)) : z, t = x + f31(0x94CCCCCD, 2),

host/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
add_subdirectory(host_tensor)
2-
add_subdirectory(online_compilation)
2+
add_subdirectory(online_compile)
33
add_subdirectory(driver_offline)
44
add_subdirectory(driver_online)

host/driver_online/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
include_directories(BEFORE
22
include
3-
${PROJECT_BINARY_DIR}/host/online_compilation/include
4-
${PROJECT_SOURCE_DIR}/host/online_compilation/include
3+
${PROJECT_BINARY_DIR}/host/online_compile/include
4+
${PROJECT_SOURCE_DIR}/host/online_compile/include
55
${PROJECT_SOURCE_DIR}/host/host_tensor/include
66
${PROJECT_SOURCE_DIR}/composable_kernel/include
77
${PROJECT_SOURCE_DIR}/composable_kernel/include/utility
@@ -18,4 +18,4 @@ set(CONV_FWD_DRIVER_ONLINE_SOURCE conv_fwd_driver_online.cpp)
1818
add_executable(conv_fwd_driver_online ${CONV_FWD_DRIVER_ONLINE_SOURCE})
1919

2020
target_link_libraries(conv_fwd_driver_online PRIVATE host_tensor)
21-
target_link_libraries(conv_fwd_driver_online PRIVATE online_compilation)
21+
target_link_libraries(conv_fwd_driver_online PRIVATE online_compile)

host/driver_online/conv_fwd_driver_online.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ int main(int argc, char* argv[])
3939
using size_t = std::size_t;
4040

4141
hipStream_t stream;
42-
olCompile::Handle* handle;
42+
online_compile::Handle* handle;
4343

4444
MY_HIP_CHECK(hipStreamCreate(&stream));
4545

46-
handle = new olCompile::Handle(stream);
46+
handle = new online_compile::Handle(stream);
4747

4848
constexpr auto I0 = Number<0>{};
4949
constexpr auto I1 = Number<1>{};

host/driver_online/include/online_device_dynamic_convolution_forward_implicit_gemm_v4r4_dlops_nchw_kcyx_nkhw.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ template <typename TInWei,
216216
typename InLeftPads,
217217
typename InRightPads>
218218
void online_device_dynamic_convolution_forward_implicit_gemm_v4r4_dlops_nchw_kcyx_nkhw(
219-
olCompile::Handle* handle,
219+
online_compile::Handle* handle,
220220
const InLengths& in_n_c_hi_wi_lengths,
221221
const WeiLengths& wei_k_c_y_x_lengths,
222222
const OutLengths& out_n_k_ho_wo_lengths,

host/driver_online/include/online_device_dynamic_convolution_forward_implicit_gemm_v4r4_xdlops_nchw_kcyx_nkhw.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ template <typename TInWei,
212212
typename InLeftPads,
213213
typename InRightPads>
214214
void online_device_dynamic_convolution_forward_implicit_gemm_v4r4_xdlops_nchw_kcyx_nkhw(
215-
olCompile::Handle* handle,
215+
online_compile::Handle* handle,
216216
const InLengths& in_n_c_hi_wi_lengths,
217217
const WeiLengths& wei_k_c_y_x_lengths,
218218
const OutLengths& out_n_k_ho_wo_lengths,

host/driver_online/include/online_device_dynamic_convolution_forward_implicit_gemm_v4r4_xdlops_nhwc_kyxc_nhwk.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ template <typename TInWei,
213213
typename InLeftPads,
214214
typename InRightPads>
215215
void online_device_dynamic_convolution_forward_implicit_gemm_v4r4_xdlops_nhwc_kyxc_nhwk(
216-
olCompile::Handle* handle,
216+
online_compile::Handle* handle,
217217
const InLengths& in_n_hi_wi_c_lengths,
218218
const WeiLengths& wei_k_y_x_c_lengths,
219219
const OutLengths& out_n_ho_wo_k_lengths,

host/driver_online/include/online_device_dynamic_convolution_forward_implicit_gemm_v6r1_dlops_nchw_kcyx_nkhw.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ template <typename TInWei,
2020
typename InLeftPads,
2121
typename InRightPads>
2222
void online_device_dynamic_convolution_forward_implicit_gemm_v6r1_dlops_nchw_kcyx_nkhw(
23-
olCompile::Handle* handle,
23+
online_compile::Handle* handle,
2424
const InLengths& in_n_c_hi_wi_lengths,
2525
const WeiLengths& wei_k_c_y_x_lengths,
2626
const OutLengths& out_n_k_ho_wo_lengths,

host/online_compilation/CMakeLists.txt renamed to host/online_compile/CMakeLists.txt

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,10 @@ else()
6767
set(OLC_DEBUG 0)
6868
endif()
6969

70-
configure_file("${PROJECT_SOURCE_DIR}/host/online_compilation/include/config.h.in" "${PROJECT_BINARY_DIR}/host/online_compilation/include/config.h")
70+
configure_file("${PROJECT_SOURCE_DIR}/host/online_compile/include/config.h.in" "${PROJECT_BINARY_DIR}/host/online_compile/include/config.h")
7171

7272
include_directories(BEFORE
73-
${PROJECT_BINARY_DIR}/host/online_compilation/include
73+
${PROJECT_BINARY_DIR}/host/online_compile/include
7474
)
7575

7676
message(STATUS "Hip compiler flags: ${HIP_COMPILER_FLAGS}")
@@ -97,7 +97,7 @@ set(ONLINE_COMPILATION_SOURCE
9797
)
9898

9999
include_directories(BEFORE
100-
${PROJECT_BINARY_DIR}/host/online_compilation/include
100+
${PROJECT_BINARY_DIR}/host/online_compile/include
101101
include
102102
)
103103

@@ -152,17 +152,17 @@ add_custom_command(
152152
)
153153

154154
## the library target
155-
add_library(online_compilation SHARED ${ONLINE_COMPILATION_SOURCE})
155+
add_library(online_compile SHARED ${ONLINE_COMPILATION_SOURCE})
156156

157-
target_include_directories(online_compilation PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/online_compilation/include/)
158-
target_include_directories(online_compilation PRIVATE ${PROJECT_BINARY_DIR})
159-
target_include_directories(online_compilation PRIVATE ${PROJECT_SOURCE_DIR}/external/half/include/)
157+
target_include_directories(online_compile PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/online_compile/include/)
158+
target_include_directories(online_compile PRIVATE ${PROJECT_BINARY_DIR})
159+
target_include_directories(online_compile PRIVATE ${PROJECT_SOURCE_DIR}/external/half/include/)
160160

161-
target_link_libraries(online_compilation PRIVATE hip::device)
162-
target_link_libraries(online_compilation INTERFACE hip::host)
163-
target_link_libraries(online_compilation PRIVATE Boost::filesystem)
161+
target_link_libraries(online_compile PRIVATE hip::device)
162+
target_link_libraries(online_compile INTERFACE hip::host)
163+
target_link_libraries(online_compile PRIVATE Boost::filesystem)
164164

165-
target_compile_features(online_compilation PUBLIC)
166-
set_target_properties(online_compilation PROPERTIES POSITION_INDEPENDENT_CODE ON)
165+
target_compile_features(online_compile PUBLIC)
166+
set_target_properties(online_compile PROPERTIES POSITION_INDEPENDENT_CODE ON)
167167

168-
install(TARGETS online_compilation LIBRARY DESTINATION lib)
168+
install(TARGETS online_compile LIBRARY DESTINATION lib)

host/online_compilation/hip_utility/binary_cache.cpp renamed to host/online_compile/hip_utility/binary_cache.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
#include <fstream>
3636
#include <iostream>
3737

38-
namespace olCompile {
38+
namespace online_compile {
3939

4040
OLC_DECLARE_ENV_VAR(OLC_DISABLE_CACHE)
4141
OLC_DECLARE_ENV_VAR(HOME)
@@ -62,22 +62,22 @@ boost::filesystem::path GetCachePath()
6262
return user_path;
6363
}
6464

65-
static bool IsCacheDisabled() { return olCompile::IsEnabled(OLC_DISABLE_CACHE{}); }
65+
static bool IsCacheDisabled() { return online_compile::IsEnabled(OLC_DISABLE_CACHE{}); }
6666

6767
boost::filesystem::path
6868
GetCacheFile(const std::string& device, const std::string& name, const std::string& args)
6969
{
70-
// std::string filename = (is_kernel_str ? olCompile::md5(name) : name) + ".o";
70+
// std::string filename = (is_kernel_str ? online_compile::md5(name) : name) + ".o";
7171
std::string filename = name + ".o";
72-
return GetCachePath() / olCompile::md5(device + ":" + args) / filename;
72+
return GetCachePath() / online_compile::md5(device + ":" + args) / filename;
7373
}
7474

7575
boost::filesystem::path LoadBinary(const TargetProperties& target,
7676
const size_t num_cu,
7777
const std::string& name,
7878
const std::string& args)
7979
{
80-
if(olCompile::IsCacheDisabled())
80+
if(online_compile::IsCacheDisabled())
8181
return {};
8282

8383
(void)num_cu;
@@ -97,7 +97,7 @@ void SaveBinary(const boost::filesystem::path& binary_path,
9797
const std::string& name,
9898
const std::string& args)
9999
{
100-
if(olCompile::IsCacheDisabled())
100+
if(online_compile::IsCacheDisabled())
101101
{
102102
boost::filesystem::remove(binary_path);
103103
}
@@ -109,4 +109,4 @@ void SaveBinary(const boost::filesystem::path& binary_path,
109109
}
110110
}
111111

112-
} // namespace olCompile
112+
} // namespace online_compile

host/online_compilation/hip_utility/exec_utils.cpp renamed to host/online_compile/hip_utility/exec_utils.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
#include <sys/wait.h>
3939
#endif // __linux__
4040

41-
namespace olCompile {
41+
namespace online_compile {
4242
namespace exec {
4343

4444
int Run(const std::string& p, std::istream* in, std::ostream* out)
@@ -53,7 +53,7 @@ int Run(const std::string& p, std::istream* in, std::ostream* out)
5353
OLC_MANAGE_PTR(FILE*, pclose) pipe{popen(p.c_str(), file_mode)};
5454

5555
if(!pipe)
56-
throw std::runtime_error("olCompile::exec::Run(): popen(" + p + ", " + file_mode +
56+
throw std::runtime_error("online_compile::exec::Run(): popen(" + p + ", " + file_mode +
5757
") failed");
5858

5959
if(redirect_stdin || redirect_stdout)
@@ -74,7 +74,7 @@ int Run(const std::string& p, std::istream* in, std::ostream* out)
7474
buffer[in->gcount()] = 0;
7575

7676
if(fputs(buffer.data(), pipe.get()) == EOF)
77-
throw std::runtime_error("olCompile::exec::Run(): fputs() failed");
77+
throw std::runtime_error("online_compile::exec::Run(): fputs() failed");
7878
}
7979
}
8080
}
@@ -90,4 +90,4 @@ int Run(const std::string& p, std::istream* in, std::ostream* out)
9090
}
9191

9292
} // namespace exec
93-
} // namespace olCompile
93+
} // namespace online_compile

host/online_compilation/hip_utility/handlehip.cpp renamed to host/online_compile/hip_utility/handlehip.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050

5151
OLC_DECLARE_ENV_VAR(OLC_DEVICE_CU)
5252

53-
namespace olCompile {
53+
namespace online_compile {
5454

5555
std::size_t GetAvailableMemory()
5656
{
@@ -182,24 +182,24 @@ KernelInvoke Handle::Run(Kernel k) const { return k.Invoke(this->GetStream()); }
182182

183183
Program Handle::LoadProgram(const std::string& program_name, std::string params) const
184184
{
185-
if((!olCompile::EndsWith(program_name, ".mlir-cpp")) &&
186-
(!olCompile::EndsWith(program_name, ".mlir")))
185+
if((!online_compile::EndsWith(program_name, ".mlir-cpp")) &&
186+
(!online_compile::EndsWith(program_name, ".mlir")))
187187
{
188188
params += " -mcpu=" + this->GetTargetProperties().Name();
189189
}
190190

191-
auto hsaco = olCompile::LoadBinary(
191+
auto hsaco = online_compile::LoadBinary(
192192
this->GetTargetProperties(), this->GetMaxComputeUnits(), program_name, params);
193193
if(hsaco.empty())
194194
{
195195
auto p = HIPOCProgram{program_name, params, this->GetTargetProperties()};
196196

197-
auto path = olCompile::GetCachePath() / boost::filesystem::unique_path();
197+
auto path = online_compile::GetCachePath() / boost::filesystem::unique_path();
198198
if(p.IsCodeObjectInMemory())
199-
olCompile::WriteFile(p.GetCodeObjectBlob(), path);
199+
online_compile::WriteFile(p.GetCodeObjectBlob(), path);
200200
else
201201
boost::filesystem::copy_file(p.GetCodeObjectPathname(), path);
202-
olCompile::SaveBinary(path, this->GetTargetProperties(), program_name, params);
202+
online_compile::SaveBinary(path, this->GetTargetProperties(), program_name, params);
203203

204204
return p;
205205
}
@@ -245,7 +245,7 @@ std::size_t Handle::GetGlobalMemorySize() const
245245
std::size_t Handle::GetMaxComputeUnits() const
246246
{
247247
int result;
248-
const char* const num_cu = olCompile::GetStringEnv(OLC_DEVICE_CU{});
248+
const char* const num_cu = online_compile::GetStringEnv(OLC_DEVICE_CU{});
249249
if(num_cu != nullptr && strlen(num_cu) > 0)
250250
{
251251
return boost::lexical_cast<std::size_t>(num_cu);
@@ -282,4 +282,4 @@ std::ostream& Handle::Print(std::ostream& os) const
282282
return os;
283283
}
284284

285-
} // namespace olCompile
285+
} // namespace online_compile

host/online_compilation/hip_utility/hip_build_utils.cpp renamed to host/online_compile/hip_utility/hip_build_utils.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ OLC_DECLARE_ENV_VAR(OLC_DEBUG_HIP_DUMP)
4545

4646
#define OLC_HIP_COMPILER "/opt/rocm/llvm/bin/clang++"
4747

48-
namespace olCompile {
48+
namespace online_compile {
4949

5050
bool IsHccCompiler()
5151
{
@@ -155,12 +155,12 @@ static boost::filesystem::path HipBuildImpl(boost::optional<TmpDir>& tmp_dir,
155155
params += " -mllvm -amdgpu-function-calls=false";
156156
}
157157

158-
if(olCompile::IsEnabled(OLC_DEBUG_HIP_VERBOSE{}))
158+
if(online_compile::IsEnabled(OLC_DEBUG_HIP_VERBOSE{}))
159159
{
160160
params += " -v";
161161
}
162162

163-
if(olCompile::IsEnabled(OLC_DEBUG_HIP_DUMP{}))
163+
if(online_compile::IsEnabled(OLC_DEBUG_HIP_DUMP{}))
164164
{
165165
if(IsHccCompiler())
166166
{
@@ -247,7 +247,7 @@ static external_tool_version_t HipCompilerVersionImpl()
247247
break;
248248

249249
std::stringstream out;
250-
if(olCompile::exec::Run(path + " --version", nullptr, &out) != 0)
250+
if(online_compile::exec::Run(path + " --version", nullptr, &out) != 0)
251251
break;
252252

253253
std::string line;
@@ -343,4 +343,4 @@ bool operator<=(const external_tool_version_t& lhs, const external_tool_version_
343343
return !(lhs > rhs);
344344
}
345345

346-
} // namespace olCompile
346+
} // namespace online_compile

host/online_compilation/hip_utility/hipoc_kernel.cpp renamed to host/online_compile/hip_utility/hipoc_kernel.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
#include <chrono>
3535
#include <thread>
3636

37-
namespace olCompile {
37+
namespace online_compile {
3838

3939
void HIPOCKernelInvoke::run(void* args, std::size_t size) const
4040
{
@@ -81,4 +81,4 @@ HIPOCKernelInvoke HIPOCKernel::Invoke(hipStream_t stream,
8181
{
8282
return HIPOCKernelInvoke{stream, fun, ldims, gdims, name, callback};
8383
}
84-
} // namespace olCompile
84+
} // namespace online_compile

host/online_compilation/hip_utility/hipoc_program.cpp renamed to host/online_compile/hip_utility/hipoc_program.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939

4040
#include <unistd.h>
4141

42-
namespace olCompile {
42+
namespace online_compile {
4343

4444
static hipModulePtr CreateModule(const boost::filesystem::path& hsaco_file)
4545
{
@@ -89,7 +89,7 @@ void HIPOCProgramImpl::BuildCodeObjectInFile(std::string& params,
8989
this->dir.emplace(filename);
9090
hsaco_file = dir->path / (filename + ".o");
9191

92-
if(olCompile::EndsWith(filename, ".cpp"))
92+
if(online_compile::EndsWith(filename, ".cpp"))
9393
{
9494
hsaco_file = HipBuild(dir, filename, src, params, target);
9595
}
@@ -104,7 +104,7 @@ void HIPOCProgramImpl::BuildCodeObject(std::string params)
104104
{
105105
std::string filename = program;
106106

107-
if(olCompile::EndsWith(filename, ".cpp"))
107+
if(online_compile::EndsWith(filename, ".cpp"))
108108
{
109109
params += " -Wno-everything";
110110
}
@@ -136,4 +136,4 @@ std::string HIPOCProgram::GetCodeObjectBlob() const
136136

137137
bool HIPOCProgram::IsCodeObjectInMemory() const { return !impl->binary.empty(); };
138138

139-
} // namespace olCompile
139+
} // namespace online_compile

host/online_compilation/hip_utility/kernel_build_params.cpp renamed to host/online_compile/hip_utility/kernel_build_params.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
#include <kernel_build_params.hpp>
3232
#include <stringutils.hpp>
3333

34-
namespace olCompile {
34+
namespace online_compile {
3535

3636
static std::string GenerateDefines(const std::vector<KernelBuildParameter>& options,
3737
const std::string& prefix)
@@ -63,4 +63,4 @@ static std::string GenerateDefines(const std::vector<KernelBuildParameter>& opti
6363
return JoinStrings(strs, " ");
6464
}
6565

66-
} // namespace olCompile
66+
} // namespace online_compile

host/online_compilation/hip_utility/kernel_cache.cpp renamed to host/online_compile/hip_utility/kernel_cache.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
#include <iostream>
4747
#include <iterator>
4848

49-
namespace olCompile {
49+
namespace online_compile {
5050

5151
const std::vector<Kernel>& KernelCache::GetKernels(const std::string& algorithm,
5252
const std::string& network_config)
@@ -151,4 +151,4 @@ void KernelCache::ClearKernels(const std::string& algorithm, const std::string&
151151

152152
KernelCache::KernelCache() {}
153153

154-
} // namespace olCompile
154+
} // namespace online_compile

0 commit comments

Comments
 (0)