Module: Cumo
- Defined in:
- lib/cumo/linalg.rb,
lib/cumo/cuda.rb,
lib/cumo/cuda/cudnn.rb,
lib/cumo/cuda/cudnn.rb,
lib/cumo/narray/extra.rb,
ext/cumo/cumo.c,
ext/cumo/cuda/cudnn.c,
ext/cumo/cuda/nvrtc.c,
ext/cumo/cuda/cublas.c,
ext/cumo/cuda/driver.c,
ext/cumo/cuda/runtime.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)
- Cuda =
alias
mCUDA
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.
104 105 106 107 108 |
# File 'ext/cumo/cumo.c', line 104
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.
91 92 93 94 95 96 97 |
# File 'ext/cumo/cumo.c', line 91
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.
78 79 80 81 82 83 84 |
# File 'ext/cumo/cumo.c', line 78
static VALUE
rb_enable_compatible_mode(VALUE self)
{
VALUE ret = (cumo_compatible_mode_enabled ? Qtrue : Qfalse);
cumo_compatible_mode_enabled = true;
return ret;
}
|