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.
122 123 124 125 126 |
# File 'ext/cumo/cumo.c', line 122 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.
109 110 111 112 113 114 115 |
# File 'ext/cumo/cumo.c', line 109 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.
96 97 98 99 100 101 102 |
# File 'ext/cumo/cumo.c', line 96 static VALUE rb_enable_compatible_mode(VALUE self) { VALUE ret = (cumo_compatible_mode_enabled ? Qtrue : Qfalse); cumo_compatible_mode_enabled = true; return ret; } |