random_op.cu 551 字节
Newer Older
D
dongzhihong 已提交
1 2 3
#include "paddle/operators/random_op.h"
#include "paddle/framework/op_registry.h"

D
dongzhihong 已提交
4 5 6 7 8 9 10 11 12 13 14 15 16
namespace paddle {
namespace operators {

using paddle::platform::GPUPlace;
template<GPUPlace, typename T, typename Generator>
bool Gaussian(Generator g, T* output, const int size, const T& mean, const T& std) {
  return curandGenerateNormal(g, output, size, mean, std);
}

} // operators
} // paddle


D
dongzhihong 已提交
17 18 19
typedef paddle::operators::RandomOpKernel<paddle::platform::GPUPlace, float>
  RandomOpKernel_GPU_float;
REGISTER_OP_GPU_KERNEL(random_op, RandomOpKernel_GPU_float);