Skip to content

[SYCL] Don't include level zero header explicitly to the interop header #2249

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 1 commit into from
Aug 4, 2020

Conversation

againull
Copy link
Contributor

@againull againull commented Aug 4, 2020

Signed-off-by: Artur Gainullin [email protected]

@againull againull requested a review from a team as a code owner August 4, 2020 06:48
Comment on lines +12 to +13
// This header should be included by users.
//#include <level_zero/ze_api.h>
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 "standard" macro defined in level_zero/ze_api.h, which we can check?
It would be better to have something like:

#if !defined(LEVEL_ZERO_INCLUDED)
  #error "level_zero/ze_api.h must be included to use Level Zero interoperability with SYCL"
#endif

instead of these two lines.

Copy link
Contributor

Choose a reason for hiding this comment

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

There is probably soemthing we could use, e.g. _ZE_API_H, but not sure how "standard" this is. Probably not (+@jandres742)
Also, since all the uses of L0 types are in templates, it is probably fine to have L0 included after this header

Copy link
Contributor

Choose a reason for hiding this comment

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

I recalled that we tried the same approach with OpenCL headers in the past and it caused some issues, so we include OpenCL headers from SYCL headers.
What is the motivation for this change? Will it be clear for user that includes of Level Zero headers are missing and how to fix this problem?

Copy link
Contributor

Choose a reason for hiding this comment

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

The ze_api.h has this

#ifndef _ZE_API_H

but not quite sure what we are trying to solve here. Why we cannot include the ze_api.h in the interop header? We know the interop header is gonna need it anyway, no?

Copy link
Contributor

Choose a reason for hiding this comment

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

If I understand it correctly, this patch is supposed to address the compile time issue with missing headers on the systems w/o Intel GPU (e.g. cpu-only system or a system with NVIDIA GPU). In these cases DPC++ is not supposed to use Level Zero plug-in and there might be no headers on the system.

I'm not sure that asking users to provide headers in the best option here, but it's one way to address this issue.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@bader You are right.

@againull againull merged commit 68ec253 into intel:sycl Aug 4, 2020
@againull againull deleted the fix_header_native branch December 3, 2022 00:03
jsji pushed a commit that referenced this pull request Dec 7, 2023
The following warning used to appear:
SPIRVInstruction.h:3745:23: warning: ISO C++11 requires at least one argument for the "..." in a variadic macro
_SPIRV_OP(ReadClockKHR)

Original commit:
KhronosGroup/SPIRV-LLVM-Translator@8155991
Chenyang-L pushed a commit that referenced this pull request Feb 18, 2025
[DeviceASAN] Use device usm to sync asan runtime data instead of shared usm
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