Sha256: e1df37fe744a1bcd3bcb6308b5a48d2981a009112464d7a2ca2c2e41847307b4

Contents?: true

Size: 498 Bytes

Versions: 4

Compression:

Stored size: 498 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")
    .add_handler<torch::Error>(handle_error)
    .define_singleton_function("available?", &torch::hasOpenMP);

   Rice::define_module_under(rb_mBackends, "MKL")
    .add_handler<torch::Error>(handle_error)
    .define_singleton_function("available?", &torch::hasMKL);
}

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
torch-rb-0.9.0 ext/torch/backends.cpp
torch-rb-0.8.3 ext/torch/backends.cpp
torch-rb-0.8.2 ext/torch/backends.cpp
torch-rb-0.8.1 ext/torch/backends.cpp