Construct an OCL matrix of specific type from an octave matrix.
All the above constructor functions take as input a conventional numeric
octave matrix octave_mat (actually an N-dimensional array) of any
numeric data type. The constructors create a new OCL matrix ocl_mat
(as an N-dimensional array) of the specified numeric data type, allocate
storage space on the OpenCL device hardware, and copy the octave data
into the OpenCL device memory. The data then remains in device memory
until the OCL matrix is cleared from the octave workspace (or as long as the
OpenCL context exists).
ocl_double
and ocl_single
allow operation on real and complex data.
Copying data
from an OCL matrix back to an octave matrix is possible via the corresponding
standard type casting function (e.g., double
, single
, int16
).
For further explanation on using OCL matrices and example code, see oclArray
.
The constructor functions automatically assure that the OpenCL library is
loaded (see ocl_lib
) and that an OpenCL context is created with an
OpenCL device (see ocl_context
).
See also: oclArray, ocl_tests, ocl_program, ocl_context, ocl_lib.
Package: ocl