提交 478efa2e 编写于 作者: G gangliao 提交者: GitHub

Merge pull request #3395 from reyoung/feature/fix_random_op_link_error

Feature/fix random op link error
...@@ -40,8 +40,8 @@ class GaussianRandomKernel : public framework::OpKernel { ...@@ -40,8 +40,8 @@ class GaussianRandomKernel : public framework::OpKernel {
&g, CURAND_RNG_PSEUDO_DEFAULT)); &g, CURAND_RNG_PSEUDO_DEFAULT));
PADDLE_ENFORCE( PADDLE_ENFORCE(
platform::dynload::curandSetPseudoRandomGeneratorSeed(g, seed)); platform::dynload::curandSetPseudoRandomGeneratorSeed(g, seed));
curandGenerateNormal(g, data, framework::product(tensor->dims()), mean, platform::dynload::curandGenerateNormal(
std); g, data, framework::product(tensor->dims()), mean, std);
} }
}; };
......
...@@ -48,13 +48,13 @@ extern void *cublas_dso_handle; ...@@ -48,13 +48,13 @@ extern void *cublas_dso_handle;
}; \ }; \
extern DynLoad__##__name __name extern DynLoad__##__name __name
#else #else
#define DECLARE_DYNAMIC_LOAD_CUBLAS_WRAP(__name) \ #define DECLARE_DYNAMIC_LOAD_CUBLAS_WRAP(__name) \
struct DynLoad__##__name { \ struct DynLoad__##__name { \
inline template <typename... Args> \ template <typename... Args> \
cublasStatus_t operator()(Args... args) { \ inline cublasStatus_t operator()(Args... args) { \
return __name(args...); \ return __name(args...); \
} \ } \
}; \ }; \
extern DynLoad__##__name __name extern DynLoad__##__name __name
#endif #endif
......
...@@ -55,6 +55,7 @@ extern void *curand_dso_handle; ...@@ -55,6 +55,7 @@ extern void *curand_dso_handle;
__macro(curandSetPseudoRandomGeneratorSeed); \ __macro(curandSetPseudoRandomGeneratorSeed); \
__macro(curandGenerateUniform); \ __macro(curandGenerateUniform); \
__macro(curandGenerateUniformDouble); \ __macro(curandGenerateUniformDouble); \
__macro(curandGenerateNormal); \
__macro(curandDestroyGenerator); __macro(curandDestroyGenerator);
CURAND_RAND_ROUTINE_EACH(DECLARE_DYNAMIC_LOAD_CURAND_WRAP); CURAND_RAND_ROUTINE_EACH(DECLARE_DYNAMIC_LOAD_CURAND_WRAP);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册