diff --git a/clang/runtime/dpct-rt/include/dpct/memory.hpp b/clang/runtime/dpct-rt/include/dpct/memory.hpp index b9eb12fd6777..96dc9f51d2f8 100644 --- a/clang/runtime/dpct-rt/include/dpct/memory.hpp +++ b/clang/runtime/dpct-rt/include/dpct/memory.hpp @@ -265,7 +265,7 @@ template class memory_traits { using accessor_t = typename std::conditional< Memory == local, sycl::local_accessor, sycl::accessor>::type; - using pointer_t = T *; + using pointer_t = element_t *; }; static inline void *dpct_malloc(size_t size, sycl::queue &q) { @@ -1457,10 +1457,9 @@ template class accessor { accessor(typename std::enable_if::type &acc) : accessor(acc, acc.get_range()) {} accessor(const accessor_t &acc, const sycl::range<2> &in_range) - : accessor(const_cast( - acc.template get_multi_ptr() - .get()), - in_range) {} + : accessor( + acc.template get_multi_ptr().get(), + in_range) {} pointer_t operator[](size_t index) const { return _data + _range.get(1) * index;