-
Notifications
You must be signed in to change notification settings - Fork 791
[SYCL] Fix handling of comma separated arch value when calling clang-offload-packager #20130
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
Open
jzc
wants to merge
4
commits into
intel:sycl
Choose a base branch
from
jzc:comma-separated-arch
base: sycl
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
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
Some comments aren't visible on the classic Files Changed page.
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 |
|---|---|---|
|
|
@@ -187,7 +187,7 @@ | |
| // RUN: %clangxx -fsycl -### -fsycl-targets=spir64_gen --offload-new-driver \ | ||
| // RUN: -Xsycl-target-backend=spir64_gen "-device pvc,bdw" %s 2>&1 \ | ||
| // RUN: | FileCheck -check-prefix COMMA_FILE %s | ||
| // COMMA_FILE: clang-offload-packager{{.*}} "--image=file={{.*}}pvc@bdw{{.*}},triple=spir64_gen-unknown-unknown,arch=pvc,bdw,kind=sycl,compile-opts=-device_options pvc -ze-intel-enable-auto-large-GRF-mode" | ||
| // COMMA_FILE: clang-offload-packager{{.*}} "--image=file={{.*}}pvc@bdw{{.*}},triple=spir64_gen-unknown-unknown,arch=pvc,arch=bdw,kind=sycl,compile-opts=-device_options pvc -ze-intel-enable-auto-large-GRF-mode -device pvc,compile-opts=bdw" | ||
|
|
||
| /// Verify the arch value for the packager is populated with different | ||
| /// scenarios for spir64_gen | ||
|
|
@@ -211,6 +211,35 @@ | |
| // RUN: | FileCheck -check-prefix ARCH_CHECK %s | ||
| // ARCH_CHECK: clang-offload-packager{{.*}} "--image=file={{.*}}triple=spir64_gen-unknown-unknown,arch=bdw,kind=sycl{{.*}}" | ||
|
|
||
| // Verify when a comma-separated list of architectures is provided in -device, they are | ||
| // passed to clang-offload-packager correctly | ||
| // RUN: %clangxx -fsycl -### -fsycl-targets=spir64_gen --offload-new-driver \ | ||
| // RUN: -Xsycl-target-backend "-device pvc,bdw" %s 2>&1 \ | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Another suggestion is to document this behavior in the help text or documentation instead of adding diagnostic in the code. |
||
| // RUN: | FileCheck -check-prefix MULTI_ARCH %s | ||
| // MULTI_ARCH: clang-offload-packager{{.*}} "--image=file={{.*}}triple=spir64_gen-unknown-unknown,arch=pvc,arch=bdw,kind=sycl | ||
| // MULTI_ARCH-SAME: compile-opts=-device_options pvc -ze-intel-enable-auto-large-GRF-mode -device pvc,compile-opts=bdw" | ||
|
|
||
| // RUN: %clangxx -fsycl -### --offload-new-driver \ | ||
| // RUN: -fsycl-targets=nvptx64-nvidia-cuda,amdgcn-amd-amdhsa,spir64_gen \ | ||
| // RUN: -Xsycl-target-backend=amdgcn-amd-amdhsa --offload-arch=gfx908,gfx1010 \ | ||
| // RUN: -Xsycl-target-backend=nvptx64-nvidia-cuda --offload-arch=sm_86,sm_87,sm_89 \ | ||
| // RUN: -Xsycl-target-backend=spir64_gen "-device pvc,bdw" \ | ||
| // RUN: -Xsycl-target-linker=spir64_gen "-DFOO,BAR" \ | ||
| // RUN: -nogpulib %s 2>&1 | FileCheck -check-prefix=MULTI_ARCH2 %s | ||
| // MULTI_ARCH2: clang-offload-packager{{.*}} "--image=file={{.*}}triple=amdgcn-amd-amdhsa,arch=gfx1010,kind=sycl,compile-opts=--offload-arch=gfx908,compile-opts=gfx1010" | ||
| // MULTI_ARCH2-SAME: "--image=file={{.*}}triple=amdgcn-amd-amdhsa,arch=gfx908,kind=sycl,compile-opts=--offload-arch=gfx908,compile-opts=gfx1010" | ||
| // MULTI_ARCH2-SAME: "--image=file={{.*}}triple=nvptx64-nvidia-cuda,arch=sm_86,kind=sycl,compile-opts=--offload-arch=sm_86,compile-opts=sm_87,compile-opts=sm_89" | ||
| // MULTI_ARCH2-SAME: "--image=file={{.*}}triple=nvptx64-nvidia-cuda,arch=sm_87,kind=sycl,compile-opts=--offload-arch=sm_86,compile-opts=sm_87,compile-opts=sm_89" | ||
| // MULTI_ARCH2-SAME: "--image=file={{.*}}triple=nvptx64-nvidia-cuda,arch=sm_89,kind=sycl,compile-opts=--offload-arch=sm_86,compile-opts=sm_87,compile-opts=sm_89" | ||
| // MULTI_ARCH2-SAME: "--image=file={{.*}}triple=spir64_gen-unknown-unknown,arch=pvc,arch=bdw,kind=sycl,compile-opts=-device_options pvc -ze-intel-enable-auto-large-GRF-mode -device pvc,compile-opts=bdw,link-opts=-DFOO,link-opts=BAR" | ||
|
|
||
| // Verify that the driver correctly handles link-opt and compile-opt values with commas | ||
| // RUN: %clangxx -fsycl -### -fsycl-targets=spir64_gen --offload-new-driver \ | ||
| // RUN: -Xsycl-target-backend "-device bdw -FOO a,b" \ | ||
| // RUN: -Xsycl-target-linker "-BAR x,y" %s 2>&1 \ | ||
| // RUN: | FileCheck -check-prefix COMMA_OPTS %s | ||
| // COMMA_OPTS: clang-offload-packager{{.*}} "--image=file={{.*}}triple=spir64_gen-unknown-unknown,arch=bdw,kind=sycl,compile-opts=-device bdw -FOO a,compile-opts=b,link-opts=-BAR x,link-opts=y" | ||
|
|
||
| /// Verify that --cuda-path is passed to clang-linker-wrapper for SYCL offload | ||
| // RUN: %clangxx -fsycl -### -fsycl-targets=nvptx64-nvidia-cuda -fno-sycl-libspirv \ | ||
| // RUN: --cuda-gpu-arch=sm_20 --cuda-path=%S/Inputs/CUDA_80/usr/local/cuda %s \ | ||
|
|
||
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed the Arch arg here because it does not add the arguments when using
-Xsycl-target-backend=spir64_gen '-device pvc -FOO' -Xsycl-target-linker=spir64_gen -LFOOcorrectly; it would only add them in a case where the=spir64_genwas removed or it was using theintel_gpu_pvcsyntax.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By arguments, are you referring to the values '-device pvc -FOO' and -LFOO, getting passed to the target backend and linker, respectively?