blob: 547e98721c62ad46fdde222add5bb01604a3b973 [file] [log] [blame]
#include "caffe2/core/context_gpu.h"
#include "caffe2/operators/math_ops.h"
namespace caffe2 {
struct SqrCUDAFunctor {
template <typename T>
inline void
operator()(const int n, const T* x, T* y, CUDAContext* device_context) {
math::Sqr<T, CUDAContext>(n, x, y, device_context);
}
};
namespace {
REGISTER_CUDA_OPERATOR(
Sqr,
UnaryElementwiseOp<TensorTypes<float>, CUDAContext, SqrCUDAFunctor>);
}
REGISTER_CUDA_OPERATOR(
Pow,
UnaryElementwiseWithArgsOp<TensorTypes<float>, CUDAContext, PowFunctor>);
}