#include #include #include "cpu/fps_cpu.h" #ifdef WITH_HIP #include "hip/fps_hip.h" #endif #ifdef _WIN32 #ifdef WITH_HIP PyMODINIT_FUNC PyInit__fps_cuda(void) { return NULL; } #else PyMODINIT_FUNC PyInit__fps_cpu(void) { return NULL; } #endif #endif torch::Tensor fps(torch::Tensor src, torch::Tensor ptr, torch::Tensor ratio, bool random_start) { if (src.device().is_cuda()) { #ifdef WITH_HIP return fps_cuda(src, ptr, ratio, random_start); #else AT_ERROR("Not compiled with CUDA support"); #endif } else { return fps_cpu(src, ptr, ratio, random_start); } } static auto registry = torch::RegisterOperators().op("torch_cluster::fps", &fps);