Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions sycl/include/CL/sycl/image.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ class image {
template <bool B = (Dimensions > 1)>
image(void *HostPointer, image_channel_order Order, image_channel_type Type,
const range<Dimensions> &Range,
typename std::enable_if<B, range<Dimensions - 1>>::type &Pitch,
const typename std::enable_if<B, range<Dimensions - 1>>::type &Pitch,
const property_list &PropList = {}) {
impl = std::make_shared<detail::image_impl<Dimensions>>(
HostPointer, Order, Type, Range, Pitch,
Expand All @@ -167,7 +167,7 @@ class image {
template <bool B = (Dimensions > 1)>
image(void *HostPointer, image_channel_order Order, image_channel_type Type,
const range<Dimensions> &Range,
typename std::enable_if<B, range<Dimensions - 1>>::type &Pitch,
const typename std::enable_if<B, range<Dimensions - 1>>::type &Pitch,
AllocatorT Allocator, const property_list &PropList = {}) {
impl = std::make_shared<detail::image_impl<Dimensions>>(
HostPointer, Order, Type, Range, Pitch,
Expand Down
11 changes: 11 additions & 0 deletions sycl/test/basic_tests/image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<sycl::float4, SYCLRead>(CGH);
CGH.single_task<class ConstTestPitch>([=] { ImgAcc.get_range(); });
});
}

// image with write accessor to it in kernel
{
int NX = 32;
Expand Down