stdgpu: stdgpu::for_each_index
stdgpu Latest
Efficient STL-like Data Structures on the GPU
|
|
◆ for_each_index()
template<typename IndexType , typename ExecutionPolicy , typename UnaryFunction , STDGPU_DETAIL_OVERLOAD_IF(is_execution_policy_v< remove_cvref_t< ExecutionPolicy > >) >
void stdgpu::for_each_index |
( |
ExecutionPolicy && |
policy, |
|
|
IndexType |
size, |
|
|
UnaryFunction |
f |
|
) |
| |
Calls the given unary function with an index from the range [0, size)
- Template Parameters
-
IndexType | The type of the index values |
ExecutionPolicy | The type of the execution policy |
UnaryFunction | The type of the unary function |
- Parameters
-
[in] | policy | The execution policy, e.g. host or device |
[in] | size | The number of indices, i.e. the upper bound of [0, size) |
[in] | f | The unary function to call with an index i |
|