Accessors
Classes
A public facing accessor that can be constructed outside of a command group. |
|
Public facing interface class for allowing users access to buffer objects, image objects and local memory from within kernel functions and the host. The accessor class has many different constructors and operators available depending on the class template arguments including access target, access mode and dimensions. These constructors and operators are implemented using an enable_if technique in order to avoid a large amount of inheritance and code duplication. In order to reduce the complexity the enable_if conditions are predefined using static const const booleans and the enable_if definitions themselves are defined using the COMPUTECPP_ENABLE_IF macro. The accessor class also has the COMPUTECPP_CONVERT_ATTR macro attached to the end of the struct declaration, this is used during the compilers parameter flattening mechanism. The accessor class also has the COMPUTECPP_ACCESSOR_WINDOWS_ALIGNMENT and COMPUTECPP_ACCESSOR_LINUX_ALIGNMENT macros which align the accessor class to the pointer size, the reason for this is that for environments where the host and device pointer sizes don’t match the kernel argument offsets can sometimes misalign, aligning the accessor resolves this. |
|
provides a specialization for std::hash for the buffer class. An std::hash<std::shared_ptr<…» object is created and its function call operator is used to hash the contents of the shared_ptr. The returned hash is actually the result of (size_t) object.get_impl().get() |