forked from intel/llvm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SYCL] Define device trait macros from compiler driver (intel#10321)
This PR implements the changes detailed in [Changes to the compiler driver](https://github.com/intel/llvm/blob/sycl/sycl/doc/design/DeviceAspectTraitDesign.md#changes-to-the-compiler-driver). --------- Signed-off-by: Maronas, Marcos <marcos.maronas@intel.com>
- Loading branch information
1 parent
aec8a35
commit 8c5c8eb
Showing
9 changed files
with
407 additions
and
474 deletions.
There are no files selected for viewing
This file contains 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 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 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 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,21 @@ | ||
/// Check that no device traits macros are defined if sycl is disabled: | ||
// RUN: %clang -### %s 2>&1 \ | ||
// RUN: | FileCheck -check-prefix=CHECK-DISABLED %s | ||
// CHECK-DISABLED-NOT: "{{.*}}SYCL_ANY_DEVICE_HAS{{.*}}" | ||
// CHECK-DISABLED-NOT: "{{.*}}SYCL_ALL_DEVICES_HAVE{{.*}}" | ||
|
||
/// Check device traits macros are defined if sycl is enabled: | ||
/// In this case, where no specific sycl targets are passed, the sycl | ||
/// targets are spir64 and the host target (e.g. x86_64). We expect two | ||
/// occurrences of the macro definition, one for host and one for device. | ||
// RUN: %clang -fsycl -### %s 2>&1 \ | ||
// RUN: | FileCheck -check-prefix=CHECK-ENABLED %s | ||
// CHECK-ENABLED-COUNT-2: "-D__SYCL_ANY_DEVICE_HAS_ANY_ASPECT__=1" | ||
|
||
/// Check device traits macros are defined if sycl is enabled: | ||
/// In this case the sycl targets are spir64, spir64_gen and the host | ||
/// target (e.g. x86_64). We expect three occurrences of the macro | ||
/// definition, one for host and one for each of the two devices. | ||
// RUN: %clang -fsycl -fsycl-targets=spir64,spir64_gen -### %s 2>&1 \ | ||
// RUN: | FileCheck -check-prefix=CHECK-SYCL-TARGETS %s | ||
// CHECK-SYCL-TARGETS-COUNT-3: "-D__SYCL_ANY_DEVICE_HAS_ANY_ASPECT__=1" |
This file contains 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 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 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
Oops, something went wrong.