cl::sycl::experimental Namespace Reference
Namespaces | |
usm | |
Classes | |
struct | maximum |
Operation for sub_group reduce and scan functions. More... | |
struct | maximum< void > |
Specialization for void, the template type will be deduced when calling the functor. More... | |
struct | minimum |
Operation for sub_group reduce and scan functions. More... | |
struct | minimum< void > |
Specialization for void, the template type will be deduced when calling the functor. More... | |
struct | sub_group |
The sub_group class is an interface for subgroups. More... | |
class | usm_allocator |
USM allocator. More... | |
Typedefs | |
template<class T = void> | |
using | plus = std::plus< T > |
Operation for sub_group reduce and scan functions. More... | |
template<class T = void> | |
using | multiplies = std::multiplies< T > |
Operation for sub_group reduce and scan functions. More... | |
template<class T = void> | |
using | bit_and = std::bit_and< T > |
Operation for sub_group reduce and scan functions. More... | |
template<class T = void> | |
using | bit_or = std::bit_or< T > |
Operation for sub_group reduce and scan functions. More... | |
template<class T = void> | |
using | bit_xor = std::bit_xor< T > |
Operation for sub_group reduce and scan functions. More... | |
template<class T = void> | |
using | logical_and = std::logical_and< T > |
Operation for sub_group reduce and scan functions. More... | |
template<class T = void> | |
using | logical_or = std::logical_or< T > |
Operation for sub_group reduce and scan functions. More... | |
Functions | |
COMPUTECPP_EXPORT void * | malloc_device (size_t size, const device &dev, const context &ctx) |
Performs a USM allocation on the device. More... | |
COMPUTECPP_EXPORT void * | malloc_device (size_t size, const queue &q) |
Performs a USM allocation on the device. More... | |
COMPUTECPP_EXPORT void * | aligned_alloc_device (size_t alignment, size_t size, const device &dev, const context &ctx) |
Performs a USM allocation on the device with a specific alignment. More... | |
COMPUTECPP_EXPORT void * | aligned_alloc_device (size_t alignment, size_t size, const queue &q) |
Performs a USM allocation on the device with a specific alignment. More... | |
COMPUTECPP_EXPORT void * | malloc_host (size_t size, const context &ctx) |
Performs a host USM allocation. More... | |
COMPUTECPP_EXPORT void * | malloc_host (size_t size, const queue &q) |
Performs a host USM allocation. More... | |
COMPUTECPP_EXPORT void * | aligned_alloc_host (size_t alignment, size_t size, const context &ctx) |
Performs a host USM allocation with a specific alignment. More... | |
COMPUTECPP_EXPORT void * | aligned_alloc_host (size_t alignment, size_t size, const queue &q) |
Performs a host USM allocation with a specific alignment. More... | |
COMPUTECPP_EXPORT void * | malloc_shared (size_t size, const device &dev, const context &ctx) |
Performs a shared USM allocation. More... | |
COMPUTECPP_EXPORT void * | malloc_shared (size_t size, const queue &q) |
Performs a shared USM allocation. More... | |
COMPUTECPP_EXPORT void * | aligned_alloc_shared (size_t alignment, size_t size, const device &dev, const context &ctx) |
Performs a shared USM allocation with a specific alignment. More... | |
COMPUTECPP_EXPORT void * | aligned_alloc_shared (size_t alignment, size_t size, const queue &q) |
Performs a shared USM allocation with a specific alignment. More... | |
COMPUTECPP_EXPORT void * | malloc (size_t size, const device &dev, const context &ctx, usm::alloc allocKind) |
Performs a USM allocation. More... | |
COMPUTECPP_EXPORT void * | malloc (size_t size, const queue &q, usm::alloc allocKind) |
Performs a USM allocation. More... | |
COMPUTECPP_EXPORT void * | aligned_alloc (size_t alignment, size_t size, const device &dev, const context &ctx, usm::alloc allocKind) |
Performs a USM allocation with a specific alignment. More... | |
COMPUTECPP_EXPORT void * | aligned_alloc (size_t alignment, size_t size, const queue &q, usm::alloc allocKind) |
Performs a USM allocation with a specific alignment. More... | |
COMPUTECPP_EXPORT void | free (void *ptr, const context &ctx) |
Frees USM allocated memory. More... | |
COMPUTECPP_EXPORT void | free (void *ptr, const queue &q) |
Frees USM allocated memory. More... | |
COMPUTECPP_EXPORT usm::alloc | get_pointer_type (const void *ptr, const context &ctx) |
Unified Shared Memory pointer type query. More... | |
COMPUTECPP_EXPORT device | get_pointer_device (const void *ptr, const context &ctx) |
Unified Shared Memory device for pointer query. More... | |
template<class T1 , usm::alloc AllocKindT1, size_t AlignmentT1, class T2 , usm::alloc AllocKindT2, size_t AlignmentT2> | |
bool | operator== (const usm_allocator< T1, AllocKindT1, AlignmentT1 > &lhs, const usm_allocator< T2, AllocKindT2, AlignmentT2 > &rhs) noexcept |
Compares two USM allocators. More... | |
template<class T1 , usm::alloc AllocKindT1, size_t AlignmentT1, class T2 , usm::alloc AllocKindT2, size_t AlignmentT2> | |
bool | operator!= (const usm_allocator< T1, AllocKindT1, AlignmentT1 > &lhs, const usm_allocator< T2, AllocKindT2, AlignmentT2 > &rhs) noexcept |
Compares two USM allocators. More... | |
Typedef Documentation
◆ bit_and
using cl::sycl::experimental::bit_and = typedef std::bit_and<T> |
Operation for sub_group reduce and scan functions.
- See also
- experimental::sub_group.
Definition at line 40 of file functional.h.
◆ bit_or
using cl::sycl::experimental::bit_or = typedef std::bit_or<T> |
Operation for sub_group reduce and scan functions.
- See also
- experimental::sub_group.
Definition at line 46 of file functional.h.
◆ bit_xor
using cl::sycl::experimental::bit_xor = typedef std::bit_xor<T> |
Operation for sub_group reduce and scan functions.
- See also
- experimental::sub_group.
Definition at line 52 of file functional.h.
◆ logical_and
using cl::sycl::experimental::logical_and = typedef std::logical_and<T> |
Operation for sub_group reduce and scan functions.
- See also
- experimental::sub_group.
Definition at line 58 of file functional.h.
◆ logical_or
using cl::sycl::experimental::logical_or = typedef std::logical_or<T> |
Operation for sub_group reduce and scan functions.
- See also
- experimental::sub_group.
Definition at line 64 of file functional.h.
◆ multiplies
using cl::sycl::experimental::multiplies = typedef std::multiplies<T> |
Operation for sub_group reduce and scan functions.
- See also
- experimental::sub_group.
Definition at line 34 of file functional.h.
◆ plus
using cl::sycl::experimental::plus = typedef std::plus<T> |
Operation for sub_group reduce and scan functions.
- See also
- experimental::sub_group.
Definition at line 28 of file functional.h.
Function Documentation
◆ aligned_alloc() [1/2]
T * cl::sycl::experimental::aligned_alloc | ( | size_t | alignment, |
size_t | count, | ||
const device & | dev, | ||
const context & | ctx, | ||
usm::alloc | allocKind | ||
) |
Performs a USM allocation with a specific alignment.
- Parameters
-
alignment Allocation alignment, in bytes. Must be a power of two. Zero indicates default alignment. size Number of bytes to allocate. dev Device to allocate on, unused if allocKind
is usm::host.ctx Context where the device is located. allocKind Allocation kind.
- Returns
- A pointer to the memory block allocated by the function. nullptr if allocation fails for any reason.
- Parameters
-
alignment Allocation alignment, in bytes. Must be a power of two. Zero indicates default alignment.
- Template Parameters
-
T Element type.
- Parameters
-
count Number of elements to allocate. dev Device to allocate on, unused if allocKind
is usm::host.ctx Context where the device is located. allocKind Allocation kind.
- Returns
- A pointer to the memory block allocated by the function. nullptr if allocation fails for any reason.
◆ aligned_alloc() [2/2]
T * cl::sycl::experimental::aligned_alloc | ( | size_t | alignment, |
size_t | count, | ||
const queue & | q, | ||
usm::alloc | allocKind | ||
) |
Performs a USM allocation with a specific alignment.
- Parameters
-
alignment Allocation alignment, in bytes. Must be a power of two. Zero indicates default alignment. size Number of bytes to allocate. q Queue containing the context and device to allocate on. allocKind Allocation kind.
- Returns
- A pointer to the memory block allocated by the function. nullptr if allocation fails for any reason.
- Parameters
-
alignment Allocation alignment, in bytes. Must be a power of two. Zero indicates default alignment.
- Template Parameters
-
T Element type.
- Parameters
-
count Number of elements to allocate. q Queue containing the context and device to allocate on. allocKind Allocation kind.
- Returns
- A pointer to the memory block allocated by the function. nullptr if allocation fails for any reason.
◆ aligned_alloc_device() [1/2]
T * cl::sycl::experimental::aligned_alloc_device | ( | size_t | alignment, |
size_t | count, | ||
const device & | dev, | ||
const context & | ctx | ||
) |
Performs a USM allocation on the device with a specific alignment.
- Parameters
-
alignment Allocation alignment, in bytes. Must be a power of two. Zero indicates default alignment. size Number of bytes to allocate dev Device to allocate on ctx Context where the device is located
- Returns
- A pointer to the memory block allocated by the function. nullptr if allocation fails for any reason.
- Parameters
-
alignment Allocation alignment, in bytes. Must be a power of two. Zero indicates default alignment.
- Template Parameters
-
T Element type
- Parameters
-
count Number of elements to allocate dev Device to allocate on ctx Context where the device is located
- Returns
- A pointer to the memory block allocated by the function. nullptr if allocation fails for any reason.
◆ aligned_alloc_device() [2/2]
T * cl::sycl::experimental::aligned_alloc_device | ( | size_t | alignment, |
size_t | count, | ||
const queue & | q | ||
) |
Performs a USM allocation on the device with a specific alignment.
- Parameters
-
alignment Allocation alignment, in bytes. Must be a power of two. Zero indicates default alignment. size Number of bytes to allocate q Queue containing the context and device to allocate on
- Returns
- A pointer to the memory block allocated by the function. nullptr if allocation fails for any reason.
- Parameters
-
alignment Allocation alignment, in bytes. Must be a power of two. Zero indicates default alignment.
- Template Parameters
-
T Element type
- Parameters
-
count Number of elements to allocate q Queue containing the context and device to allocate on
- Returns
- A pointer to the memory block allocated by the function. nullptr if allocation fails for any reason.
◆ aligned_alloc_host() [1/2]
T * cl::sycl::experimental::aligned_alloc_host | ( | size_t | alignment, |
size_t | count, | ||
const context & | ctx | ||
) |
Performs a host USM allocation with a specific alignment.
- Parameters
-
alignment Allocation alignment, in bytes. Must be a power of two. Zero indicates default alignment. size Number of bytes to allocate. ctx Context whose devices can access the host allocation.
- Returns
- A pointer to the memory block allocated by the function. nullptr if allocation fails for any reason.
- Parameters
-
alignment Allocation alignment, in bytes. Must be a power of two. Zero indicates default alignment.
- Template Parameters
-
T Element type.
- Parameters
-
count Number of elements to allocate. ctx Context whose devices can access the host allocation.
- Returns
- A pointer to the memory block allocated by the function. nullptr if allocation fails for any reason.
◆ aligned_alloc_host() [2/2]
T * cl::sycl::experimental::aligned_alloc_host | ( | size_t | alignment, |
size_t | count, | ||
const queue & | q | ||
) |
Performs a host USM allocation with a specific alignment.
- Parameters
-
alignment Allocation alignment, in bytes. Must be a power of two. Zero indicates default alignment. size Number of bytes to allocate. q Queue containing the context whose devices can access the host allocation.
- Returns
- A pointer to the memory block allocated by the function. nullptr if allocation fails for any reason.
- Parameters
-
alignment Allocation alignment, in bytes. Must be a power of two. Zero indicates default alignment.
- Template Parameters
-
T Element type.
- Parameters
-
count Number of elements to allocate. q Queue containing the context whose devices can access the host allocation.
- Returns
- A pointer to the memory block allocated by the function. nullptr if allocation fails for any reason.
◆ aligned_alloc_shared() [1/2]
T * cl::sycl::experimental::aligned_alloc_shared | ( | size_t | alignment, |
size_t | count, | ||
const device & | dev, | ||
const context & | ctx | ||
) |
Performs a shared USM allocation with a specific alignment.
- Parameters
-
alignment Allocation alignment, in bytes. Must be a power of two. Zero indicates default alignment. size Number of bytes to allocate. dev Device to allocate on. ctx Context whose devices can access the shared allocation.
- Returns
- A pointer to the memory block allocated by the function. nullptr if allocation fails for any reason.
- Parameters
-
alignment Allocation alignment, in bytes. Must be a power of two. Zero indicates default alignment.
- Template Parameters
-
T Element type.
- Parameters
-
count Number of elements to allocate. dev Device to allocate on. ctx Context whose devices can access the shared allocation.
- Returns
- A pointer to the memory block allocated by the function. nullptr if allocation fails for any reason.
◆ aligned_alloc_shared() [2/2]
T * cl::sycl::experimental::aligned_alloc_shared | ( | size_t | alignment, |
size_t | count, | ||
const queue & | q | ||
) |
Performs a shared USM allocation with a specific alignment.
- Parameters
-
alignment Allocation alignment, in bytes. Must be a power of two. Zero indicates default alignment. size Number of bytes to allocate. q Queue containing the context and device to allocate on.
- Returns
- A pointer to the memory block allocated by the function. nullptr if allocation fails for any reason.
- Parameters
-
alignment Allocation alignment, in bytes. Must be a power of two. Zero indicates default alignment.
- Template Parameters
-
T Element type.
- Parameters
-
count Number of elements to allocate. q Queue containing the context and device to allocate on.
- Returns
- A pointer to the memory block allocated by the function. nullptr if allocation fails for any reason.
◆ free() [1/2]
COMPUTECPP_EXPORT void cl::sycl::experimental::free | ( | void * | ptr, |
const context & | ctx | ||
) |
Frees USM allocated memory.
- Parameters
-
ptr Pointer to USM allocated memory. Passing other kinds of pointers is not guaranteed to work. ctx Context where the allocation was performed
◆ free() [2/2]
COMPUTECPP_EXPORT void cl::sycl::experimental::free | ( | void * | ptr, |
const queue & | q | ||
) |
Frees USM allocated memory.
- Parameters
-
ptr Pointer to USM allocated memory. Passing other kinds of pointers is not guaranteed to work. q Queue containing the context where the allocation was performed
◆ get_pointer_device()
COMPUTECPP_EXPORT device cl::sycl::experimental::get_pointer_device | ( | const void * | ptr, |
const context & | ctx | ||
) |
Unified Shared Memory device for pointer query.
- Parameters
-
ptr The pointer to query. ctx The SYCL context to which the USM allocation belongs.
- Returns
- The device associated with the USM allocation. If
ctx
is a host context, returns the host device inctx
. Ifptr
is an allocation of type usm::alloc::host, returns the first device inctx
.
- Exceptions
-
cl::sycl::runtime_error if ptr
is not a valid USM allocation.
◆ get_pointer_type()
COMPUTECPP_EXPORT usm::alloc cl::sycl::experimental::get_pointer_type | ( | const void * | ptr, |
const context & | ctx | ||
) |
Unified Shared Memory pointer type query.
- Parameters
-
ptr The pointer to query. ctx The SYCL context to which the USM allocation belongs.
- Returns
- The USM allocation type for
ptr
ifptr
falls inside a valid USM allocation. Ifctx
is a host context returns usm::alloc::host. Returns usm::alloc::unknown ifptr
is not a valid USM allocation.
◆ malloc() [1/2]
T * cl::sycl::experimental::malloc | ( | size_t | count, |
const device & | dev, | ||
const context & | ctx, | ||
usm::alloc | allocKind | ||
) |
Performs a USM allocation.
- Parameters
-
size Number of bytes to allocate. dev Device to allocate on, unused if allocKind
is usm::host.ctx Context where the device is located. allocKind Allocation kind.
- Returns
- A pointer to the memory block allocated by the function. nullptr if allocation fails for any reason.
- Template Parameters
-
T Element type.
- Parameters
-
count Number of elements to allocate. dev Device to allocate on, unused if allocKind
is usm::host.ctx Context where the device is located. allocKind Allocation kind.
- Returns
- A pointer to the memory block allocated by the function. nullptr if allocation fails for any reason.
◆ malloc() [2/2]
T * cl::sycl::experimental::malloc | ( | size_t | count, |
const queue & | q, | ||
usm::alloc | allocKind | ||
) |
Performs a USM allocation.
- Parameters
-
size Number of bytes to allocate. q Queue containing the context and device to allocate on. allocKind Allocation kind.
- Returns
- A pointer to the memory block allocated by the function. nullptr if allocation fails for any reason.
- Template Parameters
-
T Element type.
- Parameters
-
count Number of elements to allocate. q Queue containing the context and device to allocate on. allocKind Allocation kind.
- Returns
- A pointer to the memory block allocated by the function. nullptr if allocation fails for any reason.
◆ malloc_device() [1/2]
Performs a USM allocation on the device.
- Parameters
-
size Number of bytes to allocate dev Device to allocate on ctx Context where the device is located
- Returns
- A pointer to the memory block allocated by the function. nullptr if allocation fails for any reason.
- Template Parameters
-
T Element type
- Parameters
-
count Number of elements to allocate dev Device to allocate on ctx Context where the device is located
- Returns
- A pointer to the memory block allocated by the function. nullptr if allocation fails for any reason.
◆ malloc_device() [2/2]
T * cl::sycl::experimental::malloc_device | ( | size_t | count, |
const queue & | q | ||
) |
Performs a USM allocation on the device.
- Parameters
-
size Number of bytes to allocate q Queue containing the context and device to allocate on
- Returns
- A pointer to the memory block allocated by the function. nullptr if allocation fails for any reason.
- Template Parameters
-
T Element type
- Parameters
-
count Number of elements to allocate q Queue containing the context and device to allocate on
- Returns
- A pointer to the memory block allocated by the function. nullptr if allocation fails for any reason.
◆ malloc_host() [1/2]
T * cl::sycl::experimental::malloc_host | ( | size_t | count, |
const context & | ctx | ||
) |
Performs a host USM allocation.
- Parameters
-
size Number of bytes to allocate. ctx Context whose devices can access the host allocation.
- Returns
- A pointer to the memory block allocated by the function. nullptr if allocation fails for any reason.
- Template Parameters
-
T Element type.
- Parameters
-
count Number of elements to allocate. ctx Context whose devices can access the host allocation.
- Returns
- A pointer to the memory block allocated by the function. nullptr if allocation fails for any reason.
◆ malloc_host() [2/2]
T * cl::sycl::experimental::malloc_host | ( | size_t | count, |
const queue & | q | ||
) |
Performs a host USM allocation.
- Parameters
-
size Number of bytes to allocate. q Queue containing the context whose devices can access the host allocation.
- Returns
- A pointer to the memory block allocated by the function. nullptr if allocation fails for any reason.
- Template Parameters
-
T Element type.
- Parameters
-
count Number of elements to allocate. q Queue containing the context whose devices can access the host allocation.
- Returns
- A pointer to the memory block allocated by the function. nullptr if allocation fails for any reason.
◆ malloc_shared() [1/2]
Performs a shared USM allocation.
- Parameters
-
size Number of bytes to allocate. dev Device to allocate on. ctx Context whose devices can access the shared allocation.
- Returns
- A pointer to the memory block allocated by the function. nullptr if allocation fails for any reason.
- Template Parameters
-
T Element type.
- Parameters
-
count Number of elements to allocate. dev Device to allocate on. ctx Context whose devices can access the shared allocation.
- Returns
- A pointer to the memory block allocated by the function. nullptr if allocation fails for any reason.
◆ malloc_shared() [2/2]
T * cl::sycl::experimental::malloc_shared | ( | size_t | count, |
const queue & | q | ||
) |
Performs a shared USM allocation.
- Parameters
-
size Number of bytes to allocate. q Queue the context and device to allocate on.
- Returns
- A pointer to the memory block allocated by the function. nullptr if allocation fails for any reason.
- Template Parameters
-
T Element type.
- Parameters
-
count Number of elements to allocate. q Queue containing the context and device to allocate on.
- Returns
- A pointer to the memory block allocated by the function. nullptr if allocation fails for any reason.
◆ operator!=()
|
noexcept |
◆ operator==()
|
noexcept |