Expand description
This module includes macros and functions for executing operations on the CPU.
They move the supplied (CUDA, OpenCL, WGPU, …) Buffers to the CPU and execute the operation on the CPU.
Most of the time, you should actually implement the operation for the device natively, as it is typically faster.
Macros§
- cl_
cpu_ exec_ unified - If the current device supports unified memory, data is not deep-copied. This is way faster than cpu_exec, as new memory is not allocated.
- cl_
cpu_ exec_ unified_ mut - If the current device supports unified memory, data is not deep-copied. This is way faster than cpu_exec_mut, as new memory is not allocated.
Functions§
- cpu_
exec_ binary - Moves two
Bufferstored on deviceDto twoCPUBuffers and executes the binary operationFwith aCPUon the newly createdCPUBuffers. - cpu_
exec_ binary_ may_ unified - If the current device supports unified memory, data is not deep-copied. This is way faster than cpu_exec_binary, as new memory is not allocated.
- cpu_
exec_ binary_ may_ unified_ mut - If the current device supports unified memory, data is not deep-copied. This is way faster than cpu_exec_binary_mut, as new memory is not allocated.
- cpu_
exec_ binary_ mut - Inplace version of cpu_exec_binary
- cpu_
exec_ reduce - Moves a single
Bufferstored on another device to aCPUBufferand executes an reduce operation on theCPU. - cpu_
exec_ reduce_ may_ unified - If the current device supports unified memory, data is not deep-copied. This is way faster than cpu_exec_reduce, as new memory is not allocated.
- cpu_
exec_ unary - Moves a
Bufferstored on deviceDto aCPUBufferand executes the unary operationFwith aCPUon the newly createdCPUBuffer. - cpu_
exec_ unary_ may_ unified - If the current device supports unified memory, data is not deep-copied. This is way faster than cpu_exec_unary, as new memory is not allocated.
- cpu_
exec_ unary_ may_ unified_ mut - If the current device supports unified memory, data is not deep-copied. This is way faster than cpu_exec_unary_mut, as new memory is not allocated.
- cpu_
exec_ unary_ mut - Moves a single
Bufferstored on another device to aCPUBuffers and executes an operation on theCPU. The result is written back to the originalBuffer.