#include #include #include "utils.h" void init_backends(Rice::Module& m) { auto rb_mBackends = Rice::define_module_under(m, "Backends"); Rice::define_module_under(rb_mBackends, "OpenMP") .add_handler(handle_error) .define_singleton_function("available?", &torch::hasOpenMP); Rice::define_module_under(rb_mBackends, "MKL") .add_handler(handle_error) .define_singleton_function("available?", &torch::hasMKL); Rice::define_module_under(rb_mBackends, "MPS") .add_handler(handle_error) .define_singleton_function("available?", &torch::hasMPS); }