diff --git a/src/core/impl/utils/cuda_helper.cpp b/src/core/impl/utils/cuda_helper.cpp index 8f49f9b690c93b07a1e93e68aa2b98c292245f78..30793bf90e7250eb91334c216d19226d9c3c2a1d 100644 --- a/src/core/impl/utils/cuda_helper.cpp +++ b/src/core/impl/utils/cuda_helper.cpp @@ -7,8 +7,6 @@ #include #include -using namespace mgb; - #ifdef WIN32 #include #include @@ -17,6 +15,8 @@ using namespace mgb; #include #endif +#if MGB_CUDA + namespace { #ifndef PATH_MAX @@ -51,11 +51,6 @@ void* dlerror() { return const_cast(errmsg); } -void* dlsym(void* handle, char* name) { - FARPROC symbol = GetProcAddress((HMODULE)handle, name); - return reinterpret_cast(symbol); -} - int check_file_exist(const char* path, int mode) { return _access(path, mode); } @@ -121,7 +116,6 @@ std::string get_nvcc_root_path() { } // namespace std::vector mgb::get_cuda_include_path() { -#if MGB_CUDA std::vector paths; // 1. use CUDA_BIN_PATH auto cuda_path = getenv("CUDA_BIN_PATH"); @@ -163,7 +157,12 @@ std::vector mgb::get_cuda_include_path() { "2. add nvcc path in PATH " "3. add libcudart.so path in LD_LIBRARY_PATH"); return paths; +} + #else + +std::vector mgb::get_cuda_include_path() { mgb_throw(MegBrainError, "cuda disabled at compile time"); -#endif } + +#endif