-
Notifications
You must be signed in to change notification settings - Fork 769
[SYCL] Implement SYCL_ONEAPI_accessor_properties #2456
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
Conversation
This PR requires #2447 to be merged. Right now it contains some unrelated changes to run tests. Runtime changes begin at 71462a44815ce6884cf1794c522f1220eecd30d5 |
Signed-off-by: Alexander Batashev <[email protected]>
34c06d4
to
c22997b
Compare
please provide link to extension documentation in PR. |
Done. |
Co-authored-by: Mikhail Lychkov <[email protected]>
@@ -1,6 +1,8 @@ | |||
// RUN: %clangxx -fsycl -c -fno-color-diagnostics -Xclang -fdump-record-layouts %s | FileCheck %s | |||
// REQUIRES: linux |
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 there any reason to not run it on windows?
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.
Windows version only differs in class names (due to different standard library implementation)
* origin/sycl: [SYCL] Fixes in release notes (intel#2470) [SYCL] Refactor -fsycl-esimd and -fsycl-int-header options (intel#2466)
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.
types.hpp looks good.
Co-authored-by: Mikhail Lychkov <[email protected]>
AreSameTemplate<PropT, Head>::value || | ||
!sycl::detail::IsCompileTimePropertyInstance<PropT>::value, |
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.
Now, if the PropT
and Head
are not the same and PropT
isn't a compile-time property this condition will evaluate to true
, isn't it? Is it even correct?
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 was done to skip runtime properties, but that was probably the wrong place. Moved.
!std::is_same_v<typename ContainerT::Head, void> && | ||
(AreSameTemplate<PropT<Args...>, | ||
typename ContainerT::Head>::value || | ||
!sycl::detail::IsCompileTimePropertyInstance< | ||
typename ContainerT::Head>::value), |
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.
Same question here
template <typename T> | ||
using IsRunTimePropertyListT = | ||
typename std::is_same<ONEAPI::accessor_property_list<>, T>; |
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.
Are there no runtime properties available?
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.
Not yet.
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.
Before this patch, accessor constructors could accept property_list. To allow transparent conversions for user from property_list to some accessor_property_list, I had to make some differentiation between accessor_property_list with template parameters (aka constexpr parameters) and without (aka run time parameters). Runtime parameters do not require any template arguments, because they're stored in run time container.
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.
The patch is missing at least 1 at max 2 test(s).
First test needs to go to fpga_tests. Scenario goes as follows:
create an accessor with buffer_location property, write to this accessor and then read on host, checking the result (the test might have some simple calculations). The purpose is to ensure, that the property doesn't break anything at runtime level (even if it's no-op for cpu/gpu/fpga emu).
Second test (not required, but at least it's needed to ensure, that is works correctly locally) is for checking device code for buffer_location feature aka checking if the metadata kernel_arg_buffer_location presents in the module (I know, that there is a test in clang, but it works with a dummy header, need to check with the real one).
Added two more tests. |
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.
LGTM
just one minor comment and a minor question/testing scenario idea that can be addressed later.
* upstream/sycl: (405 commits) [SYCL] Implement new env var SYCL_DEVICE_FILTER (intel#2239) [Driver][SYCL] Make /MD the default for -fsycl (intel#2478) [SYCL]: basic support of contexts with multiple devices in Level-Zero (intel#2440) [SYCL] Fix LIT regression after 9dd18ca (intel#2481) [SYCL][L0] Kernel Destroy in piKernelRelease (intel#2475) [SYCL] Emit an aliased function only if it is used (intel#2430) [Driver][SYCL] Add defaultlib directive for sycl lib (intel#2464) [Driver][SYCL] Improve situations where .exe is added for AOT tools (intel#2467) [SYCL][L0]: Check Queue refcnt prior to using members in event wait/release (intel#2471) [SYCL] Unroll several loops in __init method accessor class (intel#2449) [SYCL][Doc] Add link to use pinned memory spec (intel#2463) [SYCL] Link SYCL device libraries by default. (intel#2400) Revert "[SYCL] XFAIL test blcoking pulldown" Avoid usage of deprecated "VectorType::getNumElements" (intel#737) Fix nullptr dereference (intel#741) Do not translate arbitrary precision operations without corresponding extensions (intel#714) Add Constrained Floating-Point Intrinsics support [SYCL] Take into account auxiliary cmake options for Level Zero loader [InstCombine] improve fold of pointer differences [InstCombine] add ptr difference tests; NFC ...
@s-kanaev @turinevgeny ping |
@@ -0,0 +1,22 @@ | |||
// RUN: %clangxx -fsycl %s -o %t.out | |||
// RUNx: %ACC_RUN_PLACEHOLDER %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.
Is test execution disabled by any reason. Could you please add the comment with description if it is the case
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.
No, it's a typo. If no objections, I'll do a followup patch to fix that.
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.
OK for me to fix in separate patch
[benchmarks] add umf suite
Implement SYCL runtime part of SYCL_ONEAPI_accessor_properties extension (https://github.com/intel/llvm/blob/sycl/sycl/doc/extensions/accessor_properties/SYCL_ONEAPI_accessor_properties.asciidoc). Also add buffer_location property (https://github.com/intel/llvm/blob/sycl/sycl/doc/extensions/accessor_properties/SYCL_INTEL_buffer_location.asciidoc).