Unverified Commit bea5c78b authored by Xin Yao's avatar Xin Yao Committed by GitHub
Browse files

[Fix] Remove curand host functions (#5552)

parent b57c56d9
...@@ -315,8 +315,7 @@ macro(dgl_config_cuda out_variable) ...@@ -315,8 +315,7 @@ macro(dgl_config_cuda out_variable)
list(APPEND DGL_LINKER_LIBS list(APPEND DGL_LINKER_LIBS
${CUDA_CUDART_LIBRARY} ${CUDA_CUDART_LIBRARY}
${CUDA_CUBLAS_LIBRARIES} ${CUDA_CUBLAS_LIBRARIES}
${CUDA_cusparse_LIBRARY} ${CUDA_cusparse_LIBRARY})
${CUDA_CURAND_LIBRARY})
set(${out_variable} ${DGL_CUDA_SRC}) set(${out_variable} ${DGL_CUDA_SRC})
endmacro() endmacro()
...@@ -11,10 +11,6 @@ ...@@ -11,10 +11,6 @@
#include <dgl/runtime/registry.h> #include <dgl/runtime/registry.h>
#include <dmlc/omp.h> #include <dmlc/omp.h>
#ifdef DGL_USE_CUDA
#include "../runtime/cuda/cuda_common.h"
#endif // DGL_USE_CUDA
using namespace dgl::runtime; using namespace dgl::runtime;
namespace dgl { namespace dgl {
...@@ -28,17 +24,6 @@ DGL_REGISTER_GLOBAL("rng._CAPI_SetSeed") ...@@ -28,17 +24,6 @@ DGL_REGISTER_GLOBAL("rng._CAPI_SetSeed")
RandomEngine::ThreadLocal()->SetSeed(seed); RandomEngine::ThreadLocal()->SetSeed(seed);
} }
}); });
#ifdef DGL_USE_CUDA
if (DeviceAPI::Get(kDGLCUDA)->IsAvailable()) {
auto *thr_entry = CUDAThreadEntry::ThreadLocal();
if (!thr_entry->curand_gen) {
CURAND_CALL(curandCreateGenerator(
&thr_entry->curand_gen, CURAND_RNG_PSEUDO_DEFAULT));
}
CURAND_CALL(curandSetPseudoRandomGeneratorSeed(
thr_entry->curand_gen, static_cast<uint64_t>(seed)));
}
#endif // DGL_USE_CUDA
}); });
DGL_REGISTER_GLOBAL("rng._CAPI_Choice") DGL_REGISTER_GLOBAL("rng._CAPI_Choice")
......
...@@ -244,8 +244,6 @@ class CUDAThreadEntry { ...@@ -244,8 +244,6 @@ class CUDAThreadEntry {
cusparseHandle_t cusparse_handle{nullptr}; cusparseHandle_t cusparse_handle{nullptr};
/** @brief The cublas handler */ /** @brief The cublas handler */
cublasHandle_t cublas_handle{nullptr}; cublasHandle_t cublas_handle{nullptr};
/** @brief The curand generator */
curandGenerator_t curand_gen{nullptr};
/** @brief thread local pool*/ /** @brief thread local pool*/
WorkspacePool pool; WorkspacePool pool;
/** @brief constructor */ /** @brief constructor */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment