Module: Cumo
- Defined in:
- lib/cumo/linalg.rb,
lib/cumo/cuda.rb,
lib/cumo/narray/extra.rb,
ext/cumo/cumo.c,
ext/cumo/cuda/nvrtc.c,
ext/cumo/cuda/cublas.c,
ext/cumo/cuda/driver.c,
ext/cumo/cuda/runtime.c,
ext/cumo/narray/narray.c,
ext/cumo/cuda/memory_pool.cpp
Overview
Provide compatibility layers with numo/linalg
Defined Under Namespace
Modules: Blas, CUDA, NMath Classes: NArray, Struct
Constant Summary collapse
- VERSION =
rb_str_new2(CUMO_VERSION)
Class Method Summary collapse
-
.compatible_mode_enabled? ⇒ Boolean
Returns whether Numo NArray compatible mode is enabled or not.
-
.disable_compatible_mode ⇒ Boolean
Disable Numo NArray compatible mode.
-
.enable_compatible_mode ⇒ Boolean
Enable Numo NArray compatible mode.
Class Method Details
.compatible_mode_enabled? ⇒ Boolean
Returns whether Numo NArray compatible mode is enabled or not.
102 103 104 105 106 |
# File 'ext/cumo/cumo.c', line 102
static VALUE
rb_compatible_mode_enabled_p(VALUE self)
{
return (cumo_compatible_mode_enabled ? Qtrue : Qfalse);
}
|
.disable_compatible_mode ⇒ Boolean
Disable Numo NArray compatible mode.
89 90 91 92 93 94 95 |
# File 'ext/cumo/cumo.c', line 89
static VALUE
rb_disable_compatible_mode(VALUE self)
{
VALUE ret = (cumo_compatible_mode_enabled ? Qtrue : Qfalse);
cumo_compatible_mode_enabled = false;
return ret;
}
|
.enable_compatible_mode ⇒ Boolean
Enable Numo NArray compatible mode.
Cumo returns 0-dimensional NArray instead of ruby numeric object for some methods such as ‘extract`, and `[]` not to synchronize between CPU and GPU for performance as default.
Enabling the compatible mode makes Cumo behave as Numo. But, please note that it makes Cumo slow.
76 77 78 79 80 81 82 |
# File 'ext/cumo/cumo.c', line 76
static VALUE
rb_enable_compatible_mode(VALUE self)
{
VALUE ret = (cumo_compatible_mode_enabled ? Qtrue : Qfalse);
cumo_compatible_mode_enabled = true;
return ret;
}
|