-
Notifications
You must be signed in to change notification settings - Fork 744
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
[SYCL][Bindless][Exp] Add Support For Unsampled Image Arrays #12464
[SYCL][Bindless][Exp] Add Support For Unsampled Image Arrays #12464
Conversation
- Creation / destruction of unsampled image arrays - Reading / writing of unsampled image arrays - sycl::ext::oneapi::experimental::image_type::array enum value added - sycl::ext::oneapi::experimental::image_descriptor::array_size member added - sycl::ext::oneapi::experimental::image_descriptor::verify() member function added
sycl/test-e2e/bindless_images/array/read_write_unsampled_array.cpp
Outdated
Show resolved
Hide resolved
- Use bindless_helpers funcs for vulkan interop testing - Rename fill_rand func to conform to snake case - Use new assertion on unsampled coords in read_image_array - Declare and use syclexp namespace in image array test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've only gone through libclc changes.
* Remove cast reshuffling * Wrap image array read/write intrinsics in macros
ee82ed8
to
855efbd
Compare
855efbd
to
e782d6b
Compare
|
||
#ifdef __SYCL_DEVICE_ONLY__ | ||
#if defined(__NVPTX__) | ||
__invoke__ImageArrayWrite((uint64_t)imageHandle.raw_handle, coords, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use more C++'ish cast here? I'd expect it to be sycl::bit_cast
or static_cast
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep. Done.
"Standard images cannot have num_levels greater than 1! Use " | ||
"image_type::mipmap for mipmap images."); | ||
} | ||
} else if (this->type == image_type::array) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
} else if (this->type == image_type::array) { | |
return; | |
} | |
if (this->type == image_type::array) { |
same below. That way the reader would know immediately that there are no other checks after the "cascade" of "if"s. Or maybe even change to the switch(this->type)
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point- changed to switch statement with returns.
set(UNIFIED_RUNTIME_REPO "https://github.com/isaacault/unified-runtime.git") | ||
# commit f6ab4ed9846a472d8cb173c12fb9affae21c0fd0 | ||
# Author: Isaac Ault <[email protected]> | ||
# Date: Tue Jan 23 12:34:08 2024 +0000 | ||
# | ||
# [Bindless][Exp] Add Support For Image Arrays | ||
set(UNIFIED_RUNTIME_TAG f6ab4ed9846a472d8cb173c12fb9affae21c0fd0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't approve before it's fixed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/orgs/intel/teams/unified-runtime-reviewers will not approve until this is updated, but we do have a policy in our repo to get approvals from other reviewers here before contributions there can proceed. We take full responsibility for blocking this kind of change
: PI_MEM_TYPE_IMAGE1D); | ||
|
||
if (desc.array_size > 1) { | ||
// Image Array |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add periods after each comment here and in other places/fiels.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
// Image Array | ||
if (desc.depth > 0) { | ||
// Image arrays must be 1D or 2D | ||
throw sycl::exception(sycl::make_error_code(sycl::errc::invalid), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it missing support or they simply can't be per the specification? If the latter, why can't we rely on verify
to throw instead? Same in handler.cpp
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is the latter. I've removed this here and in handler.cpp
and added calls to verify()
. Note, there isn't a call added here as the calling functions in this file all call verify()
themselves.
// REQUIRES: linux | ||
// REQUIRES: cuda | ||
|
||
// RUN: %clangxx -fsycl -fsycl-targets=%{sycl_triple} %s -o %t.out |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// RUN: %clangxx -fsycl -fsycl-targets=%{sycl_triple} %s -o %t.out | |
// RUN: %{build} -o %t.out |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
// REQUIRES: cuda | ||
|
||
// RUN: %clangxx -fsycl -fsycl-targets=%{sycl_triple} %s -o %t.out | ||
// RUN: %t.out |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// RUN: %t.out | |
// RUN: %{run} %t.out |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
// Uncomment to print additional test information | ||
// #define VERBOSE_PRINT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Uncomment to print additional test information | |
// #define VERBOSE_PRINT | |
#define VERBOSE_PRINT 0 |
and update the checks accordingly. Or (even better) switch to inline constexpr bool
and if constexpr
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to leave this as is. It's how we're implementing verbosity in all of the bindless images tests, and we have an internal task tracking this to be cleaned up.
// parallel_for 2D | ||
template <int NDims, typename DType, int NChannels, typename KernelName, | ||
typename = std::enable_if_t<NDims == 2>> | ||
static void run_ndim_test(sycl::queue q, sycl::range<2> globalSize, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think metaprogramming magic can unify these two versions neatly, but I won't insist.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keeping as is, for consistency with other bindless images tests.
sycl::queue q(dev); | ||
auto ctxt = q.get_context(); | ||
|
||
// skip half tests if not supported |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd add a static_assert
against double
that would otherwise require aspect:fp64
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We actively don't use doubles in our tests, and this keeps consistency with the rest. I'd like to keep this as is.
* Use image descriptor verify where applicable * Periods after comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SYCL RT changes are good, cursory reading of e2e tests is fine stylistically, I'd expect the logic/completeness of the tests to be checked by images domain experts from Codeplay.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
libclc 👍
0f5b076
to
efd0fc5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oneapi-src/unified-runtime#1274 has been merged, please pull in the latest sycl branch changes and update the UR tag as suggested.
@intel/llvm-gatekeepers please merge, the Windows failure is being tracked in #12798 |
sycl::ext::oneapi::experimental::image_type::array
enum value addedsycl::ext::oneapi::experimental::image_descriptor::array_size
member addedsycl::ext::oneapi::experimental::image_descriptor::verify()
member function addedCorrelated UR PR: [Bindless][Exp] Add Support For Image Arrays #1274