You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Now we have separate kernels for simple operations (such as matrix addition or transposition). These kernels do low amount of computation, compared to amouunt of data transfered from global GPU memory. So vast majority of time spent executing such kernels is needed for data transfers, instead of actual computations.
Usually when multiple simple operations are executed one after another they could be combined into a single kernel so that data is loaded only once. Less data transfers result in faster execution.
We should combine multiple operations on matrix_cl into expressions in similar way as Eigen does it. When evaluated or assigned to another matrix_cl an expression generates OpenCL kernel source, compiles and executes it.
Envisioned pull requests:
basic kernel generator with matrices, scalars and binary element-wise operations (+, -, *, /)
unary functions
submatrix blocks
selction operator
comparisons and logical operators
reductions(sum, min, max)
multiple results in a single kernel
broadcasting
transposition
more?
Example
The code below should result in execution of a single kernel.
matrix_cl<double> a;
matrix_cl<double> b;
matrix_cl<double> c;
matrix_cl<double> d = a + b - 3 * c;
Expected Output
Expressions of simple matrix operations on GPUs are faster. Creating simple OpenCL kernels does not require writing OpenCL source and can be done by non-GPU developers.
Activity
rok-cesnovar commentedon Nov 24, 2020
@t4c1 we can probably close this right? If other issues/feature requests pop up we can open additional issue.