#include #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)