-
Notifications
You must be signed in to change notification settings - Fork 793
[SYCL] Add -fsycl-fp32-prec-sqrt flag #5309
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 all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
57dcd40
[SYCL] Add -fsycl-fp32-prec-sqrt flag
npmiller eb27453
[SYCL] Update command line help text
npmiller f90cb8d
[SYCL] Add test for unused argument warning
npmiller 5cebae7
Update clang/lib/Driver/ToolChains/HIPSPV.h
npmiller 71e578a
Update clang/lib/Driver/ToolChain.cpp
npmiller b701652
[SYCL] Fix formatting
npmiller eb0abf2
[SYCL] sycl-nvptx-sqrt.cpp test works on Windows
npmiller 486eef3
Update clang/lib/Driver/ToolChains/AMDGPU.cpp
npmiller db77ba8
[SYCL] Fix formatting
npmiller 0ff1e21
[SYCL] Check conflicting flag on AMD
npmiller 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
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
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
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
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,35 @@ | ||
// REQUIRES: clang-driver | ||
// REQUIRES: amdgpu-registered-target | ||
// REQUIRES: !system-windows | ||
|
||
// RUN: %clang -### \ | ||
// RUN: -fsycl -fsycl-targets=amdgcn-amd-amdhsa \ | ||
// RUN: -Xsycl-target-backend --offload-arch=gfx900 \ | ||
// RUN: -fsycl-fp32-prec-sqrt \ | ||
// RUN: --rocm-path=%S/Inputs/rocm \ | ||
// RUN: %s \ | ||
// RUN: 2>&1 | FileCheck --check-prefix=CHECK-CORRECT %s | ||
|
||
// CHECK-CORRECT: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/oclc_correctly_rounded_sqrt_on.bc" | ||
|
||
// RUN: %clang -### \ | ||
// RUN: -fsycl -fsycl-targets=amdgcn-amd-amdhsa \ | ||
// RUN: -Xsycl-target-backend --offload-arch=gfx900 \ | ||
// RUN: --rocm-path=%S/Inputs/rocm \ | ||
// RUN: %s \ | ||
// RUN: 2>&1 | FileCheck --check-prefix=CHECK-APPROX %s | ||
|
||
// CHECK-APPROX: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/oclc_correctly_rounded_sqrt_off.bc" | ||
|
||
// RUN: %clang -### \ | ||
// RUN: -fsycl -fsycl-targets=amdgcn-amd-amdhsa \ | ||
// RUN: -Xsycl-target-backend --offload-arch=gfx900 \ | ||
// RUN: -fsycl-fp32-prec-sqrt -fno-hip-fp32-correctly-rounded-divide-sqrt \ | ||
// RUN: --rocm-path=%S/Inputs/rocm \ | ||
// RUN: %s \ | ||
// RUN: 2>&1 | FileCheck --check-prefix=CHECK-CONFLICT %s | ||
|
||
// CHECK-CONFLICT: warning: argument unused during compilation: '-fno-hip-fp32-correctly-rounded-divide-sqrt' | ||
// CHECK-CONFLICT: "-mlink-builtin-bitcode" "{{.*}}/amdgcn/bitcode/oclc_correctly_rounded_sqrt_on.bc" | ||
|
||
void func(){}; |
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,17 @@ | ||
// REQUIRES: clang-driver | ||
|
||
// RUN: %clang -### -fsycl \ | ||
// RUN: -fsycl-fp32-prec-sqrt %s 2>&1 | FileCheck %s | ||
|
||
// RUN: %clang -### -fsycl -fsycl-targets=spir64_gen \ | ||
// RUN: -fsycl-fp32-prec-sqrt %s 2>&1 | FileCheck %s | ||
// | ||
// RUN: %clang -### -fsycl -fsycl-targets=spir64_x86_64 \ | ||
// RUN: -fsycl-fp32-prec-sqrt %s 2>&1 | FileCheck %s | ||
// | ||
// RUN: %clang -### -fsycl -fsycl-targets=spir64_fpga \ | ||
// RUN: -fsycl-fp32-prec-sqrt %s 2>&1 | FileCheck %s | ||
|
||
// CHECK: warning: argument unused during compilation: '-fsycl-fp32-prec-sqrt' | ||
|
||
void func(){}; |
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,19 @@ | ||
// REQUIRES: clang-driver | ||
// REQUIRES: nvptx-registered-target | ||
|
||
// RUN: %clang -### \ | ||
// RUN: -fsycl -fsycl-targets=nvptx64-nvidia-cuda \ | ||
// RUN: -fsycl-fp32-prec-sqrt \ | ||
// RUN: %s \ | ||
// RUN: 2>&1 | FileCheck --check-prefix=CHECK-CORRECT %s | ||
|
||
// CHECK-CORRECT: "-fcuda-prec-sqrt" | ||
|
||
// RUN: %clang -### \ | ||
// RUN: -fsycl -fsycl-targets=nvptx64-nvidia-cuda \ | ||
// RUN: %s \ | ||
// RUN: 2>&1 | FileCheck --check-prefix=CHECK-APPROX %s | ||
|
||
// CHECK-APPROX-NOT: "-fcuda-prec-sqrt" | ||
|
||
void func(){}; |
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
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.