Skip to content
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][NFC] Refactor lit.cfg.py #1452

Conversation

AlexeySachkov
Copy link
Contributor

@AlexeySachkov AlexeySachkov commented Apr 1, 2020

Switched to use "lit_config.note" instead of just "print": this emits
potentially more usefult message, because it shows particular file and
line where it was emitted, something like:

llvm-lit: /sycl/test/lit.cfg.py:117: note: Found available CPU device
llvm-lit: /sycl/test/lit.cfg.py:154: warning: GPU device not found
llvm-lit: /sycl/test/lit.cfg.py:169: warning: Accelerator device not found
llvm-lit: /sycl/test/lit.cfg.py:198: warning: Couldn't find pre-installed AOT device compiler ocloc
llvm-lit: /sycl/test/lit.cfg.py:198: warning: Couldn't find pre-installed AOT device compiler aoc
llvm-lit: /sycl/test/lit.cfg.py:198: warning: Couldn't find pre-installed AOT device compiler opencl-aot

It also should be possible now to suppress this output via "-q" option
to llvm-lit

Removed extra items from "config.excludes" list since they were ignored
anyway based on content of "config.suffixes"

Simplified environment propagation by re-using existing helper functions

Updated logic of getDeviceCount function to avoid printing useless
messages

Removed duplicated handling of path to SYCL tools directory

Refactored handling of "opencl-aot" tool: now if it was built together
with product, version from build directory will be used rather than a
system one

sycl/test/lit.cfg.py Outdated Show resolved Hide resolved
@AlexeySachkov AlexeySachkov force-pushed the private/asachkov/refactor-messages-from-lit-py branch from 512cc9a to 35e2ef3 Compare April 3, 2020 16:54
@AlexeySachkov AlexeySachkov changed the title [SYCL][NFC] Minor refactoring of lit.cfg.py [SYCL][NFC] Refactor lit.cfg.py Apr 3, 2020
@AlexeySachkov
Copy link
Contributor Author

Tagging @Ruyk and @Alexander-Johnston to review as well

sycl/test/lit.cfg.py Outdated Show resolved Hide resolved
sycl/test/lit.cfg.py Outdated Show resolved Hide resolved
sycl/test/lit.cfg.py Outdated Show resolved Hide resolved
@AlexeySachkov AlexeySachkov force-pushed the private/asachkov/refactor-messages-from-lit-py branch from 35e2ef3 to 884e455 Compare April 6, 2020 12:53
@bader bader requested review from Fznamznon and alexbatashev April 7, 2020 17:38
if not cuda:
opencl = True
config.available_features.add('opencl')
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this code is not quite right. opencl feature should be enabled only if there is at least on OpenCL device in the system.
Could we fix this issue within this refactoring?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should be fixed now

sycl/test/lit.cfg.py Show resolved Hide resolved
sycl/test/lit.cfg.py Show resolved Hide resolved
@AlexeySachkov AlexeySachkov force-pushed the private/asachkov/refactor-messages-from-lit-py branch from 884e455 to dbf5266 Compare April 8, 2020 15:16
Switched to use "lit_config.note" instead of just "print": this emits
potentially more usefult message, because it shows particular file and
line where it was emitted, something like:

```
llvm-lit: /sycl/test/lit.cfg.py:117: note: Found available CPU device
llvm-lit: /sycl/test/lit.cfg.py:154: warning: GPU device not found
llvm-lit: /sycl/test/lit.cfg.py:169: warning: Accelerator device not found
llvm-lit: /sycl/test/lit.cfg.py:198: warning: Couldn't find pre-installed AOT device compiler ocloc
llvm-lit: /sycl/test/lit.cfg.py:198: warning: Couldn't find pre-installed AOT device compiler aoc
llvm-lit: /sycl/test/lit.cfg.py:198: warning: Couldn't find pre-installed AOT device compiler opencl-aot
```

It also should be possible now to suppress this output via "-q" option
to llvm-lit

Removed extra items from "config.excludes" list since they were ignored
anyway based on content of "config.suffixes"

Simplified environment propagation by re-using existing helper functions

Updated logic of `getDeviceCount` function to avoid printing useless
messages

Removed duplicated handling of path to SYCL tools directory

Refactored handling of "opencl-aot" tool: now if it was built together
with product, version from build directory will be used rather than a
system one

Signed-off-by: Alexey Sachkov <alexey.sachkov@intel.com>
@AlexeySachkov AlexeySachkov force-pushed the private/asachkov/refactor-messages-from-lit-py branch from dbf5266 to bbeb2f1 Compare April 9, 2020 08:22
@bader bader requested a review from Fznamznon April 9, 2020 09:05
@bader bader merged commit d9de923 into intel:sycl Apr 9, 2020
alexbatashev pushed a commit to alexbatashev/llvm that referenced this pull request Apr 15, 2020
…duler_docs

* origin/sycl:
  [SYCL][PI][CUDA] Implements get_native interoperability (intel#1332)
  [SYCL] Fix check-sycl test suite on systems w/o OpenCL (intel#1503)
  [SYCL][Doc] Update ExtendedAtomics documentation (intel#1487)
  [SYCL][CUDA] Expose context extended deleters on PI API (intel#1483)
  [SYCL][NFC] Remove a dropped environment variable from a test (intel#1506)
  [SYCL] Add opencl-aot to sycl-toolchain target (intel#1504)
  [SYCL] Allow to run deploy LIT tests from particular directory
  [SYCL][CUDA] Fix LIT testing with CUDA devices (intel#1300)
  [SYCL] Remove operator name keywords (intel#1501)
  [Driver][SYCL] Consider .lo files as static archives (intel#1500)
  [SYCL-PTX] Update the compiler design to describe the CUDA target (intel#1408)
  [SYCL] Fix library build on Windows (intel#1499)
  [SYCL][NFC] Refactor lit.cfg.py (intel#1452)
  [SYCL] Fixed sub-buffer memory allocation update (intel#1486)
  [SYCL] Ensure proper definition of spirv builtins for SYCL (intel#1393)
  [SYCL][CUDA] LIT XFAIL/UNSUPPORTED (intel#1303)
  [SYCL][Doc] Function-type kernel attribute extension (intel#1494)
alexbatashev pushed a commit to alexbatashev/llvm that referenced this pull request Apr 15, 2020
…c_abi_checks

* origin/sycl: (32 commits)
  [SYCL] Do not force LLVM_INCLUDE_TESTS variable (intel#1505)
  [SYCL][NFC] Align nd_item members with constructor initialization list (intel#1521)
  [SYCL] Move get_info_host implementation to header (intel#1514)
  [SYCL] Always use dynamic CRT for Unit tests (intel#1515)
  [SYCL][NFC] Temporarily disable sporadically failing test (intel#1526)
  [SYCL] Fix inline namespaces (intel#1525)
  [SYCL] Release notes for March'20 DPCPP implementation update (intel#1511)
  [SYCL][PI][CUDA] Implements get_native interoperability (intel#1332)
  [SYCL] Fix check-sycl test suite on systems w/o OpenCL (intel#1503)
  [SYCL][Doc] Update ExtendedAtomics documentation (intel#1487)
  [SYCL][CUDA] Expose context extended deleters on PI API (intel#1483)
  [SYCL][NFC] Remove a dropped environment variable from a test (intel#1506)
  [SYCL] Add opencl-aot to sycl-toolchain target (intel#1504)
  [SYCL] Allow to run deploy LIT tests from particular directory
  [SYCL][CUDA] Fix LIT testing with CUDA devices (intel#1300)
  [SYCL] Remove operator name keywords (intel#1501)
  [Driver][SYCL] Consider .lo files as static archives (intel#1500)
  [SYCL-PTX] Update the compiler design to describe the CUDA target (intel#1408)
  [SYCL] Fix library build on Windows (intel#1499)
  [SYCL][NFC] Refactor lit.cfg.py (intel#1452)
  ...
@AlexeySachkov AlexeySachkov deleted the private/asachkov/refactor-messages-from-lit-py branch February 25, 2021 12:26
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.

5 participants