Skip to content

[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

Merged
merged 21 commits into from
Sep 18, 2020

Conversation

alexbatashev
Copy link
Contributor

@alexbatashev alexbatashev commented Sep 10, 2020

@alexbatashev
Copy link
Contributor Author

alexbatashev commented Sep 10, 2020

This PR requires #2447 to be merged. Right now it contains some unrelated changes to run tests. Runtime changes begin at 71462a44815ce6884cf1794c522f1220eecd30d5

@alexbatashev alexbatashev marked this pull request as ready for review September 14, 2020 08:48
@alexbatashev alexbatashev requested review from turinevgeny and a team as code owners September 14, 2020 08:48
@vladimirlaz
Copy link
Contributor

please provide link to extension documentation in PR.

@alexbatashev
Copy link
Contributor Author

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
Copy link
Contributor

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?

Copy link
Contributor Author

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)

Alexander Batashev added 3 commits September 15, 2020 10:43
* origin/sycl:
  [SYCL] Fixes in release notes (intel#2470)
  [SYCL] Refactor -fsycl-esimd and -fsycl-int-header options (intel#2466)
turinevgeny
turinevgeny previously approved these changes Sep 15, 2020
Copy link
Contributor

@turinevgeny turinevgeny left a 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.

turinevgeny
turinevgeny previously approved these changes Sep 15, 2020
Comment on lines 65 to 66
AreSameTemplate<PropT, Head>::value ||
!sycl::detail::IsCompileTimePropertyInstance<PropT>::value,
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Comment on lines 92 to 96
!std::is_same_v<typename ContainerT::Head, void> &&
(AreSameTemplate<PropT<Args...>,
typename ContainerT::Head>::value ||
!sycl::detail::IsCompileTimePropertyInstance<
typename ContainerT::Head>::value),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same question here

Comment on lines +229 to +231
template <typename T>
using IsRunTimePropertyListT =
typename std::is_same<ONEAPI::accessor_property_list<>, T>;
Copy link
Contributor

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?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not yet.

Copy link
Contributor Author

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.

Copy link
Contributor

@MrSidims MrSidims left a 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).

@alexbatashev
Copy link
Contributor Author

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.

Copy link
Contributor

@MrSidims MrSidims left a 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
  ...
@alexbatashev
Copy link
Contributor Author

@s-kanaev @turinevgeny ping

@@ -0,0 +1,22 @@
// RUN: %clangxx -fsycl %s -o %t.out
// RUNx: %ACC_RUN_PLACEHOLDER %t.out
Copy link
Contributor

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

Copy link
Contributor Author

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.

Copy link
Contributor

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

@romanovvlad romanovvlad merged commit f7d073d into intel:sycl Sep 18, 2020
@alexbatashev alexbatashev deleted the accessor_property_list branch October 31, 2020 09:43
Chenyang-L pushed a commit that referenced this pull request Feb 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants