cl::sycl::private_memory< elementT, kDimensions > Class Template Reference
This class allows private memory allocation inside a handler::parallel_for_work_group. More...
#include <private_memory.h>
Public Member Functions | |
private_memory (const group< kDimensions > &group) | |
Allocate private memory based on the group range. More... | |
COMPUTECPP_DEPRECATED_API ("operator()(item) deprecated in SYCL 1.2.1, " "use operator()(h_item) instead") elementT &operator()(const item< kDimensions > &index) | |
Return the allocated private memory for the work item. More... | |
elementT & | operator() (const h_item< kDimensions > &index) |
Return the allocated private memory for the work item. More... | |
Detailed Description
template<typename elementT, int kDimensions = 1>
class cl::sycl::private_memory< elementT, kDimensions >
This class allows private memory allocation inside a handler::parallel_for_work_group.
By default, named variables declared in a handler::parallel_for_work_group are allocated in the OpenCL local address space and shared across work items inside a work group. Instances of this class are private to work items, and allow sharing of private data across different parallel_for_work_item calls.
Use COMPUTECPP_PRIVATE_MEMORY_ATTR attribute to ensure that the private memory class is allocated in the private address space. By default, a variable declared in a parallel_for_work_group will be allocated in the local address space
- this attribute cancels this effect.
- Template Parameters
-
elementT Underlying type of the stored data kDimensions Data dimensions
Definition at line 194 of file private_memory.h.
Constructor & Destructor Documentation
◆ private_memory()
|
inline |
Allocate private memory based on the group range.
- Parameters
-
group The group instance provided by the handler::parallel_for_work_group.
Definition at line 203 of file private_memory.h.
Member Function Documentation
◆ COMPUTECPP_DEPRECATED_API()
|
inline |
Return the allocated private memory for the work item.
- Parameters
-
index The item instance representing the work-item.
- Returns
- A reference to the work-item private instance.
- Warning
- This method cannot be used if the local range was redefined when calling parallel_for_work_item.
- Deprecated:
- Use operator()(h_item)
Definition at line 212 of file private_memory.h.
◆ operator()()
|
inline |
Return the allocated private memory for the work item.
- Parameters
-
index The h_item instance representing the work-item.
- Returns
- A reference to the work-item private instance.
- Warning
- This method cannot be used if the local range was redefined when calling parallel_for_work_item.
Definition at line 224 of file private_memory.h.
The documentation for this class was generated from the following file: