Wrong return type for sycl::accessor::get_pointer() and sycl::local_accessor::get_pointer().
According to 4.7.6.9.1. Interface for buffer command accessors and 4.7.6.11.1. Interface for local accessorsstd::add_pointer_t<value_type> get_pointer() const noexcept;
But currently get_pointer return type ismulti_ptr<value_type,...> instead of std::add_pointer_t<value_type>.
To reproduce:
#include <sycl.hpp>
int main () {
using AccT = sycl::local_accessor<int, 3>;
sycl::queue queue;
queue.submit([=](sycl::handler& cgh) {
AccT acc{};
auto p = acc.get_pointer();
static_assert(
std::is_same_v<decltype(p), std::add_pointer_t<typename AccT::value_type>>);
});
return 0;
}
To build:clang++ -fsycl wrong_pointer_type_local_sample.cpp -o sample
Output:
wrong_pointer_type_local_sample.cpp:9:5: error: static assertion failed due to requirement 'std::is_same_v<sycl::multi_ptr<int, sycl::access::address_space::local_space, sycl::access::decorated::legacy>, int *>'
static_assert(
^
1 error generated.
Wrong return type for sycl::accessor::get_pointer() and sycl::local_accessor::get_pointer(). According to 4.7.6.9.1. Interface for buffer command accessors and 4.7.6.11.1. Interface for local accessors
std::add_pointer_t<value_type> get_pointer() const noexcept;
But currently get_pointer return type ismulti_ptr<value_type,...>
instead ofstd::add_pointer_t<value_type>
.To reproduce:
To build:
clang++ -fsycl wrong_pointer_type_local_sample.cpp -o sample
Output: