cl::sycl::buffer< T, dims, AllocatorT > Class Template Reference
buffer is the public interface for the buffer object implementation. More...
#include <buffer.h>
Public Types | |
using | value_type = T |
Helper for the user, alias for type T. More... | |
using | reference = T & |
Helper for the user, alias for reference to type T. More... | |
using | const_reference = const T & |
Helper for the user, alias for const reference to type T. More... | |
using | allocator_type = AllocatorT |
Helper for the user, alias for the type of the allocator. More... | |
Public Member Functions | |
buffer (const range< dims > &r, const property_list &propList={}) | |
Constructs a buffer without a host pointer. More... | |
buffer (const range< dims > &r, AllocatorT allocator, const property_list &propList={}) | |
Constructs a buffer without a host pointer. More... | |
buffer (T *hostPointer, const range< dims > &r, const property_list &propList={}) | |
Constructs a buffer with a host pointer. More... | |
buffer (T *hostPointer, const range< dims > &r, AllocatorT allocator, const property_list &propList={}) | |
Constructs a buffer with a host pointer. More... | |
buffer (const T *hostPointer, const range< dims > &r, const property_list &propList={}) | |
Constructs a buffer with host pointer. More... | |
buffer (const T *hostPointer, const range< dims > &r, AllocatorT allocator, const property_list &propList={}) | |
Constructs a buffer with host pointer. More... | |
buffer (const shared_ptr_class< T > &hostPointer, const range< dims > &r, const property_list &propList={}) | |
Constructs a buffer with a host pointer. More... | |
buffer (const shared_ptr_class< T > &hostPointer, const range< dims > &r, AllocatorT allocator, const property_list &propList={}) | |
Constructs a buffer with a host pointer. More... | |
buffer (buffer< T, dims > &b, const id< dims > &base_index, const range< dims > &sub_range) | |
Construct a buffer as a subset from an existing buffer. More... | |
COMPUTECPP_DEPRECATED_BY_SYCL_VER (201703, "Use the OpenCL interop constructor which takes a SYCL context instead.") buffer(cl_mem mem_object | |
Construct a buffer from an OpenCL object. More... | |
template<access::mode accessMode> | |
COMPUTECPP_SET_IGNORE_DEPRECATED_API accessor< T, dims, accessMode, access::target::host_buffer > | get_access () |
Returns an accessor to the buffer, only used on the host side. More... | |
template<access::mode accessMode, access::target accessTarget = COMPUTECPP_ACCESS_TARGET_DEVICE> | |
accessor< T, dims, accessMode, accessTarget > | get_access (handler &cgh) |
this function returns an accessor to the buffer in the given command_group scope. More... | |
template<access::mode accessMode, access::target accessTarget = COMPUTECPP_ACCESS_TARGET_DEVICE> | |
COMPUTECPP_DEPRECATED_BY_SYCL_VER (201703, "Use overload where the range comes before the offset.") accessor< T | |
Returns an accessor to the buffer in the given command_group scope. More... | |
accessTarget | get_access (handler &cgh, id< dims > offset, range< dims > range) |
template<access::mode accessMode, access::target accessTarget = COMPUTECPP_ACCESS_TARGET_DEVICE> | |
accessor< T, dims, accessMode, accessTarget > | get_access (handler &cgh, range< dims > range, id< dims > offset={}) |
Returns an accessor to the buffer in the given command group scope. More... | |
template<access::mode accessMode> | |
COMPUTECPP_SET_IGNORE_DEPRECATED_API | COMPUTECPP_DEPRECATED_BY_SYCL_VER (201703, "Use overload where the range comes before the offset.") accessor< T |
Returns an accessor to the buffer, only used on the host side. More... | |
COMPUTECPP_SET_IGNORE_DEPRECATED_API access::target::host_buffer | get_access (id< dims > offset, range< dims > range) |
template<access::mode accessMode> | |
COMPUTECPP_SET_IGNORE_DEPRECATED_API accessor< T, dims, accessMode, access::target::host_buffer > | get_access (range< dims > range, id< dims > offset={}) |
Returns an accessor to the buffer, only used on the host side. More... | |
cl::sycl::range< dims > | get_range () const |
Returns the range of the buffer. More... | |
template<typename propertyT > | |
bool | has_property () const noexcept |
Returns whether this SYCL buffer was constructed with the property specified by propertyT. More... | |
template<typename propertyT > | |
propertyT | get_property () const |
Returns a copy of the property of type propertyT that this SYCL buffer was constructed with. More... | |
AllocatorT | get_allocator () const |
Returns the allocator provided to the buffer. More... | |
template<typename ReinterpretT , int ReinterpretDim> | |
buffer< ReinterpretT, ReinterpretDim, AllocatorT > | reinterpret (range< ReinterpretDim > reinterpretRange) const |
Creates and returns a reinterpreted SYCL buffer. More... | |
template<typename ReinterpretT , int ReinterpretDim = dims> | |
buffer< ReinterpretT, ReinterpretDim, AllocatorT > | reinterpret () const |
Creates and returns a reinterpreted SYCL buffer. More... | |
Public Attributes | |
queue & | fromQueue |
queue event | available_event |
dims | |
accessMode | |
COMPUTECPP_SET_IGNORE_DEPRECATED_API | dims |
COMPUTECPP_SET_IGNORE_DEPRECATED_API | accessMode |
Static Public Attributes | |
static constexpr const auto | dimensions = dims |
Number of buffer dimensions (Codeplay extension) More... | |
Detailed Description
template<typename T, int dims, typename AllocatorT>
class cl::sycl::buffer< T, dims, AllocatorT >
buffer is the public interface for the buffer object implementation.
The template allows the creation of specific types and number of dimensions.
Member Typedef Documentation
◆ allocator_type
using cl::sycl::buffer< T, dims, AllocatorT >::allocator_type = AllocatorT |
◆ const_reference
using cl::sycl::buffer< T, dims, AllocatorT >::const_reference = const T& |
◆ reference
using cl::sycl::buffer< T, dims, AllocatorT >::reference = T& |
◆ value_type
using cl::sycl::buffer< T, dims, AllocatorT >::value_type = T |
Constructor & Destructor Documentation
◆ buffer() [1/9]
|
inline |
Constructs a buffer without a host pointer.
The runtime will only use internally allocated memory and no copy in or out is defined. The given allocator is used to create internal storage in case the runtime requires it.
- Parameters
-
r Range of the buffer propList List of buffer properties
◆ buffer() [2/9]
|
inline |
Constructs a buffer without a host pointer.
The runtime will only use internally allocated memory and no copy in or out is defined. The given allocator is used to create internal storage in case the runtime requires it.
- Parameters
-
r Range of the buffer allocator The allocator used to create internal storage in case the runtime requires it. propList List of buffer properties
◆ buffer() [3/9]
|
inline |
Constructs a buffer with a host pointer.
In this case there is a host pointer, potentially initialized, but the user has not given the runtime any ownership, therefore the deleter has to be null. A Copy in is performed if the pointer is not null. If it is null, the data is initialized (new) inside the runtime. A copy out to hostPointer is performed by default.
- Parameters
-
hostPointer Pointer to host data r Range of the buffer propList List of buffer properties
◆ buffer() [4/9]
|
inline |
Constructs a buffer with a host pointer.
In this case there is a host pointer, potentially initialized, but the user has not given the runtime any ownership, therefore the deleter has to be null. A Copy in is performed if the pointer is not null. If it is null, the data is initialized (new) inside the runtime. A copy out to hostPointer is performed by default.
- Parameters
-
hostPointer Pointer to host data r Range of the buffer allocator The allocator used to create internal storage in case the runtime requires it. propList List of buffer properties
◆ buffer() [5/9]
|
inline |
Constructs a buffer with host pointer.
The user has given a const pointer, but the buffer is not const, so the runtime copies the data into a temporary space created using the given allocator. If the given allocator is a null allocator, this fails.
- Parameters
-
hostPointer Pointer to host data r Range of the buffer propList List of buffer properties
◆ buffer() [6/9]
|
inline |
Constructs a buffer with host pointer.
The user has given a const pointer, but the buffer is not const, so the runtime copies the data into a temporary space created using the given allocator. If the given allocator is a null allocator, this fails.
- Parameters
-
hostPointer Pointer to host data r Range of the buffer allocator The allocator used to create internal storage propList List of buffer properties
◆ buffer() [7/9]
|
inline |
Constructs a buffer with a host pointer.
The user has given a shared pointer, therefore the data is explicitly shared between the user and the runtime. If the hostPointer is null, no data is copied in, and data is initialized inside the runtime. Data is copied out if the reference count of the runtime is less than the reference count of the shared pointer.
- Parameters
-
hostPointer Shared pointer to host data r Range of the buffer propList List of buffer properties
◆ buffer() [8/9]
|
inline |
Constructs a buffer with a host pointer.
The user has given a shared pointer, therefore the data is explicitly shared between the user and the runtime. If the hostPointer is null, no data is copied in, and data is initialized inside the runtime. Data is copied out if the reference count of the runtime is less than the reference count of the shared pointer.
- Parameters
-
hostPointer Shared pointer to host data r Range of the buffer allocator The allocator used to create internal storage propList List of buffer properties
◆ buffer() [9/9]
Member Function Documentation
◆ COMPUTECPP_DEPRECATED_BY_SYCL_VER() [1/3]
cl::sycl::buffer< T, dims, AllocatorT >::COMPUTECPP_DEPRECATED_BY_SYCL_VER | ( | 201703 | , |
"Use the OpenCL interop constructor which takes a SYCL context instead." | |||
) |
Construct a buffer from an OpenCL object.
- Parameters
-
mem_object the user-provided OpenCL object that will be used by the buffer fromQueue the queue holding the context associated with the mem_object object available_event if provided signals that the cl_mem object has been created and is ready to be used
◆ COMPUTECPP_DEPRECATED_BY_SYCL_VER() [2/3]
cl::sycl::buffer< T, dims, AllocatorT >::COMPUTECPP_DEPRECATED_BY_SYCL_VER | ( | 201703 | , |
"Use overload where the range comes before the offset." | |||
) |
Returns an accessor to the buffer in the given command_group scope.
- Template Parameters
-
accessMode All access::mode values are accepted accessTarget Defaults to global_buffer, can accept global_buffer or constant_buffer
- Parameters
-
cgh Reference to the command group scope where the accessor is requested. offset the offset that the accessor will be able to update from. range the range in which the accessor will be updating the data.
- Returns
- Device accessor
- Deprecated:
- Need to reverse the order of the access offset and range, see 4.7.2.1 Buffer Interface in SYCL 1.2.1
◆ COMPUTECPP_DEPRECATED_BY_SYCL_VER() [3/3]
COMPUTECPP_SET_IGNORE_DEPRECATED_API cl::sycl::buffer< T, dims, AllocatorT >::COMPUTECPP_DEPRECATED_BY_SYCL_VER | ( | 201703 | , |
"Use overload where the range comes before the offset." | |||
) |
Returns an accessor to the buffer, only used on the host side.
- Template Parameters
-
accessMode All access::mode values are accepted
- Parameters
-
offset The offset that the accessor will be able to update from. range The range in which the accessor will be updating the data.
- Returns
- Host accessor
- Deprecated:
- Need to reverse the order of the access offset and range, see 4.7.2.1 Buffer Interface in SYCL 1.2.1
◆ get_access() [1/6]
|
inline |
Returns an accessor to the buffer, only used on the host side.
- Template Parameters
-
accessMode All access::mode values are accepted
- Returns
- Host accessor
◆ get_access() [2/6]
|
inline |
this function returns an accessor to the buffer in the given command_group scope.
- Template Parameters
-
accessMode all access::mode values are accepted accessTarget defaults to global_buffer, can accept global_buffer or constant_buffer
- Parameters
-
cgh Reference to the command group scope where the accessor is requested.
- Returns
- Device accessor
◆ get_access() [3/6]
◆ get_access() [4/6]
|
inline |
Returns an accessor to the buffer in the given command group scope.
- Template Parameters
-
accessMode All access::mode values are accepted accessTarget Defaults to global_buffer, can accept global_buffer or constant_buffer
- Parameters
-
cgh Reference to the command group scope where the accessor is requested range The range in which the accessor will be updating the data offset The offset that the accessor will be able to update from
- Returns
- Device accessor
◆ get_access() [5/6]
|
inline |
◆ get_access() [6/6]
|
inline |
Returns an accessor to the buffer, only used on the host side.
- Template Parameters
-
accessMode All access::mode values are accepted
- Parameters
-
range The range in which the accessor will be updating the data offset The offset that the accessor will be able to update from
- Returns
- Host accessor
◆ get_allocator()
|
inline |
◆ get_property()
|
inline |
◆ get_range()
|
inline |
◆ has_property()
|
inlinenoexcept |
◆ reinterpret() [1/2]
|
inline |
Creates and returns a reinterpreted SYCL buffer.
- Template Parameters
-
ReinterpretT New underlying type ReinterpretDim New buffer dimension
- Parameters
-
reinterpretRange New buffer range
- Returns
- Reinterpreted buffer with the requested parameters
- Exceptions
-
invalid_object_error if the size of the reinterpreted buffer and the size of the original buffer do not match
◆ reinterpret() [2/2]
|
inline |
Creates and returns a reinterpreted SYCL buffer.
- Template Parameters
-
ReinterpretT New underlying type ReinterpretDim New buffer dimension
- Returns
- Reinterpreted buffer with the requested parameters
- Exceptions
-
invalid_object_error if the size of the reinterpreted buffer and the size of the original buffer do not match
Member Data Documentation
◆ accessMode [1/2]
cl::sycl::buffer< T, dims, AllocatorT >::accessMode |
◆ accessMode [2/2]
COMPUTECPP_SET_IGNORE_DEPRECATED_API cl::sycl::buffer< T, dims, AllocatorT >::accessMode |
◆ available_event
queue event cl::sycl::buffer< T, dims, AllocatorT >::available_event |
◆ dimensions
|
static |
◆ dims [1/2]
cl::sycl::buffer< T, dims, AllocatorT >::dims |
◆ dims [2/2]
COMPUTECPP_SET_IGNORE_DEPRECATED_API cl::sycl::buffer< T, dims, AllocatorT >::dims |
◆ fromQueue
queue& cl::sycl::buffer< T, dims, AllocatorT >::fromQueue |
The documentation for this class was generated from the following file: