triSYCL implementation of OpenCL SYCL
Classes | Namespaces | Macros
handler.hpp File Reference
#include "CL/sycl/accessor.hpp"
#include "CL/sycl/command_group/detail/task.hpp"
#include "CL/sycl/parallelism/detail/parallelism.hpp"
#include "CL/sycl/detail/unimplemented.hpp"
#include "CL/sycl/exception.hpp"
Include dependency graph for handler.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  cl::sycl::kernel
 Kernel. More...
 
class  cl::sycl::handler
 Command group handler class. More...
 

Namespaces

 cl
 The vector type to be used as SYCL vector.
 
 cl::sycl
 

Macros

#define TRISYCL_parallel_for_functor_GLOBAL(N)
 SYCL parallel_for launches a data parallel computation with parallelism specified at launch time by a range<> More...
 
#define TRISYCL_ParallelForFunctor_GLOBAL_OFFSET(N)
 

Macro Definition Documentation

#define TRISYCL_parallel_for_functor_GLOBAL (   N)
Value:
template <typename KernelName = std::nullptr_t, \
typename ParallelForFunctor> \
void parallel_for(range<N> global_size, \
ParallelForFunctor f) { \
current_task->schedule([=] { detail::parallel_for(global_size, f); }); \
}
void parallel_for(range< Dimensions > r, ParallelForFunctor f)
Implementation of a data parallel computation with parallelism specified at launch time by a range<>...

SYCL parallel_for launches a data parallel computation with parallelism specified at launch time by a range<>

Kernel invocation method of a kernel defined as a lambda or functor, for the specified range and given an id or item for indexing in the indexing space defined by range.

If it is a lambda function or the if the functor type is globally visible there is no need for the developer to provide a kernel name type (typename KernelName) for it, as described in detail in 3.5.3

Parameters
global_sizeis the full size of the range<>
Ndimensionality of the iteration space
fis the kernel functor to execute
KernelNameis a class type that defines the name to be used for the underlying kernel

Unfortunately, to have implicit conversion to work on the range, the function can not be templated, so instantiate it for all the dimensions

Definition at line 133 of file handler.hpp.

#define TRISYCL_ParallelForFunctor_GLOBAL_OFFSET (   N)
Value:
template <typename KernelName = std::nullptr_t, \
typename ParallelForFunctor> \
void parallel_for(range<N> global_size, \
id<N> offset, \
ParallelForFunctor f) { \
current_task->schedule([=] { \
offset, \
f); }); \
}
void parallel_for_global_offset(range< Dimensions > global_size, id< Dimensions > offset, ParallelForFunctor f)
Implementation of parallel_for with a range<> and an offset.
void parallel_for(range< Dimensions > r, ParallelForFunctor f)
Implementation of a data parallel computation with parallelism specified at launch time by a range<>...