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] Add sycl-ls utility for listing devices discovered/selected by SYCL RT #1575

Merged
merged 6 commits into from
May 1, 2020

Conversation

smaslov-intel
Copy link
Contributor

@smaslov-intel smaslov-intel commented Apr 23, 2020

Add sycl-ls utility for listing devices discovered/selected by SYCL RT.
Add LIT testing (using sycl-ls) for the effect of SYCL_BE.

Change-Id: I9ce0f40d97aa6008c9b860342a8efd9c6e62fa3c
Signed-off-by: Sergey V Maslov [email protected]

sycl/tools/CMakeLists.txt Outdated Show resolved Hide resolved
sycl/tools/lspi.cpp Outdated Show resolved Hide resolved
sycl/tools/lspi.cpp Outdated Show resolved Hide resolved
sycl/tools/lspi.cpp Outdated Show resolved Hide resolved
sycl/tools/lspi.cpp Outdated Show resolved Hide resolved
sycl/test/plugins/lspi_gpu_cuda.cpp Outdated Show resolved Hide resolved
sycl/tools/lspi.cpp Outdated Show resolved Hide resolved
sycl/tools/lspi.cpp Outdated Show resolved Hide resolved
sycl/tools/lspi.cpp Outdated Show resolved Hide resolved
sycl/tools/lspi.cpp Outdated Show resolved Hide resolved
@keryell
Copy link
Contributor

keryell commented Apr 24, 2020

That looks like a good idea but the name lspi seems too short to avoid name conflict compared to the value. Perhaps sycl-lspi or dpc++-lspi or oneApi or... :-)

Copy link
Contributor

@Ruyk Ruyk left a comment

Choose a reason for hiding this comment

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

Few comments. The tool is called lspi but actually uses SYCL interfaces so doesn't need PI, why not sycl-ls ? will PI interfaces be used later?

sycl/tools/lspi.cpp Outdated Show resolved Hide resolved
sycl/tools/lspi.cpp Outdated Show resolved Hide resolved
sycl/tools/lspi.cpp Outdated Show resolved Hide resolved
sycl/tools/lspi.cpp Outdated Show resolved Hide resolved
@smaslov-intel
Copy link
Contributor Author

changed the name to sycl-ls per suggestions

Copy link
Contributor

@bader bader left a comment

Choose a reason for hiding this comment

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

Could you add test case(s) for concise mode as well, please?

sycl/tools/sycl-ls/CMakeLists.txt Outdated Show resolved Hide resolved
Comment on lines 9 to 10
// The "sycl-ls" utility lists all platforms/devices discovered by PI similar to
// how lscl prints this for OpenCL devices.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// The "sycl-ls" utility lists all platforms/devices discovered by PI similar to
// how lscl prints this for OpenCL devices.
// The "sycl-ls" utility lists all platforms/devices discovered by SYCL similar to
// how clinfo prints this for OpenCL devices.

FYI: AFAIK, lscl is Intel internal tool. I suggest mentioning clinfo - a well-known open source analog.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK

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 you missed PI -> SYCL.

sycl/test/plugins/lspi_gpu_opencl.cpp Outdated Show resolved Hide resolved
@bader bader changed the title [SYCL]: Add lspi utility for listing devices discovered/selected by SYCL RT [SYCL] Add sycl-ls utility for listing devices discovered/selected by SYCL RT Apr 29, 2020
@smaslov-intel
Copy link
Contributor Author

the windows build failed, is this a known issue:

D:\BuildBot\worker_intel\sycl-win-x64-pr\llvm.src\sycl\include\CL/sycl/handler.hpp(136): error C2220: warning treated as error - no 'object' file generated
D:\BuildBot\worker_intel\sycl-win-x64-pr\llvm.src\sycl\include\CL/sycl/handler.hpp(136): warning C4273: 'cl::sycl::detail::getDeviceFromHandler': inconsistent dll linkage
D:\BuildBot\worker_intel\sycl-win-x64-pr\llvm.src\sycl\include\CL/sycl/handler.hpp(108): note: see previous definition of 'getDeviceFromHandler'

@bader
Copy link
Contributor

bader commented Apr 30, 2020

@smaslov-intel, could you remove "executable" flags added by this patch to CMake script files, please?

@bader
Copy link
Contributor

bader commented Apr 30, 2020

the windows build failed, is this a known issue:

D:\BuildBot\worker_intel\sycl-win-x64-pr\llvm.src\sycl\include\CL/sycl/handler.hpp(136): error C2220: warning treated as error - no 'object' file generated
D:\BuildBot\worker_intel\sycl-win-x64-pr\llvm.src\sycl\include\CL/sycl/handler.hpp(136): warning C4273: 'cl::sycl::detail::getDeviceFromHandler': inconsistent dll linkage
D:\BuildBot\worker_intel\sycl-win-x64-pr\llvm.src\sycl\include\CL/sycl/handler.hpp(108): note: see previous definition of 'getDeviceFromHandler'

This looks like an issue introduced by @v-klochkov by bb73d92.
After follow-up change abe533c we have two conflicting declarations of getDeviceFromHandler next to each other: https://github.com/intel/llvm/blob/sycl/sycl/include/CL/sycl/handler.hpp#L108.

Issues like this will be prevented once #1583 is merged.

@bader
Copy link
Contributor

bader commented Apr 30, 2020

Other then two comments above, this LGTM.

@sergey-semenov
Copy link
Contributor

As long as the other comments are addressed, this LGTM as well.

vladimirlaz
vladimirlaz previously approved these changes Apr 30, 2020
@smaslov-intel
Copy link
Contributor Author

Other then two comments above, this LGTM.

I fixed the executable bits, what is the second one?

@bader
Copy link
Contributor

bader commented Apr 30, 2020

Other then two comments above, this LGTM.

I fixed the executable bits, what is the second one?

This PR breaks the build on Windows.

@v-klochkov
Copy link
Contributor

LGTM, but it requires a conflict resolution for handler.hpp before it can be merged.
Please re-base the patch.

…YCL RT

Change-Id: I9ce0f40d97aa6008c9b860342a8efd9c6e62fa3c
Signed-off-by: Sergey V Maslov <[email protected]>
Signed-off-by: Sergey V Maslov <[email protected]>
Signed-off-by: Sergey V Maslov <[email protected]>
v-klochkov
v-klochkov previously approved these changes May 1, 2020
@bader
Copy link
Contributor

bader commented May 1, 2020

getDeviceFromHandler is declared in three files:
https://github.com/intel/llvm/search?q=getDeviceFromHandler&unscoped_q=getDeviceFromHandler

@alexbatashev, how it happened that we have __SYCL_EXPORT only for forward declaration in handler header, but miss this marker in accessor.*pp files where this function is defined?

@alexbatashev
Copy link
Contributor

getDeviceFromHandler is declared in three files:
https://github.com/intel/llvm/search?q=getDeviceFromHandler&unscoped_q=getDeviceFromHandler

@alexbatashev, how it happened that we have __SYCL_EXPORT only for forward declaration in handler header, but miss this marker in accessor.*pp files where this function is defined?

Human error + lack of LITs that would indicate this mistake.

@bader
Copy link
Contributor

bader commented May 1, 2020

@alexbatashev, would you mind fixing this issue in a separate PR (+ the bug with double declaration fixed by @smaslov-intel in this PR), please?
I think it shouldn't go with this PR.

@alexbatashev
Copy link
Contributor

@alexbatashev, would you mind fixing this issue in a separate PR (+ the bug with double declaration fixed by @smaslov-intel in this PR), please?
I think it shouldn't go with this PR.

Sure

@bader bader merged commit cc0c33b into intel:sycl May 1, 2020
alexbatashev pushed a commit to alexbatashev/llvm that referenced this pull request May 6, 2020
…_docs

* origin/sycl: (6482 commits)
  [SYCL][NFC] Clean formatting in Markdown documents (intel#1635)
  [SYCL][Doc] Remove obsolete parens from README (intel#1637)
  [SYCL] Fix failing ABI tests when LLVM_LIBDIR_SUFFIX is set (intel#1605)
  [SYCL] Fix warnings in libdevice (intel#1630)
  [SYCL][CUDA] Triage and clean LIT (intel#1620)
  [SYCL][NFC] Fix GCC 8 compilation warnings (intel#1631)
  [SYCL] Minor fixes in LowerWGScope
  [SYCL] PI: correct default interoperability plugin selection
  [SYCL] Add faster reduction implementations using atomic or/and intel::reduce() (intel#1615)
  [SYCL] Add sycl-ls utility for listing devices discovered/selected by SYCL RT (intel#1575)
  [SYCL] Fix getDeviceFromHandler declarations (intel#1626)
  [SPIR-V] Correct/improve declaration of SPIR-V builtins (intel#1519)
  [SYCL][USM] Improve USM allocator test and fix improper behavior. (intel#1538)
  [SYCL] Fix failing ABI LITs (intel#1622)
  [SYCL] Add support for MSVC internal math functions in device library (intel#1441)
  [SYCL] Add runtime library versioning (intel#1604)
  [SYCL] Check weak symbols in ABI dumps (intel#1609)
  [NFC][SYCL] Improve kernel metadata test (intel#1610)
  Revert "[SYCL] XFAIL LIT test due to duplicate diagnostic" (intel#1460)
  [SYCL] Move the reduction command group funcs out of handler.hpp (intel#1602)
  ...
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.

8 participants