Skip to content

Commit 51144f8

Browse files
[SYCL] Fix missed hostData in buffer constructor (#8173)
Signed-off-by: Tikhomirova, Kseniya <[email protected]>
1 parent 744bd72 commit 51144f8

File tree

1 file changed

+19
-10
lines changed

1 file changed

+19
-10
lines changed

sycl/include/sycl/buffer.hpp

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ class buffer : public detail::buffer_plain,
253253
const property_list &propList = {},
254254
const detail::code_location CodeLoc = detail::code_location::current())
255255
: buffer_plain(
256-
bufferRange.size() * sizeof(T),
256+
hostData, bufferRange.size() * sizeof(T),
257257
detail::getNextPowerOfTwo(sizeof(T)), propList,
258258
make_unique_ptr<detail::SYCLMemObjAllocatorHolder<AllocatorT, T>>(
259259
allocator)),
@@ -506,10 +506,14 @@ class buffer : public detail::buffer_plain,
506506
template <access::mode mode>
507507
__SYCL2020_DEPRECATED("get_access for host_accessor is deprecated, please "
508508
"use get_host_access instead")
509-
accessor<T, dimensions, mode, access::target::host_buffer,
510-
access::placeholder::false_t, ext::oneapi::accessor_property_list<>>
511-
get_access(
512-
const detail::code_location CodeLoc = detail::code_location::current()) {
509+
accessor<
510+
T, dimensions, mode, access::target::host_buffer,
511+
access::placeholder::false_t,
512+
ext::oneapi::
513+
accessor_property_list<>> get_access(const detail::code_location
514+
CodeLoc =
515+
detail::code_location::
516+
current()) {
513517
return accessor<T, dimensions, mode, access::target::host_buffer,
514518
access::placeholder::false_t,
515519
ext::oneapi::accessor_property_list<>>(*this, {}, CodeLoc);
@@ -535,11 +539,16 @@ class buffer : public detail::buffer_plain,
535539
template <access::mode mode>
536540
__SYCL2020_DEPRECATED("get_access for host_accessor is deprecated, please "
537541
"use get_host_access instead")
538-
accessor<T, dimensions, mode, access::target::host_buffer,
539-
access::placeholder::false_t, ext::oneapi::accessor_property_list<>>
540-
get_access(
541-
range<dimensions> accessRange, id<dimensions> accessOffset = {},
542-
const detail::code_location CodeLoc = detail::code_location::current()) {
542+
accessor<
543+
T, dimensions, mode, access::target::host_buffer,
544+
access::placeholder::false_t,
545+
ext::oneapi::
546+
accessor_property_list<>> get_access(range<dimensions> accessRange,
547+
id<dimensions> accessOffset = {},
548+
const detail::code_location
549+
CodeLoc =
550+
detail::code_location::
551+
current()) {
543552
if (isOutOfBounds(accessOffset, accessRange, this->Range))
544553
throw sycl::invalid_object_error(
545554
"Requested accessor would exceed the bounds of the buffer",

0 commit comments

Comments
 (0)