Sha256: be9d16bd7f87853afb047f4857cf9a02e9f1509eb048b3b47b706b653a555e45

Contents?: true

Size: 518 Bytes

Versions: 9

Compression:

Stored size: 518 Bytes

Contents

#include <torch/torch.h>

#include <rice/rice.hpp>

#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")
    .define_singleton_function("available?", &torch::hasOpenMP);

  Rice::define_module_under(rb_mBackends, "MKL")
    .define_singleton_function("available?", &torch::hasMKL);

  Rice::define_module_under(rb_mBackends, "MPS")
    .define_singleton_function("available?", &torch::hasMPS);
}

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
torch-rb-0.18.0 ext/torch/backends.cpp
torch-rb-0.17.1 ext/torch/backends.cpp
torch-rb-0.17.0 ext/torch/backends.cpp
torch-rb-0.16.0 ext/torch/backends.cpp
torch-rb-0.15.0 ext/torch/backends.cpp
torch-rb-0.14.1 ext/torch/backends.cpp
torch-rb-0.14.0 ext/torch/backends.cpp
torch-rb-0.13.2 ext/torch/backends.cpp
torch-rb-0.13.1 ext/torch/backends.cpp