Module exec_on_cpu

Module exec_on_cpu 

Source
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 Buffer stored on device D to two CPU Buffers and executes the binary operation F with a CPU on the newly created CPU Buffers.
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 Buffer stored on another device to a CPU Buffer and executes an reduce operation on the CPU.
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 Buffer stored on device D to a CPU Buffer and executes the unary operation F with a CPU on the newly created CPU Buffer.
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 Buffer stored on another device to a CPU Buffers and executes an operation on the CPU. The result is written back to the original Buffer.