11 inline namespace _V1 {
15 size_t SizeInBytes,
size_t RequiredAlign,
const property_list &Props,
16 std::unique_ptr<detail::SYCLMemObjAllocator> Allocator) {
18 impl = std::make_shared<detail::buffer_impl>(SizeInBytes, RequiredAlign,
19 Props, std::move(Allocator));
23 void *HostData,
size_t SizeInBytes,
size_t RequiredAlign,
25 std::unique_ptr<sycl::detail::SYCLMemObjAllocator> Allocator) {
26 impl = std::make_shared<detail::buffer_impl>(
27 HostData, SizeInBytes, RequiredAlign, Props, std::move(Allocator));
31 const void *HostData,
size_t SizeInBytes,
size_t RequiredAlign,
33 std::unique_ptr<detail::SYCLMemObjAllocator> Allocator) {
34 impl = std::make_shared<detail::buffer_impl>(
35 HostData, SizeInBytes, RequiredAlign, Props, std::move(Allocator));
39 const std::shared_ptr<const void> &HostData,
const size_t SizeInBytes,
41 std::unique_ptr<detail::SYCLMemObjAllocator> Allocator,
bool IsConstPtr) {
42 impl = std::make_shared<detail::buffer_impl>(
43 HostData, SizeInBytes, RequiredAlign, Props, std::move(Allocator),
48 const std::function<
void(
void *)> &CopyFromInput,
const size_t SizeInBytes,
50 std::unique_ptr<detail::SYCLMemObjAllocator> Allocator,
bool IsConstPtr) {
51 impl = std::make_shared<detail::buffer_impl>(
52 CopyFromInput, SizeInBytes, RequiredAlign, Props, std::move(Allocator),
58 std::unique_ptr<detail::SYCLMemObjAllocator> Allocator,
59 bool OwnNativeHandle,
event AvailableEvent) {
60 impl = std::make_shared<detail::buffer_impl>(
61 MemObject, std::move(SyclContext), std::move(Allocator), OwnNativeHandle,
62 std::move(AvailableEvent));
68 const std::function<
void(
const std::function<
void(
void *
const Ptr)> &)>
70 impl->set_final_data(FinalDataFunc);
74 void *UserObj,
const void *HostObj,
75 const void *Type, uint32_t Dim,
76 uint32_t ElemType,
size_t Range[3]) {
77 impl->constructorNotification(CodeLoc, UserObj, HostObj, Type, Dim, ElemType,
82 impl->set_write_back(NeedWriteBack);
85 #define __SYCL_PARAM_TRAITS_SPEC(param_type) \
87 __SYCL_EXPORT bool buffer_plain::has_property<param_type>() const noexcept { \
88 return impl->has_property<param_type>(); \
90 #include <sycl/detail/properties_traits.def>
92 #undef __SYCL_PARAM_TRAITS_SPEC
94 #define __SYCL_PARAM_TRAITS_SPEC(param_type) \
96 __SYCL_EXPORT param_type buffer_plain::get_property<param_type>() const { \
97 return impl->get_property<param_type>(); \
99 #include <sycl/detail/properties_traits.def>
101 #undef __SYCL_PARAM_TRAITS_SPEC
103 std::vector<pi_native_handle>
105 return impl->getNativeVector(BackendName);
108 const std::unique_ptr<SYCLMemObjAllocator> &
110 return impl->get_allocator_internal();
114 impl->deleteAccessorProperty(Kind);
119 impl->addOrReplaceAccessorProperties(PropertyList);
127 if (
impl.use_count() == 1)
The context class represents a SYCL context on which kernel functions may be executed.
buffer_plain(size_t SizeInBytes, size_t, const property_list &Props, std::unique_ptr< detail::SYCLMemObjAllocator > Allocator)
void deleteAccProps(const sycl::detail::PropWithDataKind &Kind)
void set_final_data_internal()
std::vector< pi_native_handle > getNativeVector(backend BackendName) const
std::shared_ptr< detail::buffer_impl > impl
void handleRelease() const
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...
Objects of the property_list class are containers for the SYCL properties.
uintptr_t pi_native_handle