Sha256: c41e3b08d9fe96cf57289b7398e6b1ec9162410d08a75a1094d5ef70c14435b5

Contents?: true

Size: 496 Bytes

Versions: 11

Compression:

Stored size: 496 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

11 entries across 11 versions & 1 rubygems

Version Path
torch-rb-0.12.2 ext/torch/backends.cpp
torch-rb-0.12.1 ext/torch/backends.cpp
torch-rb-0.12.0 ext/torch/backends.cpp
torch-rb-0.11.2 ext/torch/backends.cpp
torch-rb-0.11.1 ext/torch/backends.cpp
torch-rb-0.11.0 ext/torch/backends.cpp
torch-rb-0.10.2 ext/torch/backends.cpp
torch-rb-0.10.1 ext/torch/backends.cpp
torch-rb-0.10.0 ext/torch/backends.cpp
torch-rb-0.9.2 ext/torch/backends.cpp
torch-rb-0.9.1 ext/torch/backends.cpp