Module: Cumo::CUDA::Runtime
- Defined in:
- ext/cumo/cuda/runtime.c
Class Method Summary collapse
-
.cudaDeviceGetAttributes(attrib, device) ⇒ Integer
Returns information about the device.
-
.cudaDeviceSynchronize ⇒ Object
Wait for compute device to finish.
-
.cudaDriverGetVersion ⇒ Integer
Returns the CUDA driver version.
-
.cudaGetDevice ⇒ Integer
Returns which device is currently being used.
-
.cudaGetDeviceCount ⇒ Integer
Returns the number of compute-capable devices.
-
.cudaRuntimeGetVersion ⇒ Integer
Returns the CUDA Runtime version.
-
.cudaSetDevice(device) ⇒ Object
Set device to be used for GPU executions.
Class Method Details
.cudaDeviceGetAttributes(attrib, device) ⇒ Integer
Returns information about the device.
79 80 81 82 83 84 85 86 87 88 89 90 91 |
# File 'ext/cumo/cuda/runtime.c', line 79 static VALUE rb_cudaDeviceGetAttributes(VALUE self, VALUE attrib, VALUE device) { int _attrib = NUM2INT(attrib); int _device = NUM2INT(device); int _ret; cudaError_t status; status = cudaDeviceGetAttribute(&_ret, _attrib, _device); check_status(status); return INT2NUM(_ret); } |
.cudaDeviceSynchronize ⇒ Object
Wait for compute device to finish.
131 132 133 134 135 136 137 138 |
# File 'ext/cumo/cuda/runtime.c', line 131 static VALUE rb_cudaDeviceSynchronize(VALUE self) { cudaError_t status; status = cudaDeviceSynchronize(); check_status(status); return Qnil; } |
.cudaDriverGetVersion ⇒ Integer
Returns the CUDA driver version.
23 24 25 26 27 28 29 30 31 32 33 |
# File 'ext/cumo/cuda/runtime.c', line 23 static VALUE rb_cudaDriverGetVersion(VALUE self) { int _version; cudaError_t status; status = cudaDriverGetVersion(&_version); check_status(status); return INT2NUM(_version); } |
.cudaGetDevice ⇒ Integer
Returns which device is currently being used.
64 65 66 67 68 |
# File 'ext/cumo/cuda/runtime.c', line 64 static VALUE rb_cudaGetDevice(VALUE self) { return INT2NUM(cumo_cuda_runtime_get_device()); } |
.cudaGetDeviceCount ⇒ Integer
Returns the number of compute-capable devices.
100 101 102 103 104 |
# File 'ext/cumo/cuda/runtime.c', line 100 static VALUE rb_cudaGetDeviceCount(VALUE self) { return INT2NUM(cumo_cuda_runtime_get_device_count()); } |
.cudaRuntimeGetVersion ⇒ Integer
Returns the CUDA Runtime version.
41 42 43 44 45 46 47 48 49 50 51 |
# File 'ext/cumo/cuda/runtime.c', line 41 static VALUE rb_cudaRuntimeGetVersion(VALUE self) { int _version; cudaError_t status; status = cudaRuntimeGetVersion(&_version); check_status(status); return INT2NUM(_version); } |
.cudaSetDevice(device) ⇒ Object
Set device to be used for GPU executions.
113 114 115 116 117 118 119 120 121 122 123 |
# File 'ext/cumo/cuda/runtime.c', line 113 static VALUE rb_cudaSetDevice(VALUE self, VALUE device) { int _device = NUM2INT(device); cudaError_t status; status = cudaSetDevice(_device); check_status(status); return Qnil; } |