-
Notifications
You must be signed in to change notification settings - Fork 801
[SYCL] Enable FTZ operations for CUDA/PTX backend via -fcuda-flush-denormals-to-zero #6411
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
Changes from all commits
f7f2faa
d78d213
2b0c3dc
01185af
77c2fd9
e28b133
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3003,6 +3003,11 @@ static void RenderFloatingPointOptions(const ToolChain &TC, const Driver &D, | |
| RoundingMathPresent = false; | ||
| break; | ||
|
|
||
| case options::OPT_fcuda_flush_denormals_to_zero: | ||
| case options::OPT_fgpu_flush_denormals_to_zero: | ||
| DenormalFP32Math = llvm::DenormalMode::getPreserveSign(); | ||
| break; | ||
|
Contributor
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. Could you add a driver test verifying the expect values when the options are set?
Contributor
Author
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. @mdtoguchi Do you prefer a separate test for this, or should I add it to the clang/test/Driver/fp-model.c? |
||
|
|
||
| case options::OPT_fdenormal_fp_math_EQ: | ||
| DenormalFPMath = llvm::parseDenormalFPAttribute(A->getValue()); | ||
| DenormalFP32Math = DenormalFPMath; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| // RUN: %clang_cc1 -fcuda-is-device -fdenormal-fp-math-f32=preserve-sign \ | ||
| // RUN: -triple nvptx-nvidia-cuda -emit-llvm -o - %s | \ | ||
| // RUN: FileCheck -check-prefixes=FTZ32,PTXFTZ32 %s | ||
|
|
||
| // RUN: %clang_cc1 -fcuda-is-device -fdenormal-fp-math=preserve-sign \ | ||
| // RUN: -triple nvptx-nvidia-cuda -emit-llvm -o - %s | \ | ||
| // RUN: FileCheck -check-prefixes=FTZ,PTXFTZ %s | ||
|
|
||
| // CHECK-LABEL: define void @_Z3foov() #0 | ||
| void foo() {} | ||
|
|
||
| // FTZ32: attributes #0 = {{.*}} "denormal-fp-math-f32"="preserve-sign,preserve-sign" | ||
| // PTXFTZ32:!llvm.module.flags = !{{{.*}}, [[MODFLAG:![0-9]+]], {{.*}}} | ||
| // PTXFTZ32:[[MODFLAG]] = !{i32 4, !"nvvm-reflect-ftz", i32 1} | ||
|
|
||
| // FTZ: attributes #0 = {{.*}} "denormal-fp-math"="preserve-sign,preserve-sign" | ||
| // PTXFTZ:!llvm.module.flags = !{{{.*}}, [[MODFLAG:![0-9]+]], {{.*}}} | ||
| // PTXFTZ:[[MODFLAG]] = !{i32 4, !"nvvm-reflect-ftz", i32 1} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| // RUN: %clang -### -fcuda-flush-denormals-to-zero -c %s 2>&1 \ | ||
| // RUN: | FileCheck --check-prefix=CHECK-FTZ %s | ||
| // CHECK-FTZ: "-cc1" | ||
| // CHECK-FTZ: "-fdenormal-fp-math-f32=preserve-sign,preserve-sign" |
Uh oh!
There was an error while loading. Please reload this page.