cuda
stringlengths
84
3.33k
hip
stringlengths
140
3.32k
#include "caffe2/core/context_gpu.h" #include "caffe2/operators/ceil_op.h" #include "caffe2/utils/math.h" namespace caffe2 { template <typename T> __global__ void CeilKernel(const int N, const T* X, T* Y) { CUDA_1D_KERNEL_LOOP(i, N) { Y[i] = std::ceil(X[i]); } } template <> bool CeilOp<float, CUDAContext>::...
// !!! This is a file automatically generated by hipify!!! #include "hip/hip_runtime.h" #include "caffe2/core/hip/context_gpu.h" #include "caffe2/operators/ceil_op.h" #include "caffe2/utils/math.h" namespace caffe2 { template <typename T> __global__ void CeilKernel(const int N, const T* X, T* Y) { HIP_1D_KERNEL_LO...
#include "caffe2/core/context_gpu.h" #include "caffe2/operators/clip_op.h" namespace caffe2 { namespace { template <typename T> __device__ T cuda_min(T x, T y); template <typename T> __device__ T cuda_max(T x, T y); template <> __device__ float cuda_min(float x, float y) { return fminf(x, y); } template <> __device_...
// !!! This is a file automatically generated by hipify!!! #include "hip/hip_runtime.h" #include "caffe2/core/hip/context_gpu.h" #include "caffe2/operators/clip_op.h" namespace caffe2 { namespace { template <typename T> __device__ T hip_min(T x, T y); template <typename T> __device__ T hip_max(T x, T y); template <>...
#include "caffe2/core/context_gpu.h" #include "caffe2/core/operator.h" #include "caffe2/operators/no_default_engine_op.h" namespace caffe2 { // Communication operators do not have default engines. REGISTER_CUDA_OPERATOR(CreateCommonWorld, NoDefaultEngineOp<CUDAContext>); REGISTER_CUDA_OPERATOR(CloneCommonWorld, NoDef...
// !!! This is a file automatically generated by hipify!!! #include "caffe2/core/hip/context_gpu.h" #include "caffe2/core/operator.h" #include "caffe2/operators/no_default_engine_op.h" namespace caffe2 { // Communication operators do not have default engines. REGISTER_HIP_OPERATOR(CreateCommonWorld, NoDefaultEngineOp...
#include "caffe2/core/context_gpu.h" #include "caffe2/operators/concat_split_op.h" namespace caffe2 { REGISTER_CUDA_OPERATOR(Split, SplitOp<CUDAContext>); REGISTER_CUDA_OPERATOR(Concat, ConcatOp<CUDAContext>); // Backward compatibility settings REGISTER_CUDA_OPERATOR(DepthSplit, SplitOp<CUDAContext>); REGISTER_CUDA_...
// !!! This is a file automatically generated by hipify!!! #include "caffe2/core/hip/context_gpu.h" #include "caffe2/operators/concat_split_op.h" namespace caffe2 { REGISTER_HIP_OPERATOR(Split, SplitOp<HIPContext>); REGISTER_HIP_OPERATOR(Concat, ConcatOp<HIPContext>); // Backward compatibility settings REGISTER_HIP_...
#include "caffe2/operators/conv_op.h" #include "caffe2/operators/conv_op_impl.h" #include "caffe2/core/context_gpu.h" namespace caffe2 { REGISTER_CUDA_OPERATOR(Conv, ConvOp<float, CUDAContext>); REGISTER_CUDA_OPERATOR(ConvGradient, ConvGradientOp<float, CUDAContext>); REGISTER_CUDA_OPERATOR(Conv1D, ConvOp<float, CUD...
// !!! This is a file automatically generated by hipify!!! #include "caffe2/operators/conv_op.h" #include "caffe2/operators/conv_op_impl.h" #include "caffe2/core/hip/context_gpu.h" namespace caffe2 { REGISTER_HIP_OPERATOR(Conv, ConvOp<float, HIPContext>); REGISTER_HIP_OPERATOR(ConvGradient, ConvGradientOp<float, HIPC...
#include "caffe2/core/context_gpu.h" #include "caffe2/operators/conv_op_shared.h" namespace caffe2 { template <> void createSharedBuffer<CUDAContext>(Workspace* ws) { auto* mutexPtr = ws->CreateBlob("__CAFFE2_SHARED_CONV_BUFFER_CUDA_MUTEX__") ->GetMutable<std::unique_ptr<std::mutex>>(); mu...
// !!! This is a file automatically generated by hipify!!! #include "caffe2/core/hip/context_gpu.h" #include "caffe2/operators/conv_op_shared.h" namespace caffe2 { template <> void createSharedBuffer<HIPContext>(Workspace* ws) { auto* mutexPtr = ws->CreateBlob("__CAFFE2_SHARED_CONV_BUFFER_HIP_MUTEX__") ...
#include "caffe2/core/context_gpu.h" #include "caffe2/operators/conv_transpose_op.h" #include "caffe2/operators/conv_transpose_op_impl.h" namespace caffe2 { REGISTER_CUDA_OPERATOR(ConvTranspose, ConvTransposeOp<float, CUDAContext>); REGISTER_CUDA_OPERATOR( ConvTransposeGradient, ConvTransposeGradientOp<float,...
// !!! This is a file automatically generated by hipify!!! #include "caffe2/core/hip/context_gpu.h" #include "caffe2/operators/conv_transpose_op.h" #include "caffe2/operators/conv_transpose_op_impl.h" namespace caffe2 { REGISTER_HIP_OPERATOR(ConvTranspose, ConvTransposeOp<float, HIPContext>); REGISTER_HIP_OPERATOR( ...
#include "caffe2/core/context_gpu.h" #include "caffe2/operators/copy_op.h" namespace caffe2 { template <> class CopyOnDeviceLikeOp<CUDAContext, CUDAContext, CUDAContext> : public Operator<CUDAContext> { public: template <class... Args> explicit CopyOnDeviceLikeOp(Args&&... args) : Operator<CUDAContext...
// !!! This is a file automatically generated by hipify!!! #include "caffe2/core/hip/context_gpu.h" #include "caffe2/operators/copy_op.h" namespace caffe2 { template <> class CopyOnDeviceLikeOp<HIPContext, HIPContext, HIPContext> : public Operator<HIPContext> { public: template <class... Args> explicit Copy...
#include "caffe2/operators/cosh_op.h" #include <c10/util/accumulate.h> #include "caffe2/core/context_gpu.h" #include <algorithm> #include <functional> namespace caffe2 { namespace { __global__ void CoshGradientCUDAKernel( const int N, const float* dY, const float* X, float* dX) { CUDA_1D_KERNEL_...
// !!! This is a file automatically generated by hipify!!! #include "hip/hip_runtime.h" #include "caffe2/operators/cosh_op.h" #include <c10/util/accumulate.h> #include "caffe2/core/hip/context_gpu.h" #include <algorithm> #include <functional> namespace caffe2 { namespace { __global__ void CoshGradientHIPKernel( ...
#include "caffe2/core/context_gpu.h" #include "caffe2/operators/cosine_embedding_criterion_op.h" namespace caffe2 { namespace { __global__ void CECKernel( const int N, const float* S, const int* Y, const float margin, float* output) { CUDA_1D_KERNEL_LOOP(i, N) { output[i] = Y[i] == 1 ? (1. - S[i]) : f...
// !!! This is a file automatically generated by hipify!!! #include "hip/hip_runtime.h" #include "caffe2/core/hip/context_gpu.h" #include "caffe2/operators/cosine_embedding_criterion_op.h" namespace caffe2 { namespace { __global__ void CECKernel( const int N, const float* S, const int* Y, const float margin, ...
#define TORCH_ASSERT_NO_OPERATORS #define _USE_MATH_DEFINES #include <ATen/native/Activation.h> #include <cmath> #include <thrust/tuple.h> #include <ATen/AccumulateType.h> #include <ATen/Dispatch.h> #include <ATen/core/TensorBase.h> #include <c10/core/Scalar.h> #include <c10/cuda/CUDAMathCompat.h> #include <ATen/c...
// !!! This is a file automatically generated by hipify!!! #define TORCH_ASSERT_NO_OPERATORS #define _USE_MATH_DEFINES #include <ATen/native/Activation.h> #include <cmath> #include <thrust/tuple.h> #include <ATen/AccumulateType.h> #include <ATen/Dispatch.h> #include <ATen/core/TensorBase.h> #include <c10/core/Scal...
#define TORCH_ASSERT_NO_OPERATORS #include <ATen/cuda/CUDAConfig.h> #include <ATen/cuda/cub.cuh> namespace at { namespace cuda { namespace cub { template <typename key_t> void radix_sort_keys( const key_t* keys_in, key_t* keys_out, int64_t n, bool descending, int64_t begin_bit, int64_t end_bi...
// !!! This is a file automatically generated by hipify!!! #define TORCH_ASSERT_NO_OPERATORS #include <ATen/hip\HIPConfig.h> #include <ATen/hip\cub.cuh> namespace at { namespace hip { namespace cub { template <typename key_t> void radix_sort_keys( const key_t* keys_in, key_t* keys_out, int64_t n, boo...
#include "caffe2/operators/cos_op.h" #include <algorithm> #include <functional> #include "caffe2/core/context_gpu.h" namespace caffe2 { namespace { template <typename T> __global__ void CosGradientCUDAKernel(const int N, const T* dY, const T* X, T* dX) { CUDA_1D_KERNEL_LOOP(i, N) { #if __CUDA_ARCH__ >= 350 ...
// !!! This is a file automatically generated by hipify!!! #include "hip/hip_runtime.h" #include "caffe2/operators/cos_op.h" #include <algorithm> #include <functional> #include "caffe2/core/hip/context_gpu.h" namespace caffe2 { namespace { template <typename T> __global__ void CosGradientHIPKernel(const int N, co...
#include "caffe2/core/context_gpu.h" #include "caffe2/operators/counter_ops.h" namespace caffe2 { REGISTER_CUDA_OPERATOR(CreateCounter, CreateCounterOp<int64_t, CUDAContext>); REGISTER_CUDA_OPERATOR(ResetCounter, ResetCounterOp<int64_t, CUDAContext>); REGISTER_CUDA_OPERATOR(CountDown, CountDownOp<int64_t, CUDAContext...
// !!! This is a file automatically generated by hipify!!! #include "caffe2/core/hip/context_gpu.h" #include "caffe2/operators/counter_ops.h" namespace caffe2 { REGISTER_HIP_OPERATOR(CreateCounter, CreateCounterOp<int64_t, HIPContext>); REGISTER_HIP_OPERATOR(ResetCounter, ResetCounterOp<int64_t, HIPContext>); REGISTE...
#include "caffe2/operators/cube_op.h" #include <algorithm> #include <functional> #include "caffe2/core/context_gpu.h" namespace caffe2 { namespace { template <typename T> __global__ void CubeGradientCUDAKernel(const int N, const T* dY, const T* X, T* dX) { CUDA_1D_KERNEL_LOOP(i, N) { #if __CUDA_ARCH__ >= 350 ...
// !!! This is a file automatically generated by hipify!!! #include "hip/hip_runtime.h" #include "caffe2/operators/cube_op.h" #include <algorithm> #include <functional> #include "caffe2/core/hip/context_gpu.h" namespace caffe2 { namespace { template <typename T> __global__ void CubeGradientHIPKernel(const int N, ...
#include "caffe2/core/context_gpu.h" #include "caffe2/operators/data_couple.h" namespace caffe2 { REGISTER_CUDA_OPERATOR(DataCouple, DataCoupleOp<CUDAContext>); } ###
// !!! This is a file automatically generated by hipify!!! #include "caffe2/core/hip/context_gpu.h" #include "caffe2/operators/data_couple.h" namespace caffe2 { REGISTER_HIP_OPERATOR(DataCouple, DataCoupleOp<HIPContext>); } ###
#include "caffe2/operators/do_op.h" #include "caffe2/core/context_gpu.h" namespace caffe2 { REGISTER_CUDA_OPERATOR(Do, DoOp<CUDAContext>); } // namespace caffe2 ###
// !!! This is a file automatically generated by hipify!!! #include "caffe2/operators/do_op.h" #include "caffe2/core/hip/context_gpu.h" namespace caffe2 { REGISTER_HIP_OPERATOR(Do, DoOp<HIPContext>); } // namespace caffe2 ###
#include "caffe2/core/context_gpu.h" #include "caffe2/operators/dropout_op.h" namespace caffe2 { namespace { __global__ void DropoutKernel( const int N, const float ratio, const float* Xdata, float* Ydata, bool* maskdata) { const float scale = 1. / (1. - ratio); CUDA_1D_KERNEL_LOOP(i, N) { maskdata[i] = (Ydata[i...
#include "hip/hip_runtime.h" #include "caffe2/core/hip/context_gpu.h" #include "caffe2/operators/dropout_op.h" namespace caffe2 { namespace { __global__ void DropoutKernel( const int N, const float ratio, const float* Xdata, float* Ydata, bool* maskdata) { const float scale = 1. / (1. - ratio); HIP_1D_KERNEL_LOOP...
#include "caffe2/operators/elementwise_add_op.h" #include "caffe2/core/context_gpu.h" namespace caffe2 { REGISTER_CUDA_OPERATOR( Add, BinaryElementwiseOp<NumericTypes, CUDAContext, AddFunctor<CUDAContext>>); REGISTER_CUDA_OPERATOR( AddGradient, BinaryElementwiseGradientOp< NumericTypes, ...
// !!! This is a file automatically generated by hipify!!! #include "caffe2/operators/elementwise_add_op.h" #include "caffe2/core/hip/context_gpu.h" namespace caffe2 { REGISTER_HIP_OPERATOR( Add, BinaryElementwiseOp<NumericTypes, HIPContext, AddFunctor<HIPContext>>); REGISTER_HIP_OPERATOR( AddGradient, ...
#include "caffe2/operators/elementwise_op_test.h" #include "caffe2/core/context_gpu.h" #include "caffe2/core/flags.h" C10_DECLARE_string(caffe_test_root); template <> void CopyVector<caffe2::CUDAContext>(const int N, const bool* x, bool* y) { CUDA_CHECK(cudaMemcpy(y, x, N * sizeof(bool), cudaMemcpyHostToDevice));...
// !!! This is a file automatically generated by hipify!!! #include "caffe2/operators/elementwise_op_test.h" #include "caffe2/core/hip/context_gpu.h" #include "caffe2/core/flags.h" C10_DECLARE_string(caffe_test_root); template <> void CopyVector<caffe2::HIPContext>(const int N, const bool* x, bool* y) { HIP_CHECK...
#include "caffe2/operators/elementwise_sub_op.h" #include "caffe2/core/context_gpu.h" namespace caffe2 { REGISTER_CUDA_OPERATOR( Sub, BinaryElementwiseOp<NumericTypes, CUDAContext, SubFunctor<CUDAContext>>); REGISTER_CUDA_OPERATOR( SubGradient, BinaryElementwiseGradientOp< NumericTypes, ...
// !!! This is a file automatically generated by hipify!!! #include "caffe2/operators/elementwise_sub_op.h" #include "caffe2/core/hip/context_gpu.h" namespace caffe2 { REGISTER_HIP_OPERATOR( Sub, BinaryElementwiseOp<NumericTypes, HIPContext, SubFunctor<HIPContext>>); REGISTER_HIP_OPERATOR( SubGradient, ...
#include "caffe2/operators/elu_op.h" #include <algorithm> #include <functional> #include "caffe2/core/context_gpu.h" namespace caffe2 { namespace { template <typename T> __global__ void EluCUDAKernel(const int N, const T alpha, const T* X, T* Y); template <> __global__ void EluCUDAKernel<float>(const int N, cons...
// !!! This is a file automatically generated by hipify!!! #include "hip/hip_runtime.h" #include "caffe2/operators/elu_op.h" #include <algorithm> #include <functional> #include "caffe2/core/hip/context_gpu.h" namespace caffe2 { namespace { template <typename T> __global__ void EluHIPKernel(const int N, const T al...
#define TORCH_ASSERT_NO_OPERATORS #define _USE_MATH_DEFINES #include <ATen/native/Activation.h> #include <cmath> #include <thrust/tuple.h> #include <ATen/AccumulateType.h> #include <ATen/Dispatch.h> #include <ATen/core/TensorBase.h> #include <c10/core/Scalar.h> #include <c10/cuda/CUDAMathCompat.h> #include <ATen/c...
// !!! This is a file automatically generated by hipify!!! #define TORCH_ASSERT_NO_OPERATORS #define _USE_MATH_DEFINES #include <ATen/native/Activation.h> #include <cmath> #include <thrust/tuple.h> #include <ATen/AccumulateType.h> #include <ATen/Dispatch.h> #include <ATen/core/TensorBase.h> #include <c10/core/Scal...
#include "caffe2/operators/enforce_finite_op.h" #include "caffe2/core/context_gpu.h" namespace caffe2 { template <> template <typename T> bool EnforceFiniteOp<CUDAContext>::DoRunWithType() { buffer_.CopyFrom(Input(0)); // sync copy EnforceOnCPU<T>(buffer_); return true; } REGISTER_CUDA_OPERATOR(EnforceFinite...
// !!! This is a file automatically generated by hipify!!! #include "caffe2/operators/enforce_finite_op.h" #include "caffe2/core/hip/context_gpu.h" namespace caffe2 { template <> template <typename T> bool EnforceFiniteOp<HIPContext>::DoRunWithType() { buffer_.CopyFrom(Input(0)); // sync copy EnforceOnCPU<T>(bu...
#include "caffe2/operators/ensure_cpu_output_op.h" #include "caffe2/core/context_gpu.h" namespace caffe2 { // From CUDA Context, takes either CUDA or CPU tensor as input, and produce // TensorCPU REGISTER_CUDA_OPERATOR(EnsureCPUOutput, EnsureCPUOutputOp<CUDAContext>); } // namespace caffe2 ###
// !!! This is a file automatically generated by hipify!!! #include "caffe2/operators/ensure_cpu_output_op.h" #include "caffe2/core/hip/context_gpu.h" namespace caffe2 { // From HIP Context, takes either HIP or CPU tensor as input, and produce // TensorCPU REGISTER_HIP_OPERATOR(EnsureCPUOutput, EnsureCPUOutputOp<HIP...
#include "caffe2/operators/erf_op.h" #include <algorithm> #include <functional> #include "caffe2/core/context_gpu.h" namespace caffe2 { namespace { __global__ void ErfGradientCUDAKernel( const int N, const float* dY, const float* X, float* dX) { CUDA_1D_KERNEL_LOOP(i, N) { #if __CUDA_ARCH__ >= 3...
// !!! This is a file automatically generated by hipify!!! #include "hip/hip_runtime.h" #include "caffe2/operators/erf_op.h" #include <algorithm> #include <functional> #include "caffe2/core/hip/context_gpu.h" namespace caffe2 { namespace { __global__ void ErfGradientHIPKernel( const int N, const float* dY...
#include "caffe2/operators/expand_op.h" #include "caffe2/core/context_gpu.h" namespace caffe2 { REGISTER_CUDA_OPERATOR( Expand, ExpandOp< TensorTypes<std::int32_t, std::int64_t, float, double>, CUDAContext>); REGISTER_CUDA_OPERATOR( ExpandGradient, ExpandGradientOp< TensorTyp...
// !!! This is a file automatically generated by hipify!!! #include "caffe2/operators/expand_op.h" #include "caffe2/core/hip/context_gpu.h" namespace caffe2 { REGISTER_HIP_OPERATOR( Expand, ExpandOp< TensorTypes<std::int32_t, std::int64_t, float, double>, HIPContext>); REGISTER_HIP_OPERATOR(...
#include "caffe2/core/context_gpu.h" #include "caffe2/operators/expand_squeeze_dims_op.h" namespace caffe2 { REGISTER_CUDA_OPERATOR(Squeeze, SqueezeOp<CUDAContext>); REGISTER_CUDA_OPERATOR(ExpandDims, ExpandDimsOp<CUDAContext>); } // namespace caffe2 ###
// !!! This is a file automatically generated by hipify!!! #include "caffe2/core/hip/context_gpu.h" #include "caffe2/operators/expand_squeeze_dims_op.h" namespace caffe2 { REGISTER_HIP_OPERATOR(Squeeze, SqueezeOp<HIPContext>); REGISTER_HIP_OPERATOR(ExpandDims, ExpandDimsOp<HIPContext>); } // namespace caffe2 ###
#include "caffe2/operators/exp_op.h" #include "caffe2/core/context_gpu.h" namespace caffe2 { REGISTER_CUDA_OPERATOR( Exp, UnaryElementwiseOp< TensorTypes<float>, CUDAContext, ExpFunctor<CUDAContext>>); } // namespace caffe2 ###
// !!! This is a file automatically generated by hipify!!! #include "caffe2/operators/exp_op.h" #include "caffe2/core/hip/context_gpu.h" namespace caffe2 { REGISTER_HIP_OPERATOR( Exp, UnaryElementwiseOp< TensorTypes<float>, HIPContext, ExpFunctor<HIPContext>>); } // namespace caffe2...
#include <cmath> #include "caffe2/core/context_gpu.h" #include "caffe2/operators/filler_op.h" #include "caffe2/operators/operator_fallback_gpu.h" namespace caffe2 { namespace { __global__ void FillRangeKernel(const int n, float* data) { CUDA_1D_KERNEL_LOOP(index, n) { data[index] = index; } } template <type...
// !!! This is a file automatically generated by hipify!!! #include "hip/hip_runtime.h" #include <cmath> #include "caffe2/core/hip/context_gpu.h" #include "caffe2/operators/filler_op.h" #include "caffe2/operators/hip/operator_fallback_gpu.h" namespace caffe2 { namespace { __global__ void FillRangeKernel(const int n,...
#include <cub/block/block_reduce.cuh> #include "caffe2/core/context_gpu.h" #include "caffe2/operators/find_op.h" #include "caffe2/utils/cub_namespace.cuh" namespace caffe2 { template <typename T> __global__ void FindKernel( int num_needles, int idx_size, const T* idx, const T* needles, int* out, ...
// !!! This is a file automatically generated by hipify!!! #include "hip/hip_runtime.h" #include <hipcub/hipcub.hpp> #include "caffe2/core/hip/context_gpu.h" #include "caffe2/operators/find_op.h" #include "caffe2/utils/cub_namespace.cuh" namespace caffe2 { template <typename T> __global__ void FindKernel( int nu...
#include "caffe2/core/context_gpu.h" #include "caffe2/operators/floor_op.h" #include "caffe2/utils/math.h" namespace caffe2 { template <typename T> __global__ void FloorKernel(const int N, const T* X, T* Y) { CUDA_1D_KERNEL_LOOP(i, N) { Y[i] = std::floor(X[i]); } } template <> bool FloorOp<float, CUDAContex...
// !!! This is a file automatically generated by hipify!!! #include "hip/hip_runtime.h" #include "caffe2/core/hip/context_gpu.h" #include "caffe2/operators/floor_op.h" #include "caffe2/utils/math.h" namespace caffe2 { template <typename T> __global__ void FloorKernel(const int N, const T* X, T* Y) { HIP_1D_KERNEL_...
#include "caffe2/core/context_gpu.h" #include "caffe2/operators/free_op.h" namespace caffe2 { REGISTER_CUDA_OPERATOR(Free, FreeOp<CUDAContext>); } // namespace caffe2 ###
// !!! This is a file automatically generated by hipify!!! #include "caffe2/core/hip/context_gpu.h" #include "caffe2/operators/free_op.h" namespace caffe2 { REGISTER_HIP_OPERATOR(Free, FreeOp<HIPContext>); } // namespace caffe2 ###
#define TORCH_ASSERT_NO_OPERATORS #define _USE_MATH_DEFINES #include <ATen/native/Activation.h> #include <cmath> #include <thrust/tuple.h> #include <ATen/AccumulateType.h> #include <ATen/Dispatch.h> #include <ATen/core/TensorBase.h> #include <c10/core/Scalar.h> #include <c10/cuda/CUDAMathCompat.h> #include <ATen/c...
// !!! This is a file automatically generated by hipify!!! #define TORCH_ASSERT_NO_OPERATORS #define _USE_MATH_DEFINES #include <ATen/native/Activation.h> #include <cmath> #include <thrust/tuple.h> #include <ATen/AccumulateType.h> #include <ATen/Dispatch.h> #include <ATen/core/TensorBase.h> #include <c10/core/Scal...
#include "caffe2/core/context_gpu.h" #include "caffe2/operators/gather_op.h" #include "caffe2/operators/gather_op.cuh" namespace caffe2 { template <> bool GatherOp<CUDAContext>::RunOnDevice() { return DispatchHelper<TensorTypes<int32_t, int64_t>>::call( this, OperatorBase::Input<Tensor>(INDICES, CUDA)); } t...
// !!! This is a file automatically generated by hipify!!! #include "caffe2/core/hip/context_gpu.h" #include "caffe2/operators/gather_op.h" #include "caffe2/operators/hip/gather_op.cuh" namespace caffe2 { template <> bool GatherOp<HIPContext>::RunOnDevice() { return DispatchHelper<TensorTypes<int32_t, int64_t>>::c...
#ifndef CAFFE2_OPERATORS_UTILS_NMS_GPU_H_ #define CAFFE2_OPERATORS_UTILS_NMS_GPU_H_ #include <vector> #include "caffe2/core/context_gpu.h" namespace caffe2 { namespace utils { // Computes Non-Maximum Suppression on the GPU // Reject a bounding box if its region has an intersection-overunion (IoU) // overlap wit...
// !!! This is a file automatically generated by hipify!!! #ifndef CAFFE2_OPERATORS_UTILS_NMS_GPU_H_ #define CAFFE2_OPERATORS_UTILS_NMS_GPU_H_ #include <vector> #include "caffe2/core/hip/context_gpu.h" namespace caffe2 { namespace utils { // Computes Non-Maximum Suppression on the GPU // Reject a bounding box if i...
#include "caffe2/core/context_gpu.h" #include "caffe2/operators/given_tensor_byte_string_to_uint8_fill_op.h" namespace caffe2 { REGISTER_CUDA_OPERATOR( GivenTensorByteStringToUInt8Fill, GivenTensorByteStringToUInt8FillOp<CUDAContext>); } ###
// !!! This is a file automatically generated by hipify!!! #include "caffe2/core/hip/context_gpu.h" #include "caffe2/operators/given_tensor_byte_string_to_uint8_fill_op.h" namespace caffe2 { REGISTER_HIP_OPERATOR( GivenTensorByteStringToUInt8Fill, GivenTensorByteStringToUInt8FillOp<HIPContext>); } ###
#include "caffe2/core/context_gpu.h" #include "caffe2/operators/given_tensor_fill_op.h" namespace caffe2 { REGISTER_CUDA_OPERATOR(GivenTensorFill, GivenTensorFillOp<float, CUDAContext>); REGISTER_CUDA_OPERATOR( GivenTensorDoubleFill, GivenTensorFillOp<double, CUDAContext>); REGISTER_CUDA_OPERATOR( GivenT...
// !!! This is a file automatically generated by hipify!!! #include "caffe2/core/hip/context_gpu.h" #include "caffe2/operators/given_tensor_fill_op.h" namespace caffe2 { REGISTER_HIP_OPERATOR(GivenTensorFill, GivenTensorFillOp<float, HIPContext>); REGISTER_HIP_OPERATOR( GivenTensorDoubleFill, GivenTensorFill...
#include "caffe2/operators/glu_op.h" #include "caffe2/core/context_gpu.h" namespace caffe2 { namespace { __global__ void glu_kernel( const int M, const int split_dim_size, const int N, const float* Xdata, float* Ydata) { const int xOffset = 2 * split_dim_size * N; const int yOffset = split_d...
// !!! This is a file automatically generated by hipify!!! #include "hip/hip_runtime.h" #include "caffe2/operators/glu_op.h" #include "caffe2/core/hip/context_gpu.h" namespace caffe2 { namespace { __global__ void glu_kernel( const int M, const int split_dim_size, const int N, const float* Xdata, ...
#include "caffe2/operators/half_float_ops.h" #include "caffe2/core/context_gpu.h" #ifdef CAFFE_HAS_CUDA_FP16 namespace caffe2 { namespace { __global__ void FloatToHalfKernel(const int N, const float* X, half* Y) { CUDA_1D_KERNEL_LOOP(i, N) { Y[i] = __float2half(X[i]); } } __global__ void HalfToFloatKernel(const in...
#include "hip/hip_runtime.h" #include "caffe2/operators/half_float_ops.h" #include "caffe2/core/hip/context_gpu.h" #ifdef CAFFE_HAS_HIP_FP16 namespace caffe2 { namespace { __global__ void FloatToHalfKernel(const int N, const float* X, half* Y) { HIP_1D_KERNEL_LOOP(i, N) { Y[i] = __float2half(X[i]); } } __global__...
#include "caffe2/operators/hard_sigmoid_op.h" #include <algorithm> #include <functional> #include "caffe2/core/context_gpu.h" namespace caffe2 { namespace { template <typename T> __global__ void HardSigmoidCUDAKernel( const int N, const T alpha, const T beta, const T* X, T* Y) { CUDA_1D_KERN...
// !!! This is a file automatically generated by hipify!!! #include "hip/hip_runtime.h" #include "caffe2/operators/hard_sigmoid_op.h" #include <algorithm> #include <functional> #include "caffe2/core/hip/context_gpu.h" namespace caffe2 { namespace { template <typename T> __global__ void HardSigmoidHIPKernel( c...
#include "caffe2/operators/if_op.h" #include "caffe2/core/context_gpu.h" namespace caffe2 { REGISTER_CUDA_OPERATOR(If, IfOp<CUDAContext>); } // namespace caffe2 ###
// !!! This is a file automatically generated by hipify!!! #include "caffe2/operators/if_op.h" #include "caffe2/core/hip/context_gpu.h" namespace caffe2 { REGISTER_HIP_OPERATOR(If, IfOp<HIPContext>); } // namespace caffe2 ###
#include "caffe2/core/context_gpu.h" #include "caffe2/operators/im2col_op.h" namespace caffe2 { REGISTER_CUDA_OPERATOR(Im2Col, Im2ColOp<float, CUDAContext>); REGISTER_CUDA_OPERATOR(Col2Im, Col2ImOp<float, CUDAContext>); } // namespace caffe2 ###
// !!! This is a file automatically generated by hipify!!! #include "caffe2/core/hip/context_gpu.h" #include "caffe2/operators/im2col_op.h" namespace caffe2 { REGISTER_HIP_OPERATOR(Im2Col, Im2ColOp<float, HIPContext>); REGISTER_HIP_OPERATOR(Col2Im, Col2ImOp<float, HIPContext>); } // namespace caffe2 ###
#include "caffe2/core/context_gpu.h" #include "caffe2/operators/leaky_relu_op.h" #include "caffe2/utils/math.h" namespace caffe2 { namespace { template <typename T> __global__ void LeakyReluKernel(const int N, const T alpha, const T* X, T* Y) { CUDA_1D_KERNEL_LOOP(i, N) { Y[i] = X[i] >= 0 ? X[i] : X[i] * alpha...
// !!! This is a file automatically generated by hipify!!! #include "hip/hip_runtime.h" #include "caffe2/core/hip/context_gpu.h" #include "caffe2/operators/leaky_relu_op.h" #include "caffe2/utils/math.h" namespace caffe2 { namespace { template <typename T> __global__ void LeakyReluKernel(const int N, const T alpha, ...
#define TORCH_ASSERT_NO_OPERATORS #define _USE_MATH_DEFINES #include <ATen/native/Activation.h> #include <cmath> #include <thrust/tuple.h> #include <ATen/AccumulateType.h> #include <ATen/Dispatch.h> #include <ATen/core/TensorBase.h> #include <c10/core/Scalar.h> #include <c10/cuda/CUDAMathCompat.h> #include <ATen/c...
// !!! This is a file automatically generated by hipify!!! #define TORCH_ASSERT_NO_OPERATORS #define _USE_MATH_DEFINES #include <ATen/native/Activation.h> #include <cmath> #include <thrust/tuple.h> #include <ATen/AccumulateType.h> #include <ATen/Dispatch.h> #include <ATen/core/TensorBase.h> #include <c10/core/Scal...
#include "caffe2/operators/lengths_pad_op.h" #include "caffe2/core/context_gpu.h" namespace caffe2 { REGISTER_CUDA_OPERATOR(LengthsPad, LengthsPadOp<CUDAContext>); } // namespace caffe2 ###
// !!! This is a file automatically generated by hipify!!! #include "caffe2/operators/lengths_pad_op.h" #include "caffe2/core/hip/context_gpu.h" namespace caffe2 { REGISTER_HIP_OPERATOR(LengthsPad, LengthsPadOp<HIPContext>); } // namespace caffe2 ###
#include "caffe2/core/context_gpu.h" #include "caffe2/operators/load_save_op.h" namespace caffe2 { template <> void LoadOp<CUDAContext>::SetCurrentDevice(BlobProto* proto) { if (proto->has_tensor()) { proto->mutable_tensor()->clear_device_detail(); auto* device_detail = proto->mutable_tensor()->mutable_dev...
// !!! This is a file automatically generated by hipify!!! #include "caffe2/core/hip/context_gpu.h" #include "caffe2/operators/load_save_op.h" namespace caffe2 { template <> void LoadOp<HIPContext>::SetCurrentDevice(BlobProto* proto) { if (proto->has_tensor()) { proto->mutable_tensor()->clear_device_detail(); ...
#include "caffe2/core/context_gpu.h" #include "caffe2/operators/locally_connected_op.h" #include "caffe2/operators/locally_connected_op_impl.h" namespace caffe2 { REGISTER_CUDA_OPERATOR(LC, LocallyConnectedOp<float, CUDAContext>); REGISTER_CUDA_OPERATOR( LCGradient, LocallyConnectedGradientOp<float, CUDACont...
// !!! This is a file automatically generated by hipify!!! #include "caffe2/core/hip/context_gpu.h" #include "caffe2/operators/locally_connected_op.h" #include "caffe2/operators/locally_connected_op_impl.h" namespace caffe2 { REGISTER_HIP_OPERATOR(LC, LocallyConnectedOp<float, HIPContext>); REGISTER_HIP_OPERATOR( ...
#include "caffe2/operators/log1p_op.h" #include <algorithm> #include <functional> #include "caffe2/core/context_gpu.h" namespace caffe2 { namespace { template <typename T> __global__ void Log1pGradientCUDAKernel(const int N, const T* dY, const T* X, T* dX) { CUDA_1D_KERNEL_LOOP(i, N) { #if __CUDA_ARCH__ >= 350 ...
// !!! This is a file automatically generated by hipify!!! #include "hip/hip_runtime.h" #include "caffe2/operators/log1p_op.h" #include <algorithm> #include <functional> #include "caffe2/core/hip/context_gpu.h" namespace caffe2 { namespace { template <typename T> __global__ void Log1pGradientHIPKernel(const int N...
#include "caffe2/operators/logit_op.h" #include "caffe2/core/context_gpu.h" namespace caffe2 { namespace { template <typename T> __global__ void LogitKernel(const int N, const T* X, const float eps, T* Y) { CUDA_1D_KERNEL_LOOP(i, N) { Y[i] = fminf(X[i], (T(1) - eps)); Y[i] = fmaxf(Y[i], eps); Y[i] = ...
// !!! This is a file automatically generated by hipify!!! #include "hip/hip_runtime.h" #include "caffe2/operators/logit_op.h" #include "caffe2/core/hip/context_gpu.h" namespace caffe2 { namespace { template <typename T> __global__ void LogitKernel(const int N, const T* X, const float eps, T* Y) { HIP_1D_KERNEL_...
#include "caffe2/operators/log_op.h" #include "caffe2/core/context_gpu.h" namespace caffe2 { REGISTER_CUDA_OPERATOR( Log, UnaryElementwiseOp< TensorTypes<float>, CUDAContext, LogFunctor<CUDAContext>>); } // namespace caffe2 ###
// !!! This is a file automatically generated by hipify!!! #include "caffe2/operators/log_op.h" #include "caffe2/core/hip/context_gpu.h" namespace caffe2 { REGISTER_HIP_OPERATOR( Log, UnaryElementwiseOp< TensorTypes<float>, HIPContext, LogFunctor<HIPContext>>); } // namespace caffe2...
#include "caffe2/core/context_gpu.h" #include "caffe2/operators/loss_op.h" namespace caffe2 { REGISTER_CUDA_OPERATOR(AveragedLoss, AveragedLoss<float, CUDAContext>); REGISTER_CUDA_OPERATOR( AveragedLossGradient, AveragedLossGradient<float, CUDAContext>); } // namespace caffe2 ###
// !!! This is a file automatically generated by hipify!!! #include "caffe2/core/hip/context_gpu.h" #include "caffe2/operators/loss_op.h" namespace caffe2 { REGISTER_HIP_OPERATOR(AveragedLoss, AveragedLoss<float, HIPContext>); REGISTER_HIP_OPERATOR( AveragedLossGradient, AveragedLossGradient<float, HIPContext...
#include "caffe2/core/context_gpu.h" #include "caffe2/operators/lpnorm_op.h" #include "caffe2/operators/operator_fallback_gpu.h" namespace caffe2 { REGISTER_CUDA_OPERATOR(LpNorm, GPUFallbackOp); REGISTER_CUDA_OPERATOR(LpNormGradient, GPUFallbackOp); } // namespace caffe2 ###
// !!! This is a file automatically generated by hipify!!! #include "caffe2/core/hip/context_gpu.h" #include "caffe2/operators/lpnorm_op.h" #include "caffe2/operators/hip/operator_fallback_gpu.h" namespace caffe2 { REGISTER_HIP_OPERATOR(LpNorm, GPUFallbackOp); REGISTER_HIP_OPERATOR(LpNormGradient, GPUFallbackOp); }...
#include "caffe2/operators/matmul_op.h" #include "caffe2/core/context_gpu.h" namespace caffe2 { REGISTER_CUDA_OPERATOR(MatMul, MatMulOp<float, CUDAContext>); } ###
// !!! This is a file automatically generated by hipify!!! #include "caffe2/operators/matmul_op.h" #include "caffe2/core/hip/context_gpu.h" namespace caffe2 { REGISTER_HIP_OPERATOR(MatMul, MatMulOp<float, HIPContext>); } ###
#pragma once #include <cfloat> #include "caffe2/core/context.h" #include "caffe2/core/context_gpu.h" #include "caffe2/core/logging.h" #include "caffe2/core/operator.h" #include "caffe2/operators/conv_pool_op_base.h" #include "caffe2/operators/pool_op.h" #include "caffe2/utils/math.h" namespace caffe2 { class MaxPoo...
// !!! This is a file automatically generated by hipify!!! #pragma once #include <cfloat> #include "caffe2/core/context.h" #include "caffe2/core/hip/context_gpu.h" #include "caffe2/core/logging.h" #include "caffe2/core/operator.h" #include "caffe2/operators/conv_pool_op_base.h" #include "caffe2/operators/pool_op.h" #...
#define TORCH_ASSERT_NO_OPERATORS #define _USE_MATH_DEFINES #include <ATen/native/Activation.h> #include <cmath> #include <thrust/tuple.h> #include <ATen/AccumulateType.h> #include <ATen/Dispatch.h> #include <ATen/core/TensorBase.h> #include <c10/core/Scalar.h> #include <c10/cuda/CUDAMathCompat.h> #include <ATen/c...
// !!! This is a file automatically generated by hipify!!! #define TORCH_ASSERT_NO_OPERATORS #define _USE_MATH_DEFINES #include <ATen/native/Activation.h> #include <cmath> #include <thrust/tuple.h> #include <ATen/AccumulateType.h> #include <ATen/Dispatch.h> #include <ATen/core/TensorBase.h> #include <c10/core/Scal...
#include "caffe2/core/context_gpu.h" #include "caffe2/operators/mean_op.h" namespace caffe2 { REGISTER_CUDA_OPERATOR(Mean, MeanOp<CUDAContext>); REGISTER_CUDA_OPERATOR(MeanGradient, MeanGradientOp<CUDAContext>); } // namespace caffe2 ###
// !!! This is a file automatically generated by hipify!!! #include "caffe2/core/hip/context_gpu.h" #include "caffe2/operators/mean_op.h" namespace caffe2 { REGISTER_HIP_OPERATOR(Mean, MeanOp<HIPContext>); REGISTER_HIP_OPERATOR(MeanGradient, MeanGradientOp<HIPContext>); } // namespace caffe2 ###
#include "caffe2/core/context_gpu.h" #include "caffe2/core/operator.h" namespace caffe2 { namespace { class GetGPUMemoryUsageOp final : public Operator<CUDAContext> { public: template<class... Args> explicit GetGPUMemoryUsageOp(Args&&... args) : Operator<CUDAContext>(std::forward<Args>(args)...) {} ~GetGP...
// !!! This is a file automatically generated by hipify!!! #include "caffe2/core/hip/context_gpu.h" #include "caffe2/core/operator.h" namespace caffe2 { namespace { class GetGPUMemoryUsageOp final : public Operator<HIPContext> { public: template<class... Args> explicit GetGPUMemoryUsageOp(Args&&... args) : ...
#include "caffe2/operators/minmax_ops.h" #include "caffe2/core/context_gpu.h" #include "caffe2/utils/math.h" namespace caffe2 { namespace { template <typename T> __global__ void SelectGradientCUDAKernel( const int N, const T* dY, const T* X, const T* Y, T* dX) { const int i = blockIdx.x * CAF...
// !!! This is a file automatically generated by hipify!!! #include "hip/hip_runtime.h" #include "caffe2/operators/minmax_ops.h" #include "caffe2/core/hip/context_gpu.h" #include "caffe2/utils/math.h" namespace caffe2 { namespace { template <typename T> __global__ void SelectGradientHIPKernel( const int N, ...
#include "caffe2/operators/mod_op.h" #include "caffe2/core/context_gpu.h" namespace caffe2 { namespace { template <typename T> __global__ void ModOpSimpleKernel(const int N, const int64_t divisor_, const T* data_ptr, T* output_ptr) { CUDA_1D_KERNEL_LOOP(i, N) { output_ptr[i] = dat...
// !!! This is a file automatically generated by hipify!!! #include "hip/hip_runtime.h" #include "caffe2/operators/mod_op.h" #include "caffe2/core/hip/context_gpu.h" namespace caffe2 { namespace { template <typename T> __global__ void ModOpSimpleKernel(const int N, const int64_t divisor_, ...
#include "caffe2/core/context_gpu.h" #include "caffe2/operators/multi_class_accuracy_op.h" #include "caffe2/utils/GpuAtomics.cuh" #include "caffe2/utils/math.h" namespace caffe2 { namespace { __global__ void MultiClassAccuracyKernel(const int N, const int D, const float* Xdata, const int* labeldata, float* accur...
// !!! This is a file automatically generated by hipify!!! #include "hip/hip_runtime.h" #include "caffe2/core/hip/context_gpu.h" #include "caffe2/operators/multi_class_accuracy_op.h" #include "caffe2/utils/hip/GpuAtomics.cuh" #include "caffe2/utils/math.h" namespace caffe2 { namespace { __global__ void MultiClassAcc...
#include "caffe2/core/context_gpu.h" #include "caffe2/operators/negate_gradient_op.h" namespace caffe2 { REGISTER_CUDA_OPERATOR(NegateGradient, NegateGradientOp<CUDAContext>) } // namespace caffe2 ###
// !!! This is a file automatically generated by hipify!!! #include "caffe2/core/hip/context_gpu.h" #include "caffe2/operators/negate_gradient_op.h" namespace caffe2 { REGISTER_HIP_OPERATOR(NegateGradient, NegateGradientOp<HIPContext>) } // namespace caffe2 ###
#include "caffe2/operators/negative_op.h" #include "caffe2/core/context_gpu.h" namespace caffe2 { REGISTER_CUDA_OPERATOR( Negative, UnaryElementwiseOp< NumericTypes, CUDAContext, NegativeFunctor<CUDAContext>>); } // namespace caffe2 ###
// !!! This is a file automatically generated by hipify!!! #include "caffe2/operators/negative_op.h" #include "caffe2/core/hip/context_gpu.h" namespace caffe2 { REGISTER_HIP_OPERATOR( Negative, UnaryElementwiseOp< NumericTypes, HIPContext, NegativeFunctor<HIPContext>>); } // namespa...
#include <cub/block/block_reduce.cuh> #include "caffe2/core/context_gpu.h" #include "caffe2/operators/one_hot_ops.h" #include "caffe2/utils/cub_namespace.cuh" namespace caffe2 { __global__ void OneHotOpKernel( const int64_t batch_size, const int64_t index_size, const int64_t* indices, float* output)...
// !!! This is a file automatically generated by hipify!!! #include "hip/hip_runtime.h" #include <hipcub/hipcub.hpp> #include "caffe2/core/hip/context_gpu.h" #include "caffe2/operators/one_hot_ops.h" #include "caffe2/utils/cub_namespace.cuh" namespace caffe2 { __global__ void OneHotOpKernel( const int64_t batch...
#ifndef CAFFE2_OPERATORS_OPERATOR_FALLBACK_H_ #define CAFFE2_OPERATORS_OPERATOR_FALLBACK_H_ #include "caffe2/core/common.h" #include "caffe2/core/context.h" #include "caffe2/core/context_gpu.h" #include "caffe2/core/operator.h" #include "caffe2/proto/caffe2_pb.h" namespace caffe2 { template <typename SkipOutputCopy> ...
#ifndef CAFFE2_OPERATORS_OPERATOR_FALLBACK_H_ #define CAFFE2_OPERATORS_OPERATOR_FALLBACK_H_ #include "caffe2/core/common.h" #include "caffe2/core/context.h" #include "caffe2/core/hip/context_gpu.h" #include "caffe2/core/operator.h" #include "caffe2/proto/caffe2_pb.h" namespace caffe2 { template <typename SkipOutputC...
#include <iostream> #include "caffe2/core/operator.h" #include "caffe2/operators/operator_fallback_gpu.h" #include <gtest/gtest.h> namespace caffe2 { class IncrementByOneOp final : public Operator<CPUContext> { public: template <class... Args> explicit IncrementByOneOp(Args&&... args) : Operator<CPUContext>(std:...
#include <iostream> #include "caffe2/core/operator.h" #include "caffe2/operators/hip/operator_fallback_gpu.h" #include <gtest/gtest.h> namespace caffe2 { class IncrementByOneOp final : public Operator<CPUContext> { public: template <class... Args> explicit IncrementByOneOp(Args&&... args) : Operator<CPUContext>...
#define TORCH_ASSERT_NO_OPERATORS #define _USE_MATH_DEFINES #include <ATen/native/Activation.h> #include <cmath> #include <thrust/tuple.h> #include <ATen/AccumulateType.h> #include <ATen/Dispatch.h> #include <ATen/core/TensorBase.h> #include <c10/core/Scalar.h> #include <c10/cuda/CUDAMathCompat.h> #include <ATen/c...
// !!! This is a file automatically generated by hipify!!! #define TORCH_ASSERT_NO_OPERATORS #define _USE_MATH_DEFINES #include <ATen/native/Activation.h> #include <cmath> #include <thrust/tuple.h> #include <ATen/AccumulateType.h> #include <ATen/Dispatch.h> #include <ATen/core/TensorBase.h> #include <c10/core/Scal...
#include "caffe2/operators/order_switch_ops.h" #include "caffe2/core/context_gpu.h" namespace caffe2 { REGISTER_CUDA_OPERATOR(NHWC2NCHW, NHWC2NCHWOp<float, CUDAContext>); REGISTER_CUDA_OPERATOR(NCHW2NHWC, NCHW2NHWCOp<float, CUDAContext>); } // namespace caffe2 ###
// !!! This is a file automatically generated by hipify!!! #include "caffe2/operators/order_switch_ops.h" #include "caffe2/core/hip/context_gpu.h" namespace caffe2 { REGISTER_HIP_OPERATOR(NHWC2NCHW, NHWC2NCHWOp<float, HIPContext>); REGISTER_HIP_OPERATOR(NCHW2NHWC, NCHW2NHWCOp<float, HIPContext>); } // namespace ca...
#include "caffe2/core/context_gpu.h" #include "caffe2/operators/perplexity_op.h" #include "caffe2/utils/math.h" #include <thrust/device_vector.h> #include <thrust/transform_reduce.h> #include <thrust/system/cuda/execution_policy.h> namespace caffe2 { struct perplexity_function { perplexity_function(float p) : pow(...
// !!! This is a file automatically generated by hipify!!! #include "caffe2/core/hip/context_gpu.h" #include "caffe2/operators/perplexity_op.h" #include "caffe2/utils/math.h" #include <thrust/device_vector.h> #include <thrust/transform_reduce.h> #include <thrust/system/hip/execution_policy.h> namespace caffe2 { stru...
#include "caffe2/core/context_gpu.h" #include "caffe2/operators/prepend_dim_op.h" namespace caffe2 { REGISTER_CUDA_OPERATOR(PrependDim, PrependDimOp<CUDAContext>); REGISTER_CUDA_OPERATOR(MergeDim, MergeDimOp<CUDAContext>); } // namespace caffe2 ###
// !!! This is a file automatically generated by hipify!!! #include "caffe2/core/hip/context_gpu.h" #include "caffe2/operators/prepend_dim_op.h" namespace caffe2 { REGISTER_HIP_OPERATOR(PrependDim, PrependDimOp<HIPContext>); REGISTER_HIP_OPERATOR(MergeDim, MergeDimOp<HIPContext>); } // namespace caffe2 ###
#include "caffe2/operators/reciprocal_op.h" #include <algorithm> #include <functional> #include "caffe2/core/context_gpu.h" namespace caffe2 { namespace { template <typename T> __global__ void ReciprocalGradientCUDAKernel(const int N, const T* dY, const T* Y, T* dX) { CUDA_1D_KERNEL_LOOP(i, N) { #if __CUDA_ARCH...
// !!! This is a file automatically generated by hipify!!! #include "hip/hip_runtime.h" #include "caffe2/operators/reciprocal_op.h" #include <algorithm> #include <functional> #include "caffe2/core/hip/context_gpu.h" namespace caffe2 { namespace { template <typename T> __global__ void ReciprocalGradientHIPKernel(c...
#include "caffe2/operators/relu_n_op.h" #include <algorithm> #include <functional> #include "caffe2/core/context_gpu.h" namespace caffe2 { namespace { template <typename T> __global__ void ReluNCUDAKernel(const int N, const T threshold, const T* X, T* Y) { CUDA_1D_KERNEL_LOOP(i, N) { #if __CUDA_ARCH__ >= 350 ...
// !!! This is a file automatically generated by hipify!!! #include "hip/hip_runtime.h" #include "caffe2/operators/relu_n_op.h" #include <algorithm> #include <functional> #include "caffe2/core/hip/context_gpu.h" namespace caffe2 { namespace { template <typename T> __global__ void ReluNHIPKernel(const int N, const...
#include "caffe2/core/context_gpu.h" #include "caffe2/operators/replace_nan_op.h" namespace caffe2 { namespace { template <typename T> __global__ void replace_nan_kernel(const T value, const int64_t size, const T* X, T* Y) { CUDA_1D_KERNEL_LOOP(i, size) { if (isnan(X[i])) { Y[i] = value; } else { ...
// !!! This is a file automatically generated by hipify!!! #include "hip/hip_runtime.h" #include "caffe2/core/hip/context_gpu.h" #include "caffe2/operators/replace_nan_op.h" namespace caffe2 { namespace { template <typename T> __global__ void replace_nan_kernel(const T value, const int64_t size, const T* X, T* Y) { ...
#include "caffe2/core/context_gpu.h" #include "caffe2/operators/reshape_op.h" #include "caffe2/utils/math.h" namespace caffe2 { REGISTER_CUDA_OPERATOR(Reshape, ReshapeOp<float, CUDAContext>); } // namespace caffe2 ###
// !!! This is a file automatically generated by hipify!!! #include "caffe2/core/hip/context_gpu.h" #include "caffe2/operators/reshape_op.h" #include "caffe2/utils/math.h" namespace caffe2 { REGISTER_HIP_OPERATOR(Reshape, ReshapeOp<float, HIPContext>); } // namespace caffe2 ###
#include <iostream> #include <gtest/gtest.h> #include "caffe2/core/context.h" #include "caffe2/core/context_gpu.h" #include "caffe2/core/flags.h" #include "caffe2/operators/reshape_op.h" #include "caffe2/utils/math.h" C10_DECLARE_string(caffe_test_root); namespace caffe2 { static void AddConstInput( const vect...
// !!! This is a file automatically generated by hipify!!! #include <iostream> #include <gtest/gtest.h> #include "caffe2/core/context.h" #include "caffe2/core/hip/context_gpu.h" #include "caffe2/core/flags.h" #include "caffe2/operators/reshape_op.h" #include "caffe2/utils/math.h" C10_DECLARE_string(caffe_test_root);...
#include "caffe2/core/context_gpu.h" #include "caffe2/operators/reverse_packed_segs_op.h" namespace caffe2 { namespace { template <typename T, typename LengthType> __global__ void ReversePackedSegments_kernel( size_t max_length, size_t batch_size, size_t block_size, const LengthType* lengths...
// !!! This is a file automatically generated by hipify!!! #include "hip/hip_runtime.h" #include "caffe2/core/hip/context_gpu.h" #include "caffe2/operators/reverse_packed_segs_op.h" namespace caffe2 { namespace { template <typename T, typename LengthType> __global__ void ReversePackedSegments_kernel( size_t m...
#include "caffe2/operators/rsqrt_op.h" #include <algorithm> #include <functional> #include "caffe2/core/context_gpu.h" #include "caffe2/utils/math.h" namespace caffe2 { namespace { template <typename T> __global__ void RsqrtGradientCUDAKernel(const int size, const T* dY, const T* Y, T* dX) { CUDA_1D_KERNEL_LOOP...
// !!! This is a file automatically generated by hipify!!! #include "hip/hip_runtime.h" #include "caffe2/operators/rsqrt_op.h" #include <algorithm> #include <functional> #include "caffe2/core/hip/context_gpu.h" #include "caffe2/utils/math.h" namespace caffe2 { namespace { template <typename T> __global__ void Rsq...
#define TORCH_ASSERT_NO_OPERATORS #define _USE_MATH_DEFINES #include <ATen/native/Activation.h> #include <cmath> #include <thrust/tuple.h> #include <ATen/AccumulateType.h> #include <ATen/Dispatch.h> #include <ATen/core/TensorBase.h> #include <c10/core/Scalar.h> #include <c10/cuda/CUDAMathCompat.h> #include <ATen/c...
// !!! This is a file automatically generated by hipify!!! #define TORCH_ASSERT_NO_OPERATORS #define _USE_MATH_DEFINES #include <ATen/native/Activation.h> #include <cmath> #include <thrust/tuple.h> #include <ATen/AccumulateType.h> #include <ATen/Dispatch.h> #include <ATen/core/TensorBase.h> #include <c10/core/Scal...
#include "caffe2/core/context_gpu.h" #include "caffe2/operators/scale_op.h" namespace caffe2 { template <> bool ScaleOp<CUDAContext>::RunOnDevice() { return DispatchHelper<TensorTypes<at::Half, float>>::call(this, Input(0)); } REGISTER_CUDA_OPERATOR(Scale, ScaleOp<CUDAContext>); } // namespace caffe2 ###
// !!! This is a file automatically generated by hipify!!! #include "caffe2/core/hip/context_gpu.h" #include "caffe2/operators/scale_op.h" namespace caffe2 { template <> bool ScaleOp<HIPContext>::RunOnDevice() { return DispatchHelper<TensorTypes<at::Half, float>>::call(this, Input(0)); } REGISTER_HIP_OPERATOR(Sca...
#include "caffe2/core/common_gpu.h" #include "caffe2/core/context_gpu.h" #include "caffe2/operators/selu_op.h" namespace caffe2 { namespace { template <typename T> __global__ void SeluKernel(const int N, const T* X, T* Y, T alpha_, T lambda_) { CUDA_1D_KERNEL_LOOP(i, N) { Y[i] = lambda_ * (X[i] > 0 ? X[i] : alp...
// !!! This is a file automatically generated by hipify!!! #include "hip/hip_runtime.h" #include "caffe2/core/hip/common_gpu.h" #include "caffe2/core/hip/context_gpu.h" #include "caffe2/operators/selu_op.h" namespace caffe2 { namespace { template <typename T> __global__ void SeluKernel(const int N, const T* X, T* Y, ...
#include "caffe2/core/context_gpu.h" #include "caffe2/operators/shape_op.h" namespace caffe2 { REGISTER_CUDA_OPERATOR(Shape, ShapeOp<CUDAContext>); } ###
// !!! This is a file automatically generated by hipify!!! #include "caffe2/core/hip/context_gpu.h" #include "caffe2/operators/shape_op.h" namespace caffe2 { REGISTER_HIP_OPERATOR(Shape, ShapeOp<HIPContext>); } ###
#include "caffe2/operators/sigmoid_op.h" #include <algorithm> #include <functional> #include "caffe2/core/context_gpu.h" namespace caffe2 { namespace { template <typename T> __global__ void SigmoidCUDAKernel(const int N, const T* X, T* Y); template <> __global__ void SigmoidCUDAKernel<float>(const int N, const f...
// !!! This is a file automatically generated by hipify!!! #include "hip/hip_runtime.h" #include "caffe2/operators/sigmoid_op.h" #include <algorithm> #include <functional> #include "caffe2/core/hip/context_gpu.h" namespace caffe2 { namespace { template <typename T> __global__ void SigmoidHIPKernel(const int N, co...
#include "caffe2/operators/sinh_op.h" #include <algorithm> #include <functional> #include "caffe2/core/context_gpu.h" namespace caffe2 { namespace { __global__ void SinhGradientCUDAKernel( const int N, const float* dY, const float* X, float* dX) { CUDA_1D_KERNEL_LOOP(i, N) { #if __CUDA_ARCH__ >=...
// !!! This is a file automatically generated by hipify!!! #include "hip/hip_runtime.h" #include "caffe2/operators/sinh_op.h" #include <algorithm> #include <functional> #include "caffe2/core/hip/context_gpu.h" namespace caffe2 { namespace { __global__ void SinhGradientHIPKernel( const int N, const float* ...
#include "caffe2/operators/sin_op.h" #include <algorithm> #include <functional> #include "caffe2/core/context_gpu.h" namespace caffe2 { namespace { template <typename T> __global__ void SinGradientCUDAKernel(const int N, const T* dY, const T* X, T* dX) { CUDA_1D_KERNEL_LOOP(i, N) { #if __CUDA_ARCH__ >= 350 ...
// !!! This is a file automatically generated by hipify!!! #include "hip/hip_runtime.h" #include "caffe2/operators/sin_op.h" #include <algorithm> #include <functional> #include "caffe2/core/hip/context_gpu.h" namespace caffe2 { namespace { template <typename T> __global__ void SinGradientHIPKernel(const int N, co...
#include "caffe2/core/context_gpu.h" #include "caffe2/operators/softplus_op.h" namespace caffe2 { namespace { template <typename T> __global__ void SoftplusKernel(const int N, const T* X, T* Y) { CUDA_1D_KERNEL_LOOP(i, N) { Y[i] = log(exp(X[i]) + 1.0f); } } template <typename T> __global__ void SoftplusGradi...
// !!! This is a file automatically generated by hipify!!! #include "hip/hip_runtime.h" #include "caffe2/core/hip/context_gpu.h" #include "caffe2/operators/softplus_op.h" namespace caffe2 { namespace { template <typename T> __global__ void SoftplusKernel(const int N, const T* X, T* Y) { HIP_1D_KERNEL_LOOP(i, N) { ...
#include "caffe2/operators/softsign_op.h" #include <algorithm> #include <functional> #include "caffe2/core/context_gpu.h" namespace caffe2 { namespace { using c10::cuda::compat::abs; template <typename T> inline __host__ __device__ T SquareCUDA(const T x) { return x * x; } template <typename T> __global__ voi...
// !!! This is a file automatically generated by hipify!!! #include "hip/hip_runtime.h" #include "caffe2/operators/softsign_op.h" #include <algorithm> #include <functional> #include "caffe2/core/hip/context_gpu.h" namespace caffe2 { namespace { using c10::hip::compat::abs; template <typename T> inline __host__ _...
#include "caffe2/core/context_gpu.h" #include "caffe2/operators/operator_fallback_gpu.h" #include "caffe2/operators/sparse_lp_regularizer_op.h" namespace caffe2 { REGISTER_CUDA_OPERATOR(SparseLpRegularizer, GPUFallbackOp); } ###
// !!! This is a file automatically generated by hipify!!! #include "caffe2/core/hip/context_gpu.h" #include "caffe2/operators/hip/operator_fallback_gpu.h" #include "caffe2/operators/sparse_lp_regularizer_op.h" namespace caffe2 { REGISTER_HIP_OPERATOR(SparseLpRegularizer, GPUFallbackOp); } ###
#include "caffe2/core/context_gpu.h" #include "caffe2/operators/operator_fallback_gpu.h" #include "caffe2/operators/sparse_normalize_op.h" namespace caffe2 { REGISTER_CUDA_OPERATOR( SparseNormalize, GPUFallbackOp); } ###
// !!! This is a file automatically generated by hipify!!! #include "caffe2/core/hip/context_gpu.h" #include "caffe2/operators/hip/operator_fallback_gpu.h" #include "caffe2/operators/sparse_normalize_op.h" namespace caffe2 { REGISTER_HIP_OPERATOR( SparseNormalize, GPUFallbackOp); } ###
#define TORCH_ASSERT_NO_OPERATORS #define _USE_MATH_DEFINES #include <ATen/native/Activation.h> #include <cmath> #include <thrust/tuple.h> #include <ATen/AccumulateType.h> #include <ATen/Dispatch.h> #include <ATen/core/TensorBase.h> #include <c10/core/Scalar.h> #include <c10/cuda/CUDAMathCompat.h> #include <ATen/c...
// !!! This is a file automatically generated by hipify!!! #define TORCH_ASSERT_NO_OPERATORS #define _USE_MATH_DEFINES #include <ATen/native/Activation.h> #include <cmath> #include <thrust/tuple.h> #include <ATen/AccumulateType.h> #include <ATen/Dispatch.h> #include <ATen/core/TensorBase.h> #include <c10/core/Scal...
#include "caffe2/operators/sparse_to_dense_op.h" #include "caffe2/core/common_gpu.h" #include "caffe2/core/context_gpu.h" #include "caffe2/utils/GpuAtomics.cuh" namespace caffe2 { template <typename TInd, typename TData> __global__ void SparseToDenseKernel( size_t N, int64_t block_nitems, const TInd* indice...
// !!! This is a file automatically generated by hipify!!! #include "hip/hip_runtime.h" #include "caffe2/operators/sparse_to_dense_op.h" #include "caffe2/core/hip/common_gpu.h" #include "caffe2/core/hip/context_gpu.h" #include "caffe2/utils/hip/GpuAtomics.cuh" namespace caffe2 { template <typename TInd, typename ...
#include "caffe2/operators/spatial_batch_norm_op.h" #include "caffe2/operators/spatial_batch_norm_op_impl.cuh" namespace caffe2 { REGISTER_CUDA_OPERATOR(SpatialBN, SpatialBNOp<CUDAContext>); REGISTER_CUDA_OPERATOR(SpatialBNGradient, SpatialBNGradientOp<CUDAContext>); } // namespace caffe2 ###
// !!! This is a file automatically generated by hipify!!! #include "caffe2/operators/spatial_batch_norm_op.h" #include "caffe2/operators/hip/spatial_batch_norm_op_impl.cuh" namespace caffe2 { REGISTER_HIP_OPERATOR(SpatialBN, SpatialBNOp<HIPContext>); REGISTER_HIP_OPERATOR(SpatialBNGradient, SpatialBNGradientOp<HIP...
#include "caffe2/operators/sqrt_op.h" #include "caffe2/core/context_gpu.h" namespace caffe2 { REGISTER_CUDA_OPERATOR( Sqrt, UnaryElementwiseOp< TensorTypes<float>, CUDAContext, SqrtFunctor<CUDAContext>>); } // namespace caffe2 ###
// !!! This is a file automatically generated by hipify!!! #include "caffe2/operators/sqrt_op.h" #include "caffe2/core/hip/context_gpu.h" namespace caffe2 { REGISTER_HIP_OPERATOR( Sqrt, UnaryElementwiseOp< TensorTypes<float>, HIPContext, SqrtFunctor<HIPContext>>); } // namespace caf...
#include "caffe2/operators/sqr_op.h" #include "caffe2/core/context_gpu.h" namespace caffe2 { REGISTER_CUDA_OPERATOR( Sqr, UnaryElementwiseOp< TensorTypes<float>, CUDAContext, SqrFunctor<CUDAContext>>); } // namespace caffe2 ###
// !!! This is a file automatically generated by hipify!!! #include "caffe2/operators/sqr_op.h" #include "caffe2/core/hip/context_gpu.h" namespace caffe2 { REGISTER_HIP_OPERATOR( Sqr, UnaryElementwiseOp< TensorTypes<float>, HIPContext, SqrFunctor<HIPContext>>); } // namespace caffe2...
#include "caffe2/core/context_gpu.h" #include "caffe2/operators/stop_gradient.h" namespace caffe2 { REGISTER_CUDA_OPERATOR(StopGradient, StopGradientOp<CUDAContext>); } // namespace caffe2 ###
// !!! This is a file automatically generated by hipify!!! #include "caffe2/core/hip/context_gpu.h" #include "caffe2/operators/stop_gradient.h" namespace caffe2 { REGISTER_HIP_OPERATOR(StopGradient, StopGradientOp<HIPContext>); } // namespace caffe2 ###
/** * Copyright (c) 2016-present, Facebook, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable...
// !!! This is a file automatically generated by hipify!!! #include "hip/hip_runtime.h" /** * Copyright (c) 2016-present, Facebook, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at ...
#include <cuda.h> #include <thrust/device_vector.h> #include <thrust/transform_reduce.h> #include <thrust/system/cuda/execution_policy.h> #include "caffe2/operators/summarize_op.h" #include "caffe2/core/context_gpu.h" namespace caffe2 { namespace { template <typename T> struct SummaryStatsData { T n; T min; T max...
#include <hip/hip_runtime.h> #include <thrust/device_vector.h> #include <thrust/transform_reduce.h> #include <thrust/system/hip/execution_policy.h> #include "caffe2/operators/summarize_op.h" #include "caffe2/core/hip/context_gpu.h" namespace caffe2 { namespace { template <typename T> struct SummaryStatsData { T n;...
#include "caffe2/operators/swish_op.h" #include "caffe2/core/context_gpu.h" namespace caffe2 { namespace { template <typename T> __global__ void SwishCUDAKernel(const int N, const T* X, T* Y) { CUDA_1D_KERNEL_LOOP(i, N) { #if __CUDA_ARCH__ >= 350 Y[i] = __ldg(X + i) / (T(1) + exp(-__ldg(X + i))); #else Y...
#include "hip/hip_runtime.h" #include "caffe2/operators/swish_op.h" #include "caffe2/core/hip/context_gpu.h" namespace caffe2 { namespace { template <typename T> __global__ void SwishHIPKernel(const int N, const T* X, T* Y) { HIP_1D_KERNEL_LOOP(i, N) { #if __HIP_ARCH__ >= 350 Y[i] = __ldg(X + i) / (T(1) + exp(-__l...
#include "caffe2/operators/tanh_op.h" #include <algorithm> #include <functional> #include "caffe2/core/context_gpu.h" namespace caffe2 { namespace { template <typename T> __global__ void TanhGradientCUDAKernel(const int N, const T* dY, const T* Y, T* dX) { CUDA_1D_KERNEL_LOOP(i, N) { #if __CUDA_ARCH__ >= 350 ...
// !!! This is a file automatically generated by hipify!!! #include "hip/hip_runtime.h" #include "caffe2/operators/tanh_op.h" #include <algorithm> #include <functional> #include "caffe2/core/hip/context_gpu.h" namespace caffe2 { namespace { template <typename T> __global__ void TanhGradientHIPKernel(const int N, ...
#include "caffe2/operators/tan_op.h" #include <algorithm> #include <functional> #include "caffe2/core/context_gpu.h" namespace caffe2 { template <typename T> inline __host__ __device__ T Square(const T& x) { return x * x; } template <typename T> __global__ void TanGradientCUDAKernel(const int N, const T* dY, co...
// !!! This is a file automatically generated by hipify!!! #include "hip/hip_runtime.h" #include "caffe2/operators/tan_op.h" #include <algorithm> #include <functional> #include "caffe2/core/hip/context_gpu.h" namespace caffe2 { template <typename T> inline __host__ __device__ T Square(const T& x) { return x * x;...
#define TORCH_ASSERT_NO_OPERATORS #define _USE_MATH_DEFINES #include <ATen/native/Activation.h> #include <cmath> #include <thrust/tuple.h> #include <ATen/AccumulateType.h> #include <ATen/Dispatch.h> #include <ATen/core/TensorBase.h> #include <c10/core/Scalar.h> #include <c10/cuda/CUDAMathCompat.h> #include <ATen/c...
// !!! This is a file automatically generated by hipify!!! #define TORCH_ASSERT_NO_OPERATORS #define _USE_MATH_DEFINES #include <ATen/native/Activation.h> #include <cmath> #include <thrust/tuple.h> #include <ATen/AccumulateType.h> #include <ATen/Dispatch.h> #include <ATen/core/TensorBase.h> #include <c10/core/Scal...