提交 080a11fe authored 作者: Frederic's avatar Frederic

Fix visiblity and windows problems in cnmem (tested only on Linux)

上级 f68df7f4
......@@ -190,10 +190,6 @@ if compile_cuda_ndarray and cuda_available:
os.makedirs(tmpdir)
compiler = nvcc_compiler.NVCC_compiler()
if sys.platform == 'darwin' and config.lib.cnmem:
raise Exception(
"Currently CNMeM isn't supported on Mac due to"
" problems with symbols on Mac.")
compiler.compile_str(
'cuda_ndarray',
code,
......@@ -201,7 +197,6 @@ if compile_cuda_ndarray and cuda_available:
include_dirs=[cuda_path],
libs=[config.cublas.lib],
preargs=['-O3'] + compiler.compile_args(),
hide_symbols=config.lib.cnmem,
)
from cuda_ndarray.cuda_ndarray import *
except Exception as e:
......
......@@ -41,8 +41,12 @@
#define CNMEM_API __declspec(dllimport)
#endif
#else
#ifdef CNMEM_DLLEXPORT
#define CNMEM_API __attribute__((visibility ("default")))
#else
#define CNMEM_API
#endif
#endif
#define CNMEM_VERSION 100 // It corresponds to 1.0.0
......@@ -249,7 +253,7 @@ cnmemStatus_t CNMEM_API cnmemPrintMemoryState(FILE *file, cudaStream_t stream);
/**
* \brief Converts a cnmemStatus_t value to a string.
*/
const char* cnmemGetErrorString(cnmemStatus_t status);
const char* CNMEM_API cnmemGetErrorString(cnmemStatus_t status);
/* ********************************************************************************************* */
......
......@@ -9,6 +9,10 @@
#include "cuda_ndarray.cuh"
#ifndef CNMEM_DLLEXPORT
#define CNMEM_DLLEXPORT
#endif
#include "cnmem.h"
#include "cnmem.cpp"
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论