Defines a shared array that can be used by kernels in queues. More...
#include <sycl/buffer.hpp>
Public Types | |
using | value_type = T |
using | reference = value_type & |
using | const_reference = const value_type & |
using | allocator_type = AllocatorT |
template<int dims> | |
using | EnableIfOneDimension = typename std::enable_if_t< 1==dims > |
template<class Container > | |
using | EnableIfContiguous = std::void_t< std::enable_if_t< std::is_convertible_v< std::remove_pointer_t< decltype(std::declval< Container >().data())>(*)[], const T(*)[]> >, decltype(std::declval< Container >().size())> |
template<class It > | |
using | EnableIfItInputIterator = std::enable_if_t< std::is_convertible_v< typename std::iterator_traits< It >::iterator_category, std::input_iterator_tag > > |
template<typename ItA , typename ItB > | |
using | EnableIfSameNonConstIterators = typename std::enable_if_t< std::is_same_v< ItA, ItB > &&!std::is_const_v< ItA >, ItA > |
Public Member Functions | |
buffer (const range< dimensions > &bufferRange, const property_list &propList={}, const detail::code_location CodeLoc=detail::code_location::current()) | |
buffer (const range< dimensions > &bufferRange, AllocatorT allocator, const property_list &propList={}, const detail::code_location CodeLoc=detail::code_location::current()) | |
buffer (T *hostData, const range< dimensions > &bufferRange, const property_list &propList={}, const detail::code_location CodeLoc=detail::code_location::current()) | |
buffer (T *hostData, const range< dimensions > &bufferRange, AllocatorT allocator, const property_list &propList={}, const detail::code_location CodeLoc=detail::code_location::current()) | |
template<typename _T = T> | |
buffer (EnableIfSameNonConstIterators< T, _T > const *hostData, const range< dimensions > &bufferRange, const property_list &propList={}, const detail::code_location CodeLoc=detail::code_location::current()) | |
template<typename _T = T> | |
buffer (EnableIfSameNonConstIterators< T, _T > const *hostData, const range< dimensions > &bufferRange, AllocatorT allocator, const property_list &propList={}, const detail::code_location CodeLoc=detail::code_location::current()) | |
buffer (const std::shared_ptr< T > &hostData, const range< dimensions > &bufferRange, AllocatorT allocator, const property_list &propList={}, const detail::code_location CodeLoc=detail::code_location::current()) | |
buffer (const std::shared_ptr< T[]> &hostData, const range< dimensions > &bufferRange, AllocatorT allocator, const property_list &propList={}, const detail::code_location CodeLoc=detail::code_location::current()) | |
buffer (const std::shared_ptr< T > &hostData, const range< dimensions > &bufferRange, const property_list &propList={}, const detail::code_location CodeLoc=detail::code_location::current()) | |
buffer (const std::shared_ptr< T[]> &hostData, const range< dimensions > &bufferRange, const property_list &propList={}, const detail::code_location CodeLoc=detail::code_location::current()) | |
template<class InputIterator , int N = dimensions, typename = EnableIfOneDimension<N>, typename = EnableIfItInputIterator<InputIterator>> | |
buffer (InputIterator first, InputIterator last, AllocatorT allocator, const property_list &propList={}, const detail::code_location CodeLoc=detail::code_location::current()) | |
template<class InputIterator , int N = dimensions, typename = EnableIfOneDimension<N>, typename = EnableIfItInputIterator<InputIterator>> | |
buffer (InputIterator first, InputIterator last, const property_list &propList={}, const detail::code_location CodeLoc=detail::code_location::current()) | |
template<class Container , int N = dimensions, typename = EnableIfOneDimension<N>, typename = EnableIfContiguous<Container>> | |
buffer (Container &container, AllocatorT allocator, const property_list &propList={}, const detail::code_location CodeLoc=detail::code_location::current()) | |
template<class Container , int N = dimensions, typename = EnableIfOneDimension<N>, typename = EnableIfContiguous<Container>> | |
buffer (Container &container, const property_list &propList={}, const detail::code_location CodeLoc=detail::code_location::current()) | |
buffer (buffer< T, dimensions, AllocatorT > &b, const id< dimensions > &baseIndex, const range< dimensions > &subRange, const detail::code_location CodeLoc=detail::code_location::current()) | |
buffer (const buffer &rhs, const detail::code_location CodeLoc=detail::code_location::current()) | |
buffer (buffer &&rhs, const detail::code_location CodeLoc=detail::code_location::current()) | |
buffer & | operator= (const buffer &rhs)=default |
buffer & | operator= (buffer &&rhs)=default |
~buffer () | |
bool | operator== (const buffer &rhs) const |
bool | operator!= (const buffer &rhs) const |
range< dimensions > | get_range () const |
__SYCL2020_DEPRECATED ("get_count() is deprecated, please use size() instead") size_t get_count() const | |
size_t | size () const noexcept |
__SYCL2020_DEPRECATED ("get_size() is deprecated, please use byte_size() instead") size_t get_size() const | |
size_t | byte_size () const noexcept |
AllocatorT | get_allocator () const |
template<access::mode Mode, access::target Target = access::target::device> | |
accessor< T, dimensions, Mode, Target, access::placeholder::false_t, ext::oneapi::accessor_property_list<> > | get_access (handler &CommandGroupHandler, const detail::code_location CodeLoc=detail::code_location::current()) |
template<access::mode mode> | |
__SYCL2020_DEPRECATED ("get_access for host_accessor is deprecated, please " "use get_host_access instead") accessor< T | |
ext::oneapi::accessor_property_list | get_access (const detail::code_location CodeLoc=detail::code_location::current()) |
template<access::mode mode, access::target target = access::target::device> | |
accessor< T, dimensions, mode, target, access::placeholder::false_t, ext::oneapi::accessor_property_list<> > | get_access (handler &commandGroupHandler, range< dimensions > accessRange, id< dimensions > accessOffset={}, const detail::code_location CodeLoc=detail::code_location::current()) |
template<access::mode mode> | |
__SYCL2020_DEPRECATED ("get_access for host_accessor is deprecated, please " "use get_host_access instead") accessor< T | |
ext::oneapi::accessor_property_list | get_access (range< dimensions > accessRange, id< dimensions > accessOffset={}, const detail::code_location CodeLoc=detail::code_location::current()) |
template<typename... Ts> | |
auto | get_access (Ts... args) |
template<typename... Ts> | |
auto | get_access (handler &commandGroupHandler, Ts... args) |
template<typename... Ts> | |
auto | get_host_access (Ts... args) |
template<typename... Ts> | |
auto | get_host_access (handler &commandGroupHandler, Ts... args) |
template<typename Destination = std::nullptr_t> | |
void | set_final_data (Destination finalData=nullptr) |
void | set_final_data_internal (std::nullptr_t) |
template<template< typename WeakT > class WeakPtrT, typename WeakT > | |
std::enable_if_t< std::is_convertible_v< WeakPtrT< WeakT >, std::weak_ptr< WeakT > > > | set_final_data_internal (WeakPtrT< WeakT > FinalData) |
template<typename WeakT > | |
void | set_final_data_internal (std::weak_ptr< WeakT > FinalData) |
template<typename Destination > | |
detail::EnableIfOutputPointerT< Destination > | set_final_data_internal (Destination FinalData) |
template<typename Destination > | |
detail::EnableIfOutputIteratorT< Destination > | set_final_data_internal (Destination FinalData) |
void | set_final_data (std::nullptr_t) |
void | set_write_back (bool flag=true) |
bool | is_sub_buffer () const |
template<typename ReinterpretT , int ReinterpretDim> | |
buffer< ReinterpretT, ReinterpretDim, typename std::allocator_traits< AllocatorT >::template rebind_alloc< std::remove_const_t< ReinterpretT > > > | reinterpret (range< ReinterpretDim > reinterpretRange) const |
template<typename ReinterpretT , int ReinterpretDim = dimensions> | |
std::enable_if_t<(sizeof(ReinterpretT)==sizeof(T)) &&(dimensions==ReinterpretDim), buffer< ReinterpretT, ReinterpretDim, typename std::allocator_traits< AllocatorT >::template rebind_alloc< std::remove_const_t< ReinterpretT > > > > | reinterpret () const |
template<typename ReinterpretT , int ReinterpretDim = dimensions> | |
std::enable_if_t<(ReinterpretDim==1) &&((dimensions !=ReinterpretDim)||(sizeof(ReinterpretT) !=sizeof(T))), buffer< ReinterpretT, ReinterpretDim, AllocatorT > > | reinterpret () const |
template<typename propertyT > | |
bool | has_property () const noexcept |
template<typename propertyT > | |
propertyT | get_property () const |
Public Attributes | |
dimensions | |
mode | |
Protected Member Functions | |
bool | isOutOfBounds (const id< dimensions > &offset, const range< dimensions > &newRange, const range< dimensions > &parentRange) |
Protected Member Functions inherited from sycl::_V1::detail::buffer_plain | |
buffer_plain (size_t SizeInBytes, size_t, const property_list &Props, std::unique_ptr< detail::SYCLMemObjAllocator > Allocator) | |
buffer_plain (void *HostData, size_t SizeInBytes, size_t RequiredAlign, const property_list &Props, std::unique_ptr< detail::SYCLMemObjAllocator > Allocator) | |
buffer_plain (const void *HostData, size_t SizeInBytes, size_t RequiredAlign, const property_list &Props, std::unique_ptr< detail::SYCLMemObjAllocator > Allocator) | |
buffer_plain (const std::shared_ptr< const void > &HostData, const size_t SizeInBytes, size_t RequiredAlign, const property_list &Props, std::unique_ptr< detail::SYCLMemObjAllocator > Allocator, bool IsConstPtr) | |
buffer_plain (const std::function< void(void *)> &CopyFromInput, const size_t SizeInBytes, size_t RequiredAlign, const property_list &Props, std::unique_ptr< detail::SYCLMemObjAllocator > Allocator, bool IsConstPtr) | |
buffer_plain (ur_native_handle_t MemObject, const context &SyclContext, std::unique_ptr< detail::SYCLMemObjAllocator > Allocator, bool OwnNativeHandle, const event &AvailableEvent) | |
buffer_plain (const std::shared_ptr< detail::buffer_impl > &impl) | |
void | set_final_data_internal () |
void | set_final_data_internal (const std::function< void(const std::function< void(void *const Ptr)> &)> &FinalDataFunc) |
void | set_write_back (bool NeedWriteBack) |
void | constructorNotification (const detail::code_location &CodeLoc, void *UserObj, const void *HostObj, const void *Type, uint32_t Dim, uint32_t ElemType, size_t Range[3]) |
template<typename propertyT > | |
bool | has_property () const noexcept |
template<typename propertyT > | |
propertyT | get_property () const |
std::vector< ur_native_handle_t > | getNativeVector (backend BackendName) const |
const std::unique_ptr< SYCLMemObjAllocator > & | get_allocator_internal () const |
void | deleteAccProps (const sycl::detail::PropWithDataKind &Kind) |
void | addOrReplaceAccessorProperties (const property_list &PropertyList) |
size_t | getSize () const |
void | handleRelease () const |
const property_list & | getPropList () const |
Friends | |
template<typename A , int dims, typename C , typename Enable > | |
class | buffer |
template<typename DataT , int dims, access::mode mode, access::target target, access::placeholder isPlaceholder, typename PropertyListT > | |
class | accessor |
template<typename SYCLObjT > | |
class | ext::oneapi::weak_object |
template<typename HT , int HDims, typename HAllocT > | |
buffer< HT, HDims, HAllocT, void > | detail::make_buffer_helper (ur_native_handle_t, const context &, const event &, bool) |
template<backend BackendName, typename DataT , int Dimensions, typename Allocator > | |
auto | detail::get_native_buffer (const buffer< DataT, Dimensions, Allocator, void > &Obj) -> backend_return_t< BackendName, buffer< DataT, Dimensions, Allocator, void >> |
Additional Inherited Members | |
Protected Attributes inherited from sycl::_V1::detail::buffer_plain | |
std::shared_ptr< detail::buffer_impl > | impl |
Defines a shared array that can be used by kernels in queues.
Buffers can be 1-, 2-, and 3-dimensional. They have to be accessed using accessor classes.
Definition at line 172 of file buffer.hpp.
using sycl::_V1::buffer< T, dimensions, AllocatorT, __Enabled >::allocator_type = AllocatorT |
Definition at line 181 of file buffer.hpp.
using sycl::_V1::buffer< T, dimensions, AllocatorT, __Enabled >::const_reference = const value_type & |
Definition at line 180 of file buffer.hpp.
using sycl::_V1::buffer< T, dimensions, AllocatorT, __Enabled >::EnableIfContiguous = std::void_t<std::enable_if_t<std::is_convertible_v< std::remove_pointer_t< decltype(std::declval<Container>().data())> (*)[], const T (*)[]> >, decltype(std::declval<Container>().size())> |
Definition at line 186 of file buffer.hpp.
using sycl::_V1::buffer< T, dimensions, AllocatorT, __Enabled >::EnableIfItInputIterator = std::enable_if_t<std::is_convertible_v< typename std::iterator_traits<It>::iterator_category, std::input_iterator_tag> > |
Definition at line 193 of file buffer.hpp.
using sycl::_V1::buffer< T, dimensions, AllocatorT, __Enabled >::EnableIfOneDimension = typename std::enable_if_t<1 == dims> |
Definition at line 183 of file buffer.hpp.
using sycl::_V1::buffer< T, dimensions, AllocatorT, __Enabled >::EnableIfSameNonConstIterators = typename std::enable_if_t< std::is_same_v<ItA, ItB> && !std::is_const_v<ItA>, ItA> |
Definition at line 197 of file buffer.hpp.
using sycl::_V1::buffer< T, dimensions, AllocatorT, __Enabled >::reference = value_type & |
Definition at line 179 of file buffer.hpp.
using sycl::_V1::buffer< T, dimensions, AllocatorT, __Enabled >::value_type = T |
Definition at line 178 of file buffer.hpp.
|
inline |
Definition at line 200 of file buffer.hpp.
|
inline |
Definition at line 212 of file buffer.hpp.
|
inline |
Definition at line 225 of file buffer.hpp.
|
inline |
Definition at line 238 of file buffer.hpp.
|
inline |
Definition at line 252 of file buffer.hpp.
|
inline |
Definition at line 267 of file buffer.hpp.
|
inline |
Definition at line 281 of file buffer.hpp.
|
inline |
Definition at line 297 of file buffer.hpp.
|
inline |
Definition at line 313 of file buffer.hpp.
|
inline |
Definition at line 329 of file buffer.hpp.
|
inline |
Definition at line 348 of file buffer.hpp.
|
inline |
Definition at line 380 of file buffer.hpp.
|
inline |
Definition at line 413 of file buffer.hpp.
|
inline |
Definition at line 432 of file buffer.hpp.
|
inline |
Definition at line 436 of file buffer.hpp.
References sycl::_V1::b, sycl::_V1::detail::constructorNotification(), sycl::_V1::buffer< T, dimensions, AllocatorT, __Enabled >::dimensions, sycl::_V1::detail::buffer_plain::impl, sycl::_V1::invalid, sycl::_V1::buffer< T, dimensions, AllocatorT, __Enabled >::isOutOfBounds(), sycl::_V1::make_error_code(), and sycl::_V1::detail::rangeToArray().
|
inline |
Definition at line 457 of file buffer.hpp.
References sycl::_V1::detail::constructorNotification(), sycl::_V1::buffer< T, dimensions, AllocatorT, __Enabled >::dimensions, sycl::_V1::detail::buffer_plain::impl, and sycl::_V1::detail::rangeToArray().
|
inline |
Definition at line 466 of file buffer.hpp.
References sycl::_V1::detail::constructorNotification(), sycl::_V1::buffer< T, dimensions, AllocatorT, __Enabled >::dimensions, sycl::_V1::detail::buffer_plain::impl, and sycl::_V1::detail::rangeToArray().
|
inline |
Definition at line 479 of file buffer.hpp.
References __SYCL_REPORT_EXCEPTION_TO_STREAM.
sycl::_V1::buffer< T, dimensions, AllocatorT, __Enabled >::__SYCL2020_DEPRECATED | ( | "get_access for host_accessor is | deprecated, |
please " "use get_host_access instead" | |||
) |
sycl::_V1::buffer< T, dimensions, AllocatorT, __Enabled >::__SYCL2020_DEPRECATED | ( | "get_access for host_accessor is | deprecated, |
please " "use get_host_access instead" | |||
) |
|
inline |
Definition at line 497 of file buffer.hpp.
References sycl::_V1::buffer< T, dimensions, AllocatorT, __Enabled >::size().
|
inline |
Definition at line 501 of file buffer.hpp.
References sycl::_V1::buffer< T, dimensions, AllocatorT, __Enabled >::byte_size().
|
inlinenoexcept |
Definition at line 504 of file buffer.hpp.
References sycl::_V1::buffer< T, dimensions, AllocatorT, __Enabled >::size().
Referenced by sycl::_V1::buffer< T, dimensions, AllocatorT, __Enabled >::__SYCL2020_DEPRECATED(), and sycl::_V1::buffer< T, dimensions, AllocatorT, __Enabled >::reinterpret().
|
inline |
Definition at line 528 of file buffer.hpp.
References sycl::_V1::buffer< T, dimensions, AllocatorT, __Enabled >::dimensions, sycl::_V1::access::false_t, and sycl::_V1::buffer< T, dimensions, AllocatorT, __Enabled >::mode.
|
inline |
Definition at line 514 of file buffer.hpp.
References sycl::_V1::buffer< T, dimensions, AllocatorT, __Enabled >::dimensions, sycl::_V1::access::false_t, and sycl::_V1::Mode.
Referenced by sycl::_V1::detail::stream_impl::accessGlobalBuf(), and sycl::_V1::detail::stream_impl::accessGlobalFlushBuf().
|
inline |
Definition at line 540 of file buffer.hpp.
|
inline |
Definition at line 580 of file buffer.hpp.
|
inline |
Definition at line 559 of file buffer.hpp.
|
inline |
Definition at line 575 of file buffer.hpp.
|
inline |
Definition at line 506 of file buffer.hpp.
|
inline |
Definition at line 589 of file buffer.hpp.
|
inline |
Definition at line 584 of file buffer.hpp.
|
inline |
Definition at line 707 of file buffer.hpp.
|
inline |
Definition at line 495 of file buffer.hpp.
Referenced by sycl::_V1::buffer< T, dimensions, AllocatorT, __Enabled >::reinterpret().
|
inlinenoexcept |
Definition at line 703 of file buffer.hpp.
|
inline |
Definition at line 654 of file buffer.hpp.
|
inlineprotected |
Definition at line 712 of file buffer.hpp.
References sycl::_V1::buffer< T, dimensions, AllocatorT, __Enabled >::dimensions.
Referenced by sycl::_V1::buffer< T, dimensions, AllocatorT, __Enabled >::buffer().
|
inline |
Definition at line 489 of file buffer.hpp.
|
default |
|
default |
|
inline |
Definition at line 487 of file buffer.hpp.
References sycl::_V1::detail::buffer_plain::impl.
|
inline |
Definition at line 680 of file buffer.hpp.
References sycl::_V1::buffer< T, dimensions, AllocatorT, __Enabled >::get_range(), and sycl::_V1::detail::buffer_plain::impl.
|
inline |
Definition at line 692 of file buffer.hpp.
References sycl::_V1::buffer< T, dimensions, AllocatorT, __Enabled >::byte_size(), sycl::_V1::detail::buffer_plain::impl, sycl::_V1::invalid, and sycl::_V1::make_error_code().
|
inline |
Definition at line 660 of file buffer.hpp.
References sycl::_V1::buffer< T, dimensions, AllocatorT, __Enabled >::byte_size(), sycl::_V1::detail::buffer_plain::impl, sycl::_V1::invalid, sycl::_V1::make_error_code(), and sycl::_V1::range< Dimensions >::size().
|
inline |
Definition at line 594 of file buffer.hpp.
References sycl::_V1::detail::buffer_plain::set_final_data_internal().
|
inline |
Definition at line 648 of file buffer.hpp.
|
inline |
Definition at line 620 of file buffer.hpp.
|
inline |
Definition at line 632 of file buffer.hpp.
References sycl::_V1::ext::oneapi::experimental::copy(), and sycl::_V1::buffer< T, dimensions, AllocatorT, __Enabled >::size().
|
inline |
Definition at line 598 of file buffer.hpp.
|
inline |
Definition at line 610 of file buffer.hpp.
|
inline |
Definition at line 604 of file buffer.hpp.
References sycl::_V1::detail::buffer_plain::set_final_data_internal().
|
inline |
Definition at line 652 of file buffer.hpp.
Referenced by sycl::_V1::detail::stream_impl::stream_impl().
|
inlinenoexcept |
Definition at line 499 of file buffer.hpp.
Referenced by sycl::_V1::buffer< T, dimensions, AllocatorT, __Enabled >::__SYCL2020_DEPRECATED(), sycl::_V1::buffer< T, dimensions, AllocatorT, __Enabled >::byte_size(), sycl::_V1::buffer< T, dimensions, AllocatorT, __Enabled >::set_final_data_internal(), and sycl::_V1::detail::stream_impl::stream_impl().
|
friend |
Definition at line 730 of file buffer.hpp.
|
friend |
Definition at line 727 of file buffer.hpp.
|
friend |
|
friend |
|
friend |
Definition at line 735 of file buffer.hpp.
sycl::_V1::buffer< T, dimensions, AllocatorT, __Enabled >::dimensions |
sycl::_V1::buffer< T, dimensions, AllocatorT, __Enabled >::mode |
Definition at line 526 of file buffer.hpp.
Referenced by sycl::_V1::buffer< T, dimensions, AllocatorT, __Enabled >::get_access().