-
Notifications
You must be signed in to change notification settings - Fork 752
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Driver][SYCL] Add support for -fsycl-force-target
Introduce -fsycl-force-target=arg support. This is used along with -fsycl to allow the user to override the target used to unbundle device objects from fat objects and archives. For example, object.o is built from -fsycl-targets=spir64. The user wants to build with -fsycl-targets=spir64_gen and object.o. Use of -fsycl-force-target=spir64 allows for this to be accomplished. Additional notes: - Only valid when used with a single triple from -fsycl-targets - Applies to all unbundled archives and objects
- Loading branch information
Showing
6 changed files
with
69 additions
and
1 deletion.
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
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,26 @@ | ||
/// Verify the usage of -fsycl-force-target applies to all expected unbundlings | ||
// RUN: touch %t.o | ||
// RUN: %clangxx -fsycl -fsycl-targets=spir64_gen -fsycl-force-target=spir64 \ | ||
// RUN: %s --sysroot=%S/Inputs/SYCL %t.o -### 2>&1 \ | ||
// RUN: | FileCheck %s -check-prefix=CHECK_FORCE_TARGET | ||
// RUN: %clangxx -fsycl -fsycl-targets=spir64_gen \ | ||
// RUN: -fsycl-force-target=spir64-unknown-unknown \ | ||
// RUN: %s --sysroot=%S/Inputs/SYCL %t.o -### 2>&1 \ | ||
// RUN: | FileCheck %s -check-prefixes=CHECK_FORCE_TARGET,CHECK_FORCE_TARGET_GEN | ||
// RUN: %clangxx -fsycl -fsycl-targets=spir64_x86_64 \ | ||
// RUN: -fsycl-force-target=spir64 %s \ | ||
// RUN: --sysroot=%S/Inputs/SYCL %t.o -### 2>&1 \ | ||
// RUN: | FileCheck %s -check-prefixes=CHECK_FORCE_TARGET,CHECK_FORCE_TARGET_CPU | ||
// CHECK_FORCE_TARGET: clang-offload-bundler{{.*}} "-type=o" "-targets=host-{{.*}},sycl-spir64-unknown-unknown" "-input={{.*}}" "-output={{.*}}" "-output=[[DEVICEOBJECTOUT:.+]]" "-unbundle" "-allow-missing-bundles" | ||
// CHECK_FORCE_TARGET: spirv-to-ir-wrapper{{.*}} "[[DEVICEOBJECTOUT]]" "-o" "[[DEVICEOBJECTBC:.+\.bc]]" | ||
// CHECK_FORCE_TARGET: llvm-link{{.*}} "[[DEVICEOBJECTBC]]"{{.*}} "-o" "[[DEVICEOBJLINKED:.+\.bc]]" "--suppress-warnings" | ||
// CHECK_FORCE_TARGET: clang-offload-bundler{{.*}} "-type=o" "-targets=sycl-spir64-unknown-unknown" "-input={{.*}}libsycl-complex{{.*}}" "-output={{.*}}libsycl-complex-{{.*}}" "-unbundle" | ||
// CHECK_FORCE_TARGET_GEN: llvm-foreach{{.*}} {{.*}}ocloc{{.*}} | ||
// CHECK_FORCE_TARGET_CPU: llvm-foreach{{.*}} {{.*}}opencl-aot{{.*}} | ||
|
||
/// -fsycl-force-target is only valid with -fsycl-target with single targets | ||
// RUN: %clangxx -fsycl -fsycl-targets=spir64_gen,spir64_x86_64 \ | ||
// RUN: -fsycl-force-target=spir64 %s -### 2>&1 \ | ||
// RUN: | FileCheck %s -check-prefix=MULTIPLE_TARGET | ||
// MULTIPLE_TARGET: error: multiple target usage with '-fsycl-targets=spir64_gen,spir64_x86_64' is not supported with '-fsycl-force-target=spir64' | ||
|
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