Skip to content

[SYCL] Enable kernel and program cache unit tests #2191

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 11 commits into from
Aug 6, 2020

Conversation

alexbatashev
Copy link
Contributor

@alexbatashev alexbatashev commented Jul 28, 2020

After hiding implementation details LIT tests can no longer access SYCL runtime internals. This patch introduces a new framework for creating unit tests with support for device code and re-enables kernel and program cache test suite. There are a few limitations to such tests at the moment:

  1. Only static linkage with SYCL runtime is supported at the moment.
  2. No support for fallback device library (disabled with new SYCL_DEVICELIB_NO_FALLBACK specifically for unit tests). To load SPIR-V images runtime looks for dynamic library location (either libsycl.so or sycl.dll) to build absolute path. Since SYCL runtime is linked statically, this technique doesn't work.

After hiding implementation details LIT tests can no longer access SYCL
runtime internals. This patch introduces a new framework for creating
unit tests with support for device code and re-enables kernel and
program cache test suite. There are a few limitations to such tests at
the moment:
1) Only static linkage with SYCL runtime is supported at the moment.
2) No support for fallback device library (disabled with new
   `SYCL_DEVICELIB_NO_FALLBACK` specifically for unit tests).

Signed-off-by: Alexander Batashev <[email protected]>
@alexbatashev alexbatashev force-pushed the enable_kernel_and_program branch from 601567b to e02da25 Compare July 28, 2020 15:08
@alexbatashev alexbatashev marked this pull request as ready for review July 28, 2020 15:09
@alexbatashev alexbatashev requested review from kbobrovs, pvchupin and a team as code owners July 28, 2020 15:09
@asavonic
Copy link
Contributor

2. No support for fallback device library (disabled with new SYCL_DEVICELIB_NO_FALLBACK specifically for unit tests).

Can you elaborate on why it is not supported?

@alexbatashev
Copy link
Contributor Author

  1. No support for fallback device library (disabled with new SYCL_DEVICELIB_NO_FALLBACK specifically for unit tests).

Can you elaborate on why it is not supported?

I've updated PR description

Alexander Batashev added 2 commits July 29, 2020 10:00
Signed-off-by: Alexander Batashev <[email protected]>
…rogram

* upstream/sycl: (609 commits)
  [SYCL] Fix fail in the post commit testing (intel#2210)
  [SYCL] Materialize shadow local variables for byval arguments before use (intel#2200)
  [SYCL] Support lambda functions passed to reduction (intel#2190)
  [SYCL][USM] Improve USM Allocator. (intel#2026)
  [SYCL] Disallow mutable lambdas (intel#1785)
  [SYCL][ESIMD] Setup compilation pipeline for ESIMD (intel#2134)
  [SYCL] Fix not found kernel due to empty kernel name when using set_arg(s) (intel#2181)
  [SYCL] Fixed check for set_arg (intel#2203)
  Refactor indirect access calls to minimize invocations. (intel#2185)
  [SYCL][NFC] Fix potential null-pointer access (intel#2197)
  [SYCL] Propagate attributes from transitive calls to kernel (intel#1878)
  [SYCL] Fix warnings from static analysis tool (intel#2193)
  [SYCL][NFC] Fix ac_float test for compilation with FE optimizations (intel#2184)
  [GitHub Actions] Uplift clang-format version to 10 (intel#2194)
  [SYCL][ESIMD] Pass to replace simd* parameters with native llvm vectors. (intel#2097)
  [SYCL][NFC] Fixed SYCL_PI_TRACE output while selecting a device. (intel#2192)
  [SYCL][FPGA] New spec for controlling load-store units in FPGAs (intel#2158)
  [SYCL][Doc] Clarify reqd_sub_group_size (intel#2103)
  [SYCL] Remove noreturn function attribute (intel#2165)
  [SYCL] Aligned set_arg behaviour with SYCL specification (intel#2159)
  ...
Signed-off-by: Alexander Batashev <[email protected]>
Copy link
Contributor

@s-kanaev s-kanaev left a comment

Choose a reason for hiding this comment

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

Looks good overall.
Have only some stylistic comments.

Alexander Batashev added 4 commits July 30, 2020 15:28
…rogram

* upstream/sycl:
  [SYCL] Add barrier before leader guard in LowerWGSCope pass (intel#2208)
  [SYCL] Add prototype of atomic_ref<T*> (intel#2177)
  Revert "[SYCL] Disallow mutable lambdas (intel#1785)" (intel#2213)
Signed-off-by: Alexander Batashev <[email protected]>
Signed-off-by: Alexander Batashev <[email protected]>
@alexbatashev alexbatashev requested a review from s-kanaev July 31, 2020 08:36
s-kanaev
s-kanaev previously approved these changes Jul 31, 2020
Copy link
Contributor

@s-kanaev s-kanaev left a comment

Choose a reason for hiding this comment

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

LGTM.

Copy link
Contributor

@alexanderfle alexanderfle left a comment

Choose a reason for hiding this comment

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

LGTM

alexanderfle
alexanderfle previously approved these changes Jul 31, 2020
EXPECT_EQ(Cache.size(), 0) << "Expect empty cache for source programs";
}

TEST(KernelAndProgramCache, ProgramSourceNegativeBuildWithOpts) {
Copy link
Contributor

Choose a reason for hiding this comment

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

would be good to add a comment to each test stating its purpose

Signed-off-by: Alexander Batashev <[email protected]>
@alexbatashev alexbatashev dismissed stale reviews from alexanderfle and s-kanaev via 8d8bca6 August 3, 2020 12:57
Copy link
Contributor

@s-kanaev s-kanaev left a comment

Choose a reason for hiding this comment

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

LGTM.

Copy link
Contributor

@alexanderfle alexanderfle left a comment

Choose a reason for hiding this comment

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

LGTM

@alexbatashev
Copy link
Contributor Author

@kbobrovs ping

@bader bader merged commit 1a71a4a into intel:sycl Aug 6, 2020
@alexbatashev alexbatashev deleted the enable_kernel_and_program branch August 6, 2020 11:33
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.

6 participants