提交 64a8aaaf 编写于 作者: M Megvii Engine Team

fix(build): remove ununsed functions when cuda disabled

GitOrigin-RevId: 03f50683f68e47866f7dc5c8609d1d15251818c5
上级 8f17b84a
...@@ -7,8 +7,6 @@ ...@@ -7,8 +7,6 @@
#include <sstream> #include <sstream>
#include <string> #include <string>
using namespace mgb;
#ifdef WIN32 #ifdef WIN32
#include <io.h> #include <io.h>
#include <windows.h> #include <windows.h>
...@@ -17,6 +15,8 @@ using namespace mgb; ...@@ -17,6 +15,8 @@ using namespace mgb;
#include <unistd.h> #include <unistd.h>
#endif #endif
#if MGB_CUDA
namespace { namespace {
#ifndef PATH_MAX #ifndef PATH_MAX
...@@ -51,11 +51,6 @@ void* dlerror() { ...@@ -51,11 +51,6 @@ void* dlerror() {
return const_cast<char*>(errmsg); 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) { int check_file_exist(const char* path, int mode) {
return _access(path, mode); return _access(path, mode);
} }
...@@ -121,7 +116,6 @@ std::string get_nvcc_root_path() { ...@@ -121,7 +116,6 @@ std::string get_nvcc_root_path() {
} // namespace } // namespace
std::vector<std::string> mgb::get_cuda_include_path() { std::vector<std::string> mgb::get_cuda_include_path() {
#if MGB_CUDA
std::vector<std::string> paths; std::vector<std::string> paths;
// 1. use CUDA_BIN_PATH // 1. use CUDA_BIN_PATH
auto cuda_path = getenv("CUDA_BIN_PATH"); auto cuda_path = getenv("CUDA_BIN_PATH");
...@@ -163,7 +157,12 @@ std::vector<std::string> mgb::get_cuda_include_path() { ...@@ -163,7 +157,12 @@ std::vector<std::string> mgb::get_cuda_include_path() {
"2. add nvcc path in PATH " "2. add nvcc path in PATH "
"3. add libcudart.so path in LD_LIBRARY_PATH"); "3. add libcudart.so path in LD_LIBRARY_PATH");
return paths; return paths;
}
#else #else
std::vector<std::string> mgb::get_cuda_include_path() {
mgb_throw(MegBrainError, "cuda disabled at compile time"); mgb_throw(MegBrainError, "cuda disabled at compile time");
#endif
} }
#endif
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册