|
|
@@ -7,8 +7,6 @@ |
|
|
|
#include <sstream> |
|
|
|
#include <string> |
|
|
|
|
|
|
|
using namespace mgb; |
|
|
|
|
|
|
|
#ifdef WIN32 |
|
|
|
#include <io.h> |
|
|
|
#include <windows.h> |
|
|
@@ -17,6 +15,8 @@ using namespace mgb; |
|
|
|
#include <unistd.h> |
|
|
|
#endif |
|
|
|
|
|
|
|
#if MGB_CUDA |
|
|
|
|
|
|
|
namespace { |
|
|
|
|
|
|
|
#ifndef PATH_MAX |
|
|
@@ -51,11 +51,6 @@ void* dlerror() { |
|
|
|
return const_cast<char*>(errmsg); |
|
|
|
} |
|
|
|
|
|
|
|
void* dlsym(void* handle, char* name) { |
|
|
|
FARPROC symbol = GetProcAddress((HMODULE)handle, name); |
|
|
|
return reinterpret_cast<void*>(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<std::string> mgb::get_cuda_include_path() { |
|
|
|
#if MGB_CUDA |
|
|
|
std::vector<std::string> paths; |
|
|
|
// 1. use CUDA_BIN_PATH |
|
|
|
auto cuda_path = getenv("CUDA_BIN_PATH"); |
|
|
@@ -163,7 +157,12 @@ std::vector<std::string> 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<std::string> mgb::get_cuda_include_path() { |
|
|
|
mgb_throw(MegBrainError, "cuda disabled at compile time"); |
|
|
|
#endif |
|
|
|
} |
|
|
|
|
|
|
|
#endif |