Skip to content

[SYCL] Align image class constructors with the SYCL spec #2603

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 8, 2020
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