diff --git a/rocclr/compiler/lib/utils/options.cpp b/rocclr/compiler/lib/utils/options.cpp index 5a22fdff36..df2c983f71 100644 --- a/rocclr/compiler/lib/utils/options.cpp +++ b/rocclr/compiler/lib/utils/options.cpp @@ -1440,12 +1440,6 @@ Options::setPerBuildInfo( } -static inline bool isFullPath(const std::string &path) -{ - size_t found = path.find(":"); - return found != std::string::npos; -} - // HashString - Hash function for strings. // This is the Bernstein hash function. static inline unsigned HashString(std::string Str, unsigned Result = 0) @@ -1475,19 +1469,19 @@ static void splitFileName(const std::string &fileName, std::string &path, std::s } } +#ifdef _WIN32 +static inline bool isFullPath(const std::string &path) +{ + size_t found = path.find(":"); + return found != std::string::npos; +} + static std::string getValidDumpPath(const std::string &path) { if (path.empty()) { return path; } -#ifdef __linux__ - const std::string curPath = path + "."; - long pathname_max = pathconf(curPath.c_str(), _PC_PATH_MAX); - assert(pathname_max != -1 && path.size() < static_cast(pathname_max)); - return path; -#endif -#ifdef _WIN32 std::string validPath; unsigned long pathname_max = _MAX_PATH; if (path.size() > pathname_max) { @@ -1504,9 +1498,24 @@ static std::string getValidDumpPath(const std::string &path) } else validPath = path; return validPath; -#endif } +#else + +static std::string getValidDumpPath(const std::string &path) +{ + if (path.empty()) { + return path; + } + + const std::string curPath = path + "."; + long pathname_max = pathconf(curPath.c_str(), _PC_PATH_MAX); + assert(pathname_max != -1 && path.size() < static_cast(pathname_max)); + return path; +} + +#endif + static std::string getValidDumpBaseName(const std::string &path, const std::string &file, long basename_max, const std::string &ext) { diff --git a/rocclr/device/appprofile.cpp b/rocclr/device/appprofile.cpp index 40648215cb..4e7930ec57 100644 --- a/rocclr/device/appprofile.cpp +++ b/rocclr/device/appprofile.cpp @@ -42,14 +42,14 @@ extern int SearchProfileOfAnApplication(const wchar_t* fileName, ADLApplicationProfile** lppProfile); #endif // BRAHMA -static void* __stdcall adlMallocCallback(int n) { return malloc(n); } - #define GETPROCADDRESS(_adltype_, _adlfunc_) (_adltype_) amd::Os::getSymbol(adlHandle_, #_adlfunc_); namespace amd { #if !defined(BRAHMA) && !defined(WITH_LIGHTNING_COMPILER) +static void* __stdcall adlMallocCallback(int n) { return malloc(n); } + class ADL { public: ADL(); diff --git a/rocclr/device/devprogram.cpp b/rocclr/device/devprogram.cpp index 7b0d092ac3..aa986270f3 100755 --- a/rocclr/device/devprogram.cpp +++ b/rocclr/device/devprogram.cpp @@ -727,9 +727,12 @@ bool Program::compileImplLC(const std::string& sourceCode, // ================================================================================================ + +#if defined(WITH_COMPILER_LIB) static void logFunction(const char* msg, size_t size) { std::cout << "Compiler Log: " << msg << std::endl; } +#endif // ================================================================================================ bool Program::compileImplHSAIL(const std::string& sourceCode, diff --git a/rocclr/device/rocm/rocprogram.cpp b/rocclr/device/rocm/rocprogram.cpp index c6eb1d80ab..44d34365c5 100644 --- a/rocclr/device/rocm/rocprogram.cpp +++ b/rocclr/device/rocm/rocprogram.cpp @@ -41,6 +41,7 @@ namespace roc { +#if defined(WITH_COMPILER_LIB) static hsa_status_t GetKernelNamesCallback(hsa_executable_t exec, hsa_agent_t agent, hsa_executable_symbol_t symbol, void* data) { std::vector* symNameList = reinterpret_cast*>(data); @@ -62,6 +63,7 @@ static hsa_status_t GetKernelNamesCallback(hsa_executable_t exec, hsa_agent_t ag return HSA_STATUS_SUCCESS; } +#endif static inline const char* hsa_strerror(hsa_status_t status) { const char* str = nullptr;