-
Notifications
You must be signed in to change notification settings - Fork 787
[SYCL] Set preprocessor macros in integration header #4823
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
Changes from 2 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
adaee55
[SYCL] Set preprocessor macros in integration header
elizabethandrews 62c55e4
Add CL_SYCL_LANGUAGE_VERSION test
elizabethandrews f72fa00
Revert changes
elizabethandrews af88a3f
Get version information from common source
elizabethandrews 242ab30
Add a comment
elizabethandrews b80340c
Merge remote-tracking branch 'intel_llvm/sycl' into versionpredefine
elizabethandrews 1e3f4c1
Merge remote-tracking branch 'intel_llvm/sycl' into versionpredefine
elizabethandrews 1178ad5
Merge remote-tracking branch 'intel_llvm/sycl' into versionpredefine
elizabethandrews ca2c4d4
Merge remote-tracking branch 'intel_llvm/sycl' into versionpredefine
elizabethandrews 50f56d6
Use clang spelling instead of GNU spelling to fix compilation
elizabethandrews 036ef0a
Implement review comment for coding standard
elizabethandrews File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// RUN: %clang_cc1 -fsycl-is-device -triple spir64-unknown-unknown -sycl-std=2020 -fsycl-int-header=%t.h %s | ||
// RUN: FileCheck -input-file=%t.h %s --check-prefix=CHECK-SYCL2020 | ||
// RUN: %clang_cc1 -fsycl-is-device -triple spir64-unknown-unknown -sycl-std=2017 -fsycl-int-header=%t.h %s | ||
// RUN: FileCheck -input-file=%t.h %s --check-prefix=CHECK-SYCL2017 | ||
// RUN: %clang_cc1 -fsycl-is-device -triple spir64-unknown-unknown -fsycl-disable-range-rounding -fsycl-int-header=%t.h %s | ||
// RUN: FileCheck -input-file=%t.h %s --check-prefix=CHECK-RANGE | ||
// RUN: %clang_cc1 -fsycl-is-device -triple spir64-unknown-unknown -fsycl-int-header=%t.h %s | ||
// RUN: FileCheck -input-file=%t.h %s --check-prefix=CHECK-NO-RANGE | ||
|
||
// Test verifying predefines which need to be set for host and device compilation. | ||
// Preprocessor macros which are required when using custom host compiler must be | ||
// defined in integration header. | ||
|
||
#include "Inputs/sycl.hpp" | ||
|
||
int main() { | ||
cl::sycl::kernel_single_task<class first_kernel>([]() {}); | ||
} | ||
|
||
// CHECK-SYCL2020: #define SYCL_LANGUAGE_VERSION 202001 | ||
// CHECK-SYCL2020-NOT: #define CL_SYCL_LANGUAGE_VERSION 121 | ||
// CHECK-SYCL2020-NOT: #define SYCL_LANGUAGE_VERSION 201707 | ||
|
||
// CHECK-SYCL2017: #define CL_SYCL_LANGUAGE_VERSION 121 | ||
// CHECK-SYCL2017: #define SYCL_LANGUAGE_VERSION 201707 | ||
// CHECK-SYCL2017-NOT: #define SYCL_LANGUAGE_VERSION 202001 | ||
|
||
// CHECK-RANGE: #define __SYCL_DISABLE_PARALLEL_FOR_RANGE_ROUNDING__ 1 | ||
// CHECK-NO-RANGE-NOT: #define __SYCL_DISABLE_PARALLEL_FOR_RANGE_ROUNDING__ 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,18 @@ | ||
// RUN: %clang_cc1 %s -E -dM | FileCheck %s | ||
// RUN: %clang_cc1 %s -fsycl-is-device -E -dM | FileCheck --check-prefix=CHECK-SYCL-ID %s | ||
// RUN: %clang_cc1 %s -fsycl-id-queries-fit-in-int -fsycl-is-host -sycl-std=2017 -E -dM | FileCheck --check-prefix=CHECK-SYCL-STD %s | ||
// RUN: %clang_cc1 %s -fsycl-id-queries-fit-in-int -fsycl-is-device -sycl-std=2017 -E -dM | FileCheck --check-prefix=CHECK-SYCL-STD %s | ||
// RUN: %clang_cc1 %s -fsycl-id-queries-fit-in-int -fsycl-is-host -sycl-std=2020 -E -dM | FileCheck --check-prefix=CHECK-SYCL-STD-2020 %s | ||
// RUN: %clang_cc1 %s -fsycl-id-queries-fit-in-int -fsycl-is-host -E -dM | FileCheck --check-prefix=CHECK-SYCL-STD-2020 %s | ||
// RUN: %clang_cc1 %s -fsycl-id-queries-fit-in-int -fsycl-is-device -sycl-std=2020 -E -dM | FileCheck --check-prefix=CHECK-SYCL-STD-2020 %s | ||
// RUN: %clang_cc1 %s -fsycl-id-queries-fit-in-int -fsycl-is-device -sycl-std=1.2.1 -E -dM | FileCheck --check-prefix=CHECK-SYCL-STD-DEVICE %s | ||
// RUN: %clang_cc1 %s -fsycl-is-device -E -dM | FileCheck --check-prefix=CHECK-SYCL-FIT-IN-INT %s | ||
// RUN: %clang_cc1 %s -fsycl-id-queries-fit-in-int -fsycl-is-host -E -dM | FileCheck --check-prefix=CHECK-SYCL-FIT-IN-INT %s | ||
// RUN: %clang_cc1 %s -fsycl-id-queries-fit-in-int -fsycl-is-device -E -dM | FileCheck --check-prefix=CHECK-SYCL-FIT-IN-INT %s | ||
// RUNx: %clang_cc1 %s -fsycl-id-queries-fit-in-int -fsycl-is-device -E -dM -fms-compatibility | FileCheck --check-prefix=CHECK-MSVC %s | ||
// RUN: %clang_cc1 -fno-sycl-id-queries-fit-in-int %s -E -dM | FileCheck \ | ||
// RUN: --check-prefix=CHECK-NO-SYCL_FIT_IN_INT %s | ||
// RUN: %clang_cc1 -fno-sycl-id-queries-fit-in-int %s -E -dM | FileCheck --check-prefix=CHECK-NO-SYCL-FIT-IN-INT %s | ||
|
||
// CHECK-NOT:#define __SYCL_DEVICE_ONLY__ 1 | ||
// CHECK-NOT:#define SYCL_EXTERNAL | ||
// CHECK-NOT:#define CL_SYCL_LANGUAGE_VERSION 121 | ||
// CHECK-NOT:#define __SYCL_ID_QUERIES_FIT_IN_INT__ 1 | ||
|
||
// CHECK-SYCL-STD:#define CL_SYCL_LANGUAGE_VERSION 121 | ||
// CHECK-SYCL-STD:#define SYCL_LANGUAGE_VERSION 201707 | ||
// CHECK-SYCL-STD:#define __SYCL_ID_QUERIES_FIT_IN_INT__ 1 | ||
|
||
// CHECK-SYCL-STD-2020:#define SYCL_LANGUAGE_VERSION 202001 | ||
|
||
// CHECK-SYCL-STD-DEVICE:#define __SYCL_DEVICE_ONLY__ 1 | ||
// CHECK-SYCL-STD-DEVICE:#define __SYCL_ID_QUERIES_FIT_IN_INT__ 1 | ||
// CHECK-SYCL-FIT-IN-INT:#define __SYCL_ID_QUERIES_FIT_IN_INT__ 1 | ||
|
||
// CHECK-MSVC-NOT: __GNUC__ | ||
// CHECK-MSVC-NOT: __STDC__ | ||
// CHECK-MSVC: #define __SYCL_ID_QUERIES_FIT_IN_INT__ 1 | ||
|
||
// CHECK-NO-SYCL_FIT_IN_INT-NOT:#define __SYCL_ID_QUERIES_FIT_IN_INT__ 1 | ||
// CHECK-SYCL-ID:#define __SYCL_ID_QUERIES_FIT_IN_INT__ 1 | ||
// CHECK-NO-SYCL-FIT-IN-INT-NOT:#define __SYCL_ID_QUERIES_FIT_IN_INT__ 1 |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.