Commit 54b3e73d authored by Chao Liu's avatar Chao Liu
Browse files

rename

parent f6edda61
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
#include <kernel_build_params.hpp> #include <kernel_build_params.hpp>
#include <stringutils.hpp> #include <stringutils.hpp>
namespace olCompile { namespace online_compile {
static std::string GenerateDefines(const std::vector<KernelBuildParameter>& options, static std::string GenerateDefines(const std::vector<KernelBuildParameter>& options,
const std::string& prefix) const std::string& prefix)
...@@ -63,4 +63,4 @@ static std::string GenerateDefines(const std::vector<KernelBuildParameter>& opti ...@@ -63,4 +63,4 @@ static std::string GenerateDefines(const std::vector<KernelBuildParameter>& opti
return JoinStrings(strs, " "); return JoinStrings(strs, " ");
} }
} // namespace olCompile } // namespace online_compile
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
#include <iostream> #include <iostream>
#include <iterator> #include <iterator>
namespace olCompile { namespace online_compile {
const std::vector<Kernel>& KernelCache::GetKernels(const std::string& algorithm, const std::vector<Kernel>& KernelCache::GetKernels(const std::string& algorithm,
const std::string& network_config) const std::string& network_config)
...@@ -151,4 +151,4 @@ void KernelCache::ClearKernels(const std::string& algorithm, const std::string& ...@@ -151,4 +151,4 @@ void KernelCache::ClearKernels(const std::string& algorithm, const std::string&
KernelCache::KernelCache() {} KernelCache::KernelCache() {}
} // namespace olCompile } // namespace online_compile
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
using namespace std; using namespace std;
namespace olCompile { namespace online_compile {
#if OLC_DEBUG #if OLC_DEBUG
static LogLevel defLevel = LogLevel::Info2; static LogLevel defLevel = LogLevel::Info2;
...@@ -27,7 +27,7 @@ string LogLevelString(LogLevel level) ...@@ -27,7 +27,7 @@ string LogLevelString(LogLevel level)
ostream& fdt_log(LogLevel level, const char* header, const char* content) ostream& fdt_log(LogLevel level, const char* header, const char* content)
{ {
if(level > olCompile::defLevel) if(level > online_compile::defLevel)
{ {
return (cerr); return (cerr);
}; };
...@@ -40,4 +40,4 @@ ostream& fdt_log(LogLevel level, const char* header, const char* content) ...@@ -40,4 +40,4 @@ ostream& fdt_log(LogLevel level, const char* header, const char* content)
ostream& fdt_log() { return (cerr); }; ostream& fdt_log() { return (cerr); };
void fdt_log_flush() { cerr << endl; } void fdt_log_flush() { cerr << endl; }
}; // namespace olCompile }; // namespace online_compile
...@@ -298,7 +298,7 @@ static void MD5_Final(unsigned char* result, MD5_CTX* ctx) ...@@ -298,7 +298,7 @@ static void MD5_Final(unsigned char* result, MD5_CTX* ctx)
memset(ctx, 0, sizeof(*ctx)); memset(ctx, 0, sizeof(*ctx));
} }
namespace olCompile { namespace online_compile {
std::string md5(std::string s) std::string md5(std::string s)
{ {
...@@ -316,4 +316,4 @@ std::string md5(std::string s) ...@@ -316,4 +316,4 @@ std::string md5(std::string s)
return sout.str(); return sout.str();
} }
} // namespace olCompile } // namespace online_compile
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
OLC_DECLARE_ENV_VAR(OLC_DEBUG_ENFORCE_DEVICE) OLC_DECLARE_ENV_VAR(OLC_DEBUG_ENFORCE_DEVICE)
namespace olCompile { namespace online_compile {
static std::string GetDeviceNameFromMap(const std::string& in) static std::string GetDeviceNameFromMap(const std::string& in)
{ {
...@@ -53,7 +53,7 @@ static std::string GetDeviceNameFromMap(const std::string& in) ...@@ -53,7 +53,7 @@ static std::string GetDeviceNameFromMap(const std::string& in)
{"10.3.0 Sienna_Cichlid 18", "gfx1030"}, {"10.3.0 Sienna_Cichlid 18", "gfx1030"},
}; };
const char* const p_asciz = olCompile::GetStringEnv(OLC_DEBUG_ENFORCE_DEVICE{}); const char* const p_asciz = online_compile::GetStringEnv(OLC_DEBUG_ENFORCE_DEVICE{});
if(p_asciz != nullptr && strlen(p_asciz) > 0) if(p_asciz != nullptr && strlen(p_asciz) > 0)
return {p_asciz}; return {p_asciz};
...@@ -116,4 +116,4 @@ void TargetProperties::InitDbId() ...@@ -116,4 +116,4 @@ void TargetProperties::InitDbId()
dbId += "_xnack"; dbId += "_xnack";
} }
} // namespace olCompile } // namespace online_compile
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
OLC_DECLARE_ENV_VAR(OLC_DEBUG_SAVE_TEMP_DIR) OLC_DECLARE_ENV_VAR(OLC_DEBUG_SAVE_TEMP_DIR)
namespace olCompile { namespace online_compile {
void SystemCmd(std::string cmd) void SystemCmd(std::string cmd)
{ {
...@@ -43,7 +43,7 @@ void SystemCmd(std::string cmd) ...@@ -43,7 +43,7 @@ void SystemCmd(std::string cmd)
TmpDir::TmpDir(std::string prefix) TmpDir::TmpDir(std::string prefix)
: path(boost::filesystem::temp_directory_path() / : path(boost::filesystem::temp_directory_path() /
boost::filesystem::unique_path("olCompile-" + prefix + "-%%%%-%%%%-%%%%-%%%%")) boost::filesystem::unique_path("online_compile-" + prefix + "-%%%%-%%%%-%%%%-%%%%"))
{ {
boost::filesystem::create_directories(this->path); boost::filesystem::create_directories(this->path);
} }
...@@ -57,10 +57,10 @@ void TmpDir::Execute(std::string exe, std::string args) const ...@@ -57,10 +57,10 @@ void TmpDir::Execute(std::string exe, std::string args) const
TmpDir::~TmpDir() TmpDir::~TmpDir()
{ {
if(!olCompile::IsEnabled(OLC_DEBUG_SAVE_TEMP_DIR{})) if(!online_compile::IsEnabled(OLC_DEBUG_SAVE_TEMP_DIR{}))
{ {
boost::filesystem::remove_all(this->path); boost::filesystem::remove_all(this->path);
} }
} }
} // namespace olCompile } // namespace online_compile
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
#include <boost/filesystem/path.hpp> #include <boost/filesystem/path.hpp>
#include <string> #include <string>
namespace olCompile { namespace online_compile {
boost::filesystem::path boost::filesystem::path
GetCacheFile(const std::string& device, const std::string& name, const std::string& args); GetCacheFile(const std::string& device, const std::string& name, const std::string& args);
...@@ -47,6 +47,6 @@ void SaveBinary(const boost::filesystem::path& binary_path, ...@@ -47,6 +47,6 @@ void SaveBinary(const boost::filesystem::path& binary_path,
const std::string& name, const std::string& name,
const std::string& args); const std::string& args);
} // namespace olCompile } // namespace online_compile
#endif #endif
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
#include <string> #include <string>
#include <vector> #include <vector>
namespace olCompile { namespace online_compile {
/// \todo Rework: Case-insensitive string compare, ODR, (?) move to .cpp /// \todo Rework: Case-insensitive string compare, ODR, (?) move to .cpp
...@@ -101,23 +101,23 @@ inline const char* GetStringEnv(T) ...@@ -101,23 +101,23 @@ inline const char* GetStringEnv(T)
template <class T> template <class T>
inline bool IsEnabled(T) inline bool IsEnabled(T)
{ {
static const bool result = olCompile::IsEnvvarValueEnabled(T::value()); static const bool result = online_compile::IsEnvvarValueEnabled(T::value());
return result; return result;
} }
template <class T> template <class T>
inline bool IsDisabled(T) inline bool IsDisabled(T)
{ {
static const bool result = olCompile::IsEnvvarValueDisabled(T::value()); static const bool result = online_compile::IsEnvvarValueDisabled(T::value());
return result; return result;
} }
template <class T> template <class T>
inline unsigned long int Value(T, unsigned long int fallback = 0) inline unsigned long int Value(T, unsigned long int fallback = 0)
{ {
static const auto result = olCompile::EnvvarValue(T::value(), fallback); static const auto result = online_compile::EnvvarValue(T::value(), fallback);
return result; return result;
} }
} // namespace olCompile } // namespace online_compile
#endif #endif
...@@ -30,13 +30,13 @@ ...@@ -30,13 +30,13 @@
#include <ostream> #include <ostream>
#include <string> #include <string>
namespace olCompile { namespace online_compile {
namespace exec { namespace exec {
/// Redirecting both input and output is not supported. /// Redirecting both input and output is not supported.
int Run(const std::string& p, std::istream* in, std::ostream* out); int Run(const std::string& p, std::istream* in, std::ostream* out);
} // namespace exec } // namespace exec
} // namespace olCompile } // namespace online_compile
#endif // EXEC_UTILS_HPP #endif // EXEC_UTILS_HPP
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
#include <vector> #include <vector>
#include <unordered_map> #include <unordered_map>
namespace olCompile { namespace online_compile {
struct HandleImpl; struct HandleImpl;
...@@ -140,6 +140,6 @@ struct Handle ...@@ -140,6 +140,6 @@ struct Handle
inline std::ostream& operator<<(std::ostream& os, const Handle& handle) { return handle.Print(os); } inline std::ostream& operator<<(std::ostream& os, const Handle& handle) { return handle.Print(os); }
} // namespace olCompile } // namespace online_compile
#endif // GUARD_OLC_HANDLE_HPP_ #endif // GUARD_OLC_HANDLE_HPP_
...@@ -31,9 +31,9 @@ ...@@ -31,9 +31,9 @@
#include <boost/optional.hpp> #include <boost/optional.hpp>
#include <string> #include <string>
namespace olCompile { namespace online_compile {
boost::filesystem::path HipBuild(boost::optional<olCompile::TmpDir>& tmp_dir, boost::filesystem::path HipBuild(boost::optional<online_compile::TmpDir>& tmp_dir,
const std::string& filename, const std::string& filename,
std::string src, std::string src,
std::string params, std::string params,
...@@ -92,6 +92,6 @@ class LcOptionTargetStrings ...@@ -92,6 +92,6 @@ class LcOptionTargetStrings
} }
}; };
} // namespace olCompile } // namespace online_compile
#endif #endif
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
#include <vector> #include <vector>
#include <memory> #include <memory>
namespace olCompile { namespace online_compile {
using HipEventPtr = OLC_MANAGE_PTR(hipEvent_t, hipEventDestroy); using HipEventPtr = OLC_MANAGE_PTR(hipEvent_t, hipEventDestroy);
inline HipEventPtr make_hip_event() inline HipEventPtr make_hip_event()
...@@ -169,6 +169,6 @@ struct HIPOCKernel ...@@ -169,6 +169,6 @@ struct HIPOCKernel
std::function<void(hipEvent_t, hipEvent_t)> callback = nullptr) const; std::function<void(hipEvent_t, hipEvent_t)> callback = nullptr) const;
}; };
} // namespace olCompile } // namespace online_compile
#endif #endif
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
#include <hip/hip_runtime_api.h> #include <hip/hip_runtime_api.h>
#include <string> #include <string>
namespace olCompile { namespace online_compile {
struct HIPOCProgramImpl; struct HIPOCProgramImpl;
struct HIPOCProgram struct HIPOCProgram
...@@ -59,6 +59,6 @@ struct HIPOCProgram ...@@ -59,6 +59,6 @@ struct HIPOCProgram
/// False if CO resides on filesystem. /// False if CO resides on filesystem.
bool IsCodeObjectInMemory() const; bool IsCodeObjectInMemory() const;
}; };
} // namespace olCompile } // namespace online_compile
#endif #endif
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
#include <boost/optional.hpp> #include <boost/optional.hpp>
#include <hip/hip_runtime_api.h> #include <hip/hip_runtime_api.h>
namespace olCompile { namespace online_compile {
using hipModulePtr = OLC_MANAGE_PTR(hipModule_t, hipModuleUnload); using hipModulePtr = OLC_MANAGE_PTR(hipModule_t, hipModuleUnload);
...@@ -57,5 +57,5 @@ struct HIPOCProgramImpl ...@@ -57,5 +57,5 @@ struct HIPOCProgramImpl
BuildCodeObjectInFile(std::string& params, const std::string& src, const std::string& filename); BuildCodeObjectInFile(std::string& params, const std::string& src, const std::string& filename);
void BuildCodeObject(std::string params); void BuildCodeObject(std::string params);
}; };
} // namespace olCompile } // namespace online_compile
#endif // GUARD_OLC_HIPOC_PROGRAM_IMPL_HPP #endif // GUARD_OLC_HIPOC_PROGRAM_IMPL_HPP
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
#include <vector> #include <vector>
#include <hipoc_kernel.hpp> #include <hipoc_kernel.hpp>
namespace olCompile { namespace online_compile {
std::string GetKernelSrc(std::string name); std::string GetKernelSrc(std::string name);
std::string GetKernelInc(std::string key); std::string GetKernelInc(std::string key);
std::vector<std::string> GetKernelIncList(); std::vector<std::string> GetKernelIncList();
...@@ -40,6 +40,6 @@ using Kernel = HIPOCKernel; ...@@ -40,6 +40,6 @@ using Kernel = HIPOCKernel;
using KernelInvoke = HIPOCKernelInvoke; using KernelInvoke = HIPOCKernelInvoke;
using Program = HIPOCProgram; using Program = HIPOCProgram;
} // namespace olCompile } // namespace online_compile
#endif #endif
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
#include <string> #include <string>
#include <vector> #include <vector>
namespace olCompile { namespace online_compile {
namespace kbp { namespace kbp {
struct Option struct Option
...@@ -132,6 +132,6 @@ class KernelBuildParameters ...@@ -132,6 +132,6 @@ class KernelBuildParameters
} }
}; };
} // namespace olCompile } // namespace online_compile
#endif #endif
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
#include <unordered_map> #include <unordered_map>
#include <vector> #include <vector>
namespace olCompile { namespace online_compile {
/** /**
* @brief The KernelCache class Build and cache kernels * @brief The KernelCache class Build and cache kernels
...@@ -92,6 +92,6 @@ class KernelCache ...@@ -92,6 +92,6 @@ class KernelCache
ProgramMap program_map; ProgramMap program_map;
}; };
} // namespace olCompile } // namespace online_compile
#endif // GUARD_OLC_KERNEL_CACHE_HPP_ #endif // GUARD_OLC_KERNEL_CACHE_HPP_
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
#include <fstream> #include <fstream>
namespace olCompile { namespace online_compile {
enum class LogLevel enum class LogLevel
{ {
...@@ -18,6 +18,6 @@ std::ostream& fdt_log(LogLevel level, const char* header, const char* content); ...@@ -18,6 +18,6 @@ std::ostream& fdt_log(LogLevel level, const char* header, const char* content);
std::ostream& fdt_log(); std::ostream& fdt_log();
void fdt_log_flush(); void fdt_log_flush();
}; // namespace olCompile }; // namespace online_compile
#endif #endif
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment