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