causal-conv1d / torch-ext /torch_binding.cpp
Ashiedu's picture
Initial kernel bundle upload: causal-conv1d
8996239 verified
Raw
History Blame Contribute Delete
604 Bytes
#include <torch/library.h>
#include "registration.h"
#include "torch_binding.h"
TORCH_LIBRARY_EXPAND(TORCH_EXTENSION_NAME, ops) {
ops.def("causal_conv1d(Tensor! out, Tensor input) -> ()");
#if defined(CPU_KERNEL)
ops.impl("causal_conv1d", torch::kCPU, &causal_conv1d);
#elif defined(CUDA_KERNEL) || defined(ROCM_KERNEL)
ops.impl("causal_conv1d", torch::kCUDA, &causal_conv1d);
#elif defined(METAL_KERNEL)
ops.impl("causal_conv1d", torch::kMPS, causal_conv1d);
#elif defined(XPU_KERNEL)
ops.impl("causal_conv1d", torch::kXPU, &causal_conv1d);
#endif
}
REGISTER_EXTENSION(TORCH_EXTENSION_NAME)