Skip to content

Commit 10cacd7

Browse files
committed
Harmonise new code w/ existing
1 parent de6de4e commit 10cacd7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

sycl/include/syclcompat/memory.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1587,7 +1587,8 @@ template <class T, memory_region Memory, size_t Dimension> class device_memory {
15871587
typename std::enable_if<Dim == 1, T>::type &operator[](size_t index) {
15881588
init();
15891589
#ifdef COMPAT_USM_LEVEL_NONE
1590-
return syclcompat::get_buffer<typename std::enable_if<D == 1, T>::type>(ptr)
1590+
return syclcompat::get_buffer<typename std::enable_if<Dim == 1, T>::type>(
1591+
_device_ptr)
15911592
.template get_access<sycl::access_mode::read_write>()[index];
15921593
#else
15931594
return _device_ptr[index];
@@ -1597,7 +1598,7 @@ template <class T, memory_region Memory, size_t Dimension> class device_memory {
15971598
#ifdef COMPAT_USM_LEVEL_NONE
15981599
/// Get sycl::accessor for the device memory object when usm is not used.
15991600
accessor_t get_access(sycl::handler &cgh) {
1600-
return get_buffer(_device_ptrs.front())
1601+
return get_buffer(_device_ptr)
16011602
.template reinterpret<T, Dimension>(_range)
16021603
.template get_access<detail::memory_traits<Memory, T>::mode,
16031604
detail::memory_traits<Memory, T>::target>(cgh);

0 commit comments

Comments
 (0)