File size: 631 Bytes
e14d114 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | #include <torch/library.h>
#include "registration.h"
#include "torch_binding.h"
TORCH_LIBRARY_EXPAND(TORCH_EXTENSION_NAME, ops) {
ops.def("selective_update(Tensor! out, Tensor input) -> ()");
#if defined(CPU_KERNEL)
ops.impl("selective_update", torch::kCPU, &selective_update);
#elif defined(CUDA_KERNEL) || defined(ROCM_KERNEL)
ops.impl("selective_update", torch::kCUDA, &selective_update);
#elif defined(METAL_KERNEL)
ops.impl("selective_update", torch::kMPS, selective_update);
#elif defined(XPU_KERNEL)
ops.impl("selective_update", torch::kXPU, &selective_update);
#endif
}
REGISTER_EXTENSION(TORCH_EXTENSION_NAME) |