diff --git a/sycl/include/CL/sycl/image.hpp b/sycl/include/CL/sycl/image.hpp index cf47c5d093778..91c1fd840a304 100644 --- a/sycl/include/CL/sycl/image.hpp +++ b/sycl/include/CL/sycl/image.hpp @@ -155,7 +155,7 @@ class image { template 1)> image(void *HostPointer, image_channel_order Order, image_channel_type Type, const range &Range, - typename std::enable_if>::type &Pitch, + const typename std::enable_if>::type &Pitch, const property_list &PropList = {}) { impl = std::make_shared>( HostPointer, Order, Type, Range, Pitch, @@ -167,7 +167,7 @@ class image { template 1)> image(void *HostPointer, image_channel_order Order, image_channel_type Type, const range &Range, - typename std::enable_if>::type &Pitch, + const typename std::enable_if>::type &Pitch, AllocatorT Allocator, const property_list &PropList = {}) { impl = std::make_shared>( HostPointer, Order, Type, Range, Pitch, diff --git a/sycl/test/basic_tests/image.cpp b/sycl/test/basic_tests/image.cpp index 8b9b93ac360f3..7497821315d4a 100644 --- a/sycl/test/basic_tests/image.cpp +++ b/sycl/test/basic_tests/image.cpp @@ -76,6 +76,17 @@ int main() { }); } + { + const sycl::range<1> ImgPitch(4 * 4 * 4 * 2); + sycl::image<2> Img(Img1HostData.data(), ChanOrder, ChanType, Img1Size, + ImgPitch); + TestQueue Q{sycl::default_selector()}; + Q.submit([&](sycl::handler &CGH) { + auto ImgAcc = Img.get_access(CGH); + CGH.single_task([=] { ImgAcc.get_range(); }); + }); + } + // image with write accessor to it in kernel { int NX = 32;