39 #include <type_traits>
46 inline namespace _V1 {
50 template <
int dimensions>
class range;
52 template <
typename DataT>
55 template <
typename DataT,
int Dimensions, access::mode AccessMode>
58 template <
typename T,
int Dimensions,
typename AllocatorT,
typename Enable>
61 namespace ext::oneapi {
69 template <
typename T,
int Dimensions,
typename AllocatorT>
72 bool OwnNativeHandle =
true) {
91 std::unique_ptr<detail::SYCLMemObjAllocator> Allocator);
93 buffer_plain(
void *HostData,
size_t SizeInBytes,
size_t RequiredAlign,
95 std::unique_ptr<detail::SYCLMemObjAllocator> Allocator);
97 buffer_plain(
const void *HostData,
size_t SizeInBytes,
size_t RequiredAlign,
99 std::unique_ptr<detail::SYCLMemObjAllocator> Allocator);
101 buffer_plain(
const std::shared_ptr<const void> &HostData,
102 const size_t SizeInBytes,
size_t RequiredAlign,
104 std::unique_ptr<detail::SYCLMemObjAllocator> Allocator,
110 const size_t SizeInBytes,
size_t RequiredAlign,
112 std::unique_ptr<detail::SYCLMemObjAllocator> Allocator,
116 std::unique_ptr<detail::SYCLMemObjAllocator> Allocator,
117 bool OwnNativeHandle,
event AvailableEvent);
119 buffer_plain(
const std::shared_ptr<detail::buffer_impl> &impl) : impl(impl) {}
121 void set_final_data_internal();
123 void set_final_data_internal(
124 const std::function<
void(
const std::function<
void(
void *
const Ptr)> &)>
127 void set_write_back(
bool NeedWriteBack);
130 void *UserObj,
const void *HostObj,
131 const void *Type, uint32_t Dim,
132 uint32_t ElemType,
size_t Range[3]);
144 void addOrReplaceAccessorProperties(const
property_list &PropertyList);
146 size_t getSize() const;
148 void handleRelease() const;
163 template <typename T,
int dimensions = 1,
166 typename
std::enable_if_t<(dimensions > 0) && (dimensions <= 3)>>
167 class
buffer : public detail::buffer_plain,
168 public detail::OwnerLessBase<
buffer<T, dimensions, AllocatorT>> {
169 static_assert(is_device_copyable_v<T>,
170 "Underlying type of a buffer must be device copyable!");
180 template <
class Container>
182 std::void_t<std::enable_if_t<std::is_convertible_v<
184 decltype(std::declval<Container>().data())> (*)[],
186 decltype(std::declval<Container>().size())>;
189 typename std::iterator_traits<It>::iterator_category,
190 std::input_iterator_tag>>;
191 template <
typename ItA,
typename ItB>
193 std::is_same_v<ItA, ItB> && !std::is_const_v<ItA>, ItA>;
198 : buffer_plain(bufferRange.
size() *
sizeof(T),
alignof(T), propList,
203 CodeLoc, (
void *)impl.get(),
nullptr, (
const void *)
typeid(T).name(),
211 bufferRange.
size() *
sizeof(T),
alignof(T), propList,
212 std::make_unique<detail::SYCLMemObjAllocatorHolder<AllocatorT, T>>(
216 CodeLoc, (
void *)impl.get(),
nullptr, (
const void *)
typeid(T).name(),
223 : buffer_plain(hostData, bufferRange.
size() *
sizeof(T),
alignof(T),
229 CodeLoc, (
void *)impl.get(), hostData, (
const void *)
typeid(T).name(),
237 hostData, bufferRange.
size() *
sizeof(T),
alignof(T), propList,
238 std::make_unique<detail::SYCLMemObjAllocatorHolder<AllocatorT, T>>(
242 CodeLoc, (
void *)impl.get(), hostData, (
const void *)
typeid(T).name(),
246 template <
typename _T = T>
251 : buffer_plain(hostData, bufferRange.
size() *
sizeof(T),
alignof(T),
257 CodeLoc, (
void *)impl.get(), hostData, (
const void *)
typeid(T).name(),
261 template <
typename _T = T>
267 hostData, bufferRange.
size() *
sizeof(T),
alignof(T), propList,
268 std::make_unique<detail::SYCLMemObjAllocatorHolder<AllocatorT, T>>(
272 CodeLoc, (
void *)impl.get(), hostData, (
const void *)
typeid(T).name(),
276 buffer(
const std::shared_ptr<T> &hostData,
281 hostData, bufferRange.
size() *
sizeof(T),
alignof(T), propList,
282 std::make_unique<detail::SYCLMemObjAllocatorHolder<AllocatorT, T>>(
284 std::is_const<T>::value),
287 CodeLoc, (
void *)impl.get(), (
void *)hostData.get(),
288 (
const void *)
typeid(T).name(), dimensions,
sizeof(T),
292 buffer(
const std::shared_ptr<T[]> &hostData,
297 hostData, bufferRange.
size() *
sizeof(T),
alignof(T), propList,
298 std::make_unique<detail::SYCLMemObjAllocatorHolder<AllocatorT, T>>(
300 std::is_const<T>::value),
303 CodeLoc, (
void *)impl.get(), (
void *)hostData.get(),
304 (
const void *)
typeid(T).name(), dimensions,
sizeof(T),
308 buffer(
const std::shared_ptr<T> &hostData,
312 : buffer_plain(hostData, bufferRange.
size() *
sizeof(T),
alignof(T),
316 std::is_const<T>::value),
319 CodeLoc, (
void *)impl.get(), (
void *)hostData.get(),
320 (
const void *)
typeid(T).name(), dimensions,
sizeof(T),
324 buffer(
const std::shared_ptr<T[]> &hostData,
328 : buffer_plain(hostData, bufferRange.
size() *
sizeof(T),
alignof(T),
332 std::is_const<T>::value),
335 CodeLoc, (
void *)impl.get(), (
void *)hostData.get(),
336 (
const void *)
typeid(T).name(), dimensions,
sizeof(T),
340 template <
class InputIterator,
int N = dimensions,
341 typename = EnableIfOneDimension<N>,
342 typename = EnableIfItInputIterator<InputIterator>>
343 buffer(InputIterator first, InputIterator last, AllocatorT allocator,
348 [first, last](
void *ToPtr) {
352 using IteratorValueType =
354 using IteratorNonConstValueType =
355 std::remove_const_t<IteratorValueType>;
356 using IteratorPointerToNonConstValueType =
357 std::add_pointer_t<IteratorNonConstValueType>;
359 static_cast<IteratorPointerToNonConstValueType
>(ToPtr));
361 std::distance(first, last) *
sizeof(T),
alignof(T), propList,
362 std::make_unique<detail::SYCLMemObjAllocatorHolder<AllocatorT, T>>(
364 detail::iterator_to_const_type_t<InputIterator>::value),
365 Range(
range<1>(std::distance(first, last))) {
366 size_t r[3] = {Range[0], 0, 0};
368 (
const void *)
typeid(T).name(),
369 dimensions,
sizeof(T), r);
372 template <
class InputIterator,
int N = dimensions,
373 typename = EnableIfOneDimension<N>,
374 typename = EnableIfItInputIterator<InputIterator>>
375 buffer(InputIterator first, InputIterator last,
380 [first, last](
void *ToPtr) {
384 using IteratorValueType =
386 using IteratorNonConstValueType =
387 std::remove_const_t<IteratorValueType>;
388 using IteratorPointerToNonConstValueType =
389 std::add_pointer_t<IteratorNonConstValueType>;
391 static_cast<IteratorPointerToNonConstValueType
>(ToPtr));
393 std::distance(first, last) *
sizeof(T),
alignof(T), propList,
395 detail::SYCLMemObjAllocatorHolder<AllocatorT, T>>(),
396 detail::iterator_to_const_type_t<InputIterator>::value),
397 Range(
range<1>(std::distance(first, last))) {
398 size_t r[3] = {Range[0], 0, 0};
400 (
const void *)
typeid(T).name(),
401 dimensions,
sizeof(T), r);
405 template <
class Container,
int N = dimensions,
406 typename = EnableIfOneDimension<N>,
407 typename = EnableIfContiguous<Container>>
408 buffer(Container &container, AllocatorT allocator,
412 container.data(), container.size() *
sizeof(T),
alignof(T),
414 std::make_unique<detail::SYCLMemObjAllocatorHolder<AllocatorT, T>>(
417 size_t r[3] = {Range[0], 0, 0};
419 CodeLoc, (
void *)impl.get(), container.data(),
420 (
const void *)
typeid(T).name(), dimensions,
sizeof(T), r);
424 template <
class Container,
int N = dimensions,
425 typename = EnableIfOneDimension<N>,
426 typename = EnableIfContiguous<Container>>
429 :
buffer(container, {}, propList, CodeLoc) {}
434 : buffer_plain(
b.impl), Range(subRange),
435 OffsetInBytes(getOffsetInBytes<T>(baseIndex,
b.Range)),
438 CodeLoc, (
void *)impl.get(), impl.get(), (
const void *)
typeid(T).name(),
441 if (
b.is_sub_buffer())
442 throw sycl::invalid_object_error(
443 "Cannot create sub buffer from sub buffer.", PI_ERROR_INVALID_VALUE);
444 if (isOutOfBounds(baseIndex, subRange,
b.Range))
445 throw sycl::invalid_object_error(
446 "Requested sub-buffer size exceeds the size of the parent buffer",
447 PI_ERROR_INVALID_VALUE);
448 if (!isContiguousRegion(baseIndex, subRange,
b.Range))
449 throw sycl::invalid_object_error(
450 "Requested sub-buffer region is not contiguous",
451 PI_ERROR_INVALID_VALUE);
456 : buffer_plain(rhs.impl), Range(rhs.Range),
457 OffsetInBytes(rhs.OffsetInBytes), IsSubBuffer(rhs.IsSubBuffer) {
459 CodeLoc, (
void *)impl.get(), impl.get(), (
const void *)
typeid(T).name(),
465 : buffer_plain(
std::move(rhs.impl)), Range(rhs.Range),
466 OffsetInBytes(rhs.OffsetInBytes), IsSubBuffer(rhs.IsSubBuffer) {
468 CodeLoc, (
void *)impl.get(), impl.get(), (
const void *)
typeid(T).name(),
489 size_t get_count()
const {
return size(); }
493 "get_size() is deprecated, please use byte_size() instead")
494 size_t get_size()
const {
return byte_size(); }
499 ->template getAllocator<AllocatorT>();
502 template <access::mode Mode, access::target Target = access::target::device>
510 *
this, CommandGroupHandler, {}, CodeLoc);
513 template <access::mode mode>
515 "use get_host_access instead")
520 accessor_property_list<>> get_access(const detail::code_location
522 detail::code_location::
524 return accessor<T, dimensions,
mode, access::target::host_buffer,
529 template <access::mode mode, access::target target = access::target::device>
536 if (isOutOfBounds(accessOffset, accessRange, this->Range))
537 throw sycl::invalid_object_error(
538 "Requested accessor would exceed the bounds of the buffer",
539 PI_ERROR_INVALID_VALUE);
543 *
this, commandGroupHandler, accessRange, accessOffset, {}, CodeLoc);
546 template <access::mode mode>
548 "use get_host_access instead")
550 T, dimensions,
mode, access::
target::host_buffer,
553 accessor_property_list<>> get_access(
range<dimensions> accessRange,
554 id<dimensions> accessOffset = {},
559 if (isOutOfBounds(accessOffset, accessRange, this->Range))
560 throw sycl::invalid_object_error(
561 "Requested accessor would exceed the bounds of the buffer",
562 PI_ERROR_INVALID_VALUE);
564 return accessor<T, dimensions,
mode, access::target::host_buffer,
567 *
this, accessRange, accessOffset, {}, CodeLoc);
570 template <
typename... Ts>
auto get_access(Ts... args) {
574 template <
typename... Ts>
575 auto get_access(
handler &commandGroupHandler, Ts... args) {
576 return accessor{*
this, commandGroupHandler, args...};
579 template <
typename... Ts>
auto get_host_access(Ts... args) {
583 template <
typename... Ts>
584 auto get_host_access(
handler &commandGroupHandler, Ts... args) {
588 template <
typename Destination = std::
nullptr_t>
589 void set_final_data(Destination finalData =
nullptr) {
590 this->set_final_data_internal(finalData);
593 void set_final_data_internal(std::nullptr_t) {
597 template <
template <
typename WeakT>
class WeakPtrT,
typename WeakT>
598 std::enable_if_t<std::is_convertible_v<WeakPtrT<WeakT>, std::weak_ptr<WeakT>>>
599 set_final_data_internal(WeakPtrT<WeakT> FinalData) {
600 std::weak_ptr<WeakT> TempFinalData(FinalData);
601 this->set_final_data_internal(TempFinalData);
604 template <
typename WeakT>
605 void set_final_data_internal(std::weak_ptr<WeakT> FinalData) {
607 [FinalData](
const std::function<
void(
void *
const Ptr)> &F) {
608 if (std::shared_ptr<WeakT> LockedFinalData = FinalData.lock())
609 F(LockedFinalData.get());
613 template <
typename Destination>
615 set_final_data_internal(Destination FinalData) {
620 [FinalData](
const std::function<
void(
void *
const Ptr)> &F) {
625 template <
typename Destination>
627 set_final_data_internal(Destination FinalData) {
628 const size_t Size = size();
630 [FinalData, Size](
const std::function<
void(
void *
const Ptr)> &F) {
635 std::unique_ptr<DestinationValueT[]> ContiguousStorage(
636 new DestinationValueT[Size]);
637 F(ContiguousStorage.get());
638 std::copy(ContiguousStorage.get(), ContiguousStorage.get() + Size,
643 void set_final_data(std::nullptr_t) {
649 bool is_sub_buffer()
const {
return IsSubBuffer; }
651 template <
typename Re
interpretT,
int Re
interpretDim>
652 buffer<ReinterpretT, ReinterpretDim,
653 typename std::allocator_traits<AllocatorT>::template rebind_alloc<
654 std::remove_const_t<ReinterpretT>>>
656 if (
sizeof(ReinterpretT) * reinterpretRange.
size() != byte_size())
657 throw sycl::invalid_object_error(
658 "Total size in bytes represented by the type and range of the "
659 "reinterpreted SYCL buffer does not equal the total size in bytes "
660 "represented by the type and range of this SYCL buffer",
661 PI_ERROR_INVALID_VALUE);
663 return buffer<ReinterpretT, ReinterpretDim,
664 typename std::allocator_traits<AllocatorT>::
665 template rebind_alloc<std::remove_const_t<ReinterpretT>>>(
666 impl, reinterpretRange, OffsetInBytes, IsSubBuffer);
669 template <
typename Re
interpretT,
int Re
interpretDim = dimensions>
671 (
sizeof(ReinterpretT) ==
sizeof(T)) && (dimensions == ReinterpretDim),
672 buffer<ReinterpretT, ReinterpretDim,
673 typename std::allocator_traits<AllocatorT>::template rebind_alloc<
674 std::remove_const_t<ReinterpretT>>>>
675 reinterpret()
const {
676 return buffer<ReinterpretT, ReinterpretDim,
677 typename std::allocator_traits<AllocatorT>::
678 template rebind_alloc<std::remove_const_t<ReinterpretT>>>(
679 impl, get_range(), OffsetInBytes, IsSubBuffer);
682 template <
typename Re
interpretT,
int Re
interpretDim = dimensions>
683 std::enable_if_t<(ReinterpretDim == 1) &&
684 ((dimensions != ReinterpretDim) ||
685 (
sizeof(ReinterpretT) !=
sizeof(T))),
687 reinterpret()
const {
688 long sz = byte_size();
689 if (sz %
sizeof(ReinterpretT) != 0)
690 throw sycl::invalid_object_error(
691 "Total byte size of buffer is not evenly divisible by the size of "
692 "the reinterpreted type",
693 PI_ERROR_INVALID_VALUE);
696 impl,
range<1>{sz /
sizeof(ReinterpretT)}, OffsetInBytes, IsSubBuffer);
700 return buffer_plain::template has_property<propertyT>();
703 template <
typename propertyT> propertyT
get_property()
const {
704 return buffer_plain::template get_property<propertyT>();
711 bool outOfBounds =
false;
712 for (
int i = 0; i < dimensions; ++i)
713 outOfBounds |= newRange[i] + offset[i] > parentRange[i];
721 template <
typename A,
int dims,
typename C,
typename Enable>
726 template <
typename HT,
int HDims,
typename HAllocT>
737 size_t OffsetInBytes = 0;
738 bool IsSubBuffer =
false;
741 template <
int N = dimensions,
typename = EnableIfOneDimension<N>>
743 bool OwnNativeHandle,
event AvailableEvent = {},
745 : buffer_plain(MemObject, SyclContext,
748 OwnNativeHandle, std::move(AvailableEvent)),
753 CodeLoc, (
void *)impl.get(), &MemObject, (
const void *)
typeid(T).name(),
757 void addOrReplaceAccessorProperties(
const property_list &PropertyList) {
766 buffer(
const std::shared_ptr<detail::buffer_impl> &Impl,
767 range<dimensions> reinterpretRange,
size_t reinterpretOffset,
770 : buffer_plain(Impl), Range(reinterpretRange),
771 OffsetInBytes(reinterpretOffset), IsSubBuffer(isSubBuffer) {
773 CodeLoc, (
void *)impl.get(), Impl.get(), (
const void *)
typeid(T).name(),
777 template <
typename Type,
int N>
778 size_t getOffsetInBytes(
const id<N> &offset,
const range<N> &range) {
782 bool isContiguousRegion(
const id<1> &,
const range<1> &,
const range<1> &) {
787 bool isContiguousRegion(
const id<2> &offset,
const range<2> &newRange,
788 const range<2> &parentRange) {
796 return newRange[0] == 1;
797 return newRange[1] == parentRange[1];
800 bool isContiguousRegion(
const id<3> &offset,
const range<3> &newRange,
801 const range<3> &parentRange) {
811 return newRange[0] == 1 && newRange[1] == 1;
813 return newRange[0] == 1 && newRange[2] == parentRange[2];
814 return newRange[1] == parentRange[1] && newRange[2] == parentRange[2];
824 template <backend BackendName>
829 AllocatorT>::GetNativeObjs(NativeHandles);
833 #ifdef __cpp_deduction_guides
834 template <
class InputIterator,
class AllocatorT>
838 template <
class InputIterator>
839 buffer(InputIterator, InputIterator,
const property_list & = {})
841 template <
class Container,
class AllocatorT>
842 buffer(Container &, AllocatorT,
const property_list & = {})
843 -> buffer<typename Container::value_type, 1, AllocatorT>;
844 template <
class Container>
846 const property_list & = {}) -> buffer<typename Container::value_type, 1>;
847 template <
class T,
int dimensions,
class AllocatorT>
848 buffer(
const T *,
const range<dimensions> &, AllocatorT,
849 const property_list & = {}) -> buffer<T, dimensions, AllocatorT>;
850 template <
class T,
int dimensions>
851 buffer(
const T *,
const range<dimensions> &,
852 const property_list & = {}) -> buffer<T, dimensions>;
859 template <
typename T,
int dimensions,
typename AllocatorT>
860 struct hash<
sycl::buffer<T, dimensions, AllocatorT>> {
862 return hash<std::shared_ptr<sycl::detail::buffer_impl>>()(
Defines a shared array that can be used by kernels in queues.
buffer & operator=(const buffer &rhs)=default
AllocatorT get_allocator() const
__SYCL2020_DEPRECATED("get_size() is deprecated, please use byte_size() instead") size_t get_size() const
buffer(buffer &&rhs, const detail::code_location CodeLoc=detail::code_location::current())
buffer(InputIterator first, InputIterator last, const property_list &propList={}, const detail::code_location CodeLoc=detail::code_location::current())
__SYCL2020_DEPRECATED("get_access for host_accessor is deprecated, please " "use get_host_access instead") accessor< T
buffer(const buffer &rhs, const detail::code_location CodeLoc=detail::code_location::current())
buffer(InputIterator first, InputIterator last, AllocatorT allocator, const property_list &propList={}, const detail::code_location CodeLoc=detail::code_location::current())
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(T *hostData, const range< dimensions > &bufferRange, const property_list &propList={}, const detail::code_location CodeLoc=detail::code_location::current())
buffer(const range< dimensions > &bufferRange, const property_list &propList={}, const detail::code_location CodeLoc=detail::code_location::current())
size_t byte_size() const noexcept
buffer(Container &container, 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())
bool operator!=(const buffer &rhs) const
buffer(buffer< T, dimensions, AllocatorT > &b, const id< dimensions > &baseIndex, const range< dimensions > &subRange, const detail::code_location CodeLoc=detail::code_location::current())
size_t size() const noexcept
std::enable_if_t< std::is_convertible_v< typename std::iterator_traits< It >::iterator_category, std::input_iterator_tag > > EnableIfItInputIterator
buffer(const std::shared_ptr< T > &hostData, const range< dimensions > &bufferRange, const property_list &propList={}, const detail::code_location CodeLoc=detail::code_location::current())
std::void_t< std::enable_if_t< std::is_convertible_v< detail::remove_pointer_t< decltype(std::declval< Container >().data())>(*)[], const T(*)[]> >, decltype(std::declval< Container >().size())> EnableIfContiguous
buffer(const range< dimensions > &bufferRange, AllocatorT allocator, const property_list &propList={}, const detail::code_location CodeLoc=detail::code_location::current())
bool operator==(const buffer &rhs) const
const value_type & const_reference
range< dimensions > get_range() const
buffer(T *hostData, const range< dimensions > &bufferRange, AllocatorT allocator, const property_list &propList={}, const detail::code_location CodeLoc=detail::code_location::current())
buffer & operator=(buffer &&rhs)=default
buffer(Container &container, AllocatorT allocator, const property_list &propList={}, const detail::code_location CodeLoc=detail::code_location::current())
buffer(EnableIfSameNonConstIterators< T, _T > const *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, AllocatorT allocator, const property_list &propList={}, const detail::code_location CodeLoc=detail::code_location::current())
__SYCL2020_DEPRECATED("get_count() is deprecated, please use size() instead") size_t get_count() const
typename std::enable_if_t< std::is_same_v< ItA, ItB > &&!std::is_const_v< ItA >, ItA > EnableIfSameNonConstIterators
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())
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())
typename std::enable_if_t< 1==dims > EnableIfOneDimension
AllocatorT allocator_type
The context class represents a SYCL context on which kernel functions may be executed.
void deleteAccProps(const sycl::detail::PropWithDataKind &Kind)
void set_final_data_internal()
std::vector< pi_native_handle > getNativeVector(backend BackendName) const
bool has_property() const noexcept
std::shared_ptr< detail::buffer_impl > impl
buffer_plain(const std::shared_ptr< detail::buffer_impl > &impl)
void handleRelease() const
buffer_plain(void *HostData, size_t SizeInBytes, size_t RequiredAlign, const property_list &Props, std::unique_ptr< detail::SYCLMemObjAllocator > Allocator)
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])
const std::unique_ptr< SYCLMemObjAllocator > & get_allocator_internal() const
void set_write_back(bool NeedWriteBack)
void addOrReplaceAccessorProperties(const property_list &PropertyList)
An event object can be used to synchronize memory transfers, enqueues of kernels and signaling barrie...
Command group handler class.
A unique identifier of an item in an index space.
Objects of the property_list class are containers for the SYCL properties.
Defines the iteration domain of either a single work-group in a parallel dispatch,...
std::enable_if_t< std::is_pointer_v< DataT > > EnableIfOutputPointerT
size_t getLinearIndex(const T< Dims > &Index, const U< Dims > &Range)
typename std::iterator_traits< T >::value_type iterator_value_type_t
typename remove_pointer< T >::type remove_pointer_t
std::array< size_t, 3 > rangeToArray(const range< 3 > &r)
auto get_native_buffer(const buffer< DataT, Dimensions, Allocator, void > &Obj) -> backend_return_t< BackendName, buffer< DataT, Dimensions, Allocator, void >>
decltype(Obj::impl) getSyclObjImpl(const Obj &SyclObject)
void constructorNotification(void *BufferObj, void *AccessorObj, access::target Target, access::mode Mode, const code_location &CodeLoc)
std::enable_if_t< !std::is_pointer_v< DataT > > EnableIfOutputIteratorT
struct __SYCL2020_DEPRECATED("This type isn't device copyable in SYCL 2020") IsDeprecatedDeviceCopyable< T
buffer< T, Dimensions, AllocatorT, void > make_buffer_helper(pi_native_handle Handle, const context &Ctx, event Evt={}, bool OwnNativeHandle=true)
void copy(handler &CGH, const T *Src, T *Dest, size_t Count)
static constexpr bool has_property()
static constexpr auto get_property()
class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(local_accessor) local_accessor class __SYCL_EBO __SYCL_SPECIAL_CLASS Dimensions
detail::sycl_memory_object_allocator< DataT > buffer_allocator
typename backend_traits< Backend >::template return_type< SyclType > backend_return_t
uintptr_t pi_native_handle
_Abi const simd< _Tp, _Abi > & noexcept
size_t operator()(const sycl::buffer< T, dimensions, AllocatorT > &b) const
static constexpr code_location current(const char *fileName=__CODELOC_FILE_NAME, const char *funcName=__CODELOC_FUNCTION, unsigned long lineNo=__CODELOC_LINE, unsigned long columnNo=__CODELOC_COLUMN) noexcept