diff --git a/paddle/operators/gaussian_random_op.h b/paddle/operators/gaussian_random_op.h index 041390e954fe19f3b55fefd65551370301a6aa6e..c90b665fe0e077ef054ee75f2b8c1b9165eac618 100644 --- a/paddle/operators/gaussian_random_op.h +++ b/paddle/operators/gaussian_random_op.h @@ -34,5 +34,5 @@ class GaussianRandomKernel : public framework::OpKernel { math::RandGaussian(n, mean, std, data, device_context); } }; -} -} +} // namespace operators +} // namespace paddle diff --git a/paddle/operators/math/math_function.cu b/paddle/operators/math/math_function.cu index 3ff622f30824db65110a0215a23efc816e076989..908efe9e0f92170fa218c51ebac7d3d55aeac78d 100644 --- a/paddle/operators/math/math_function.cu +++ b/paddle/operators/math/math_function.cu @@ -149,8 +149,8 @@ void RandUniform(const int n, const float min, const float max, float* output, platform::DeviceContext* context) { auto* cuda_context = reinterpret_cast(context); - PADDLE_ENFORCE( - curandGenerateUniform(cuda_context->curand_generator(), output, n)); + PADDLE_ENFORCE(platform::dynload::curandGenerateUniform( + cuda_context->curand_generator(), output, n)); int block = 512; int grid = (n + block - 1) / block; UniformShift<<stream()>>>(n, min, max, @@ -179,8 +179,8 @@ void RandGaussian(const int n, const float mean, const int even_n = HandleOddLengthRandGaussian(n, mean, std, output, cuda_context); - PADDLE_ENFORCE(curandGenerateNormal(cuda_context->curand_generator(), output, - even_n, mean, std)); + PADDLE_ENFORCE(platform::dynload::curandGenerateNormal( + cuda_context->curand_generator(), output, even_n, mean, std)); } } // namespace math diff --git a/paddle/operators/uniform_random_op.h b/paddle/operators/uniform_random_op.h index ec009b025e7c32fbcb4325f3b1b46ce8f0d9eb85..dffa640f84e4995b12aded3a103fe42a9fe38e83 100644 --- a/paddle/operators/uniform_random_op.h +++ b/paddle/operators/uniform_random_op.h @@ -34,5 +34,5 @@ class UniformRandomKernel : public framework::OpKernel { math::RandUniform(n, min, max, data, device_context); } }; -} -} +} // namespace operators +} // namespace paddle