-
Notifications
You must be signed in to change notification settings - Fork 787
[SYCL] Add extension and implement fp control kernel property #11591
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
aelovikov-intel
merged 21 commits into
intel:sycl
from
againull:fp_control_via_kernel_level_attr
Nov 16, 2023
Merged
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
238db10
[SYCL] Add extension and implement fp control kernel property
againull ad7f528
Fix extension doc
againull 837038f
Merge remote-tracking branch 'origin/sycl' into fp_control
againull 5da85a4
Remove unnecessary alt/ieee mode control
againull 8bcafca
Rename rounding modes per suggestion
againull e57c0f6
Formatting
againull 9c0942e
Formatting
againull 74e4f76
Use hash from main vc-intrinsics repo
againull 3245ce9
Fix mistakes in the ext doc
againull 8e59a60
Update vc-intrinsics verson
againull 6c5e7c6
Address review
againull 984d1a0
Address review comments
againull 63648b6
Merge remote-tracking branch 'origin/sycl' into fp_control_via_kernel…
againull 6e43f85
Formatting
againull 8b15828
Revert frontend changes
againull 1d9b26e
Fix extension doc
againull 95bea00
Add static assert for non-ESIMD kernel
againull b67a66a
Revert remaining frontend changes
againull c846e7c
Fix EOL
againull 69f6e0d
Added suggested parenthese to fix werror fails
againull 2fcad9f
Fix lit tests
againull 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,10 +13,11 @@ endif() | |
if (NOT TARGET LLVMGenXIntrinsics) | ||
if (NOT DEFINED LLVMGenXIntrinsics_SOURCE_DIR) | ||
set(LLVMGenXIntrinsics_GIT_REPO https://github.com/intel/vc-intrinsics.git) | ||
# Author: Jinsong Ji <[email protected]> | ||
# Date: Thu Aug 10 14:41:52 2023 +0000 | ||
# Guard removed typed pointer enum within version macro | ||
set(LLVMGenXIntrinsics_GIT_TAG 17a53f4304463b8e7e639d57ef17479040a8a2ad) | ||
# Author: Artur Gainullin <[email protected]> | ||
# Date: Thu Nov 9 00:37:24 2023 +0000 | ||
|
||
# Replace old kernel with rewritten kernel in metadata only since LLVM 17 | ||
set(LLVMGenXIntrinsics_GIT_TAG a8403355ada112b72d1fc7db29fd04325eecee60) | ||
|
||
message(STATUS "vc-intrinsics repo is missing. Will try to download it from ${LLVMGenXIntrinsics_GIT_REPO}") | ||
include(FetchContent) | ||
|
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
156 changes: 156 additions & 0 deletions
156
llvm/test/SYCLLowerIR/CompileTimePropertiesPass/fp-control-kernel-properties.ll
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,156 @@ | ||
; RUN: opt -passes=compile-time-properties %s -S | FileCheck %s | ||
|
||
|
||
define spir_kernel void @"Kernel0"() #0 { | ||
entry: | ||
ret void | ||
} | ||
|
||
define spir_kernel void @"Kernel1"() #1 { | ||
entry: | ||
ret void | ||
} | ||
|
||
define spir_kernel void @"Kernel2"() #2 { | ||
entry: | ||
ret void | ||
} | ||
|
||
define spir_kernel void @"Kernel3"() #3 { | ||
entry: | ||
ret void | ||
} | ||
|
||
define spir_kernel void @"Kernel4"() #4 { | ||
entry: | ||
ret void | ||
} | ||
|
||
define spir_kernel void @"Kernel5"() #5 { | ||
entry: | ||
ret void | ||
} | ||
|
||
define spir_kernel void @"Kernel6"() #6 { | ||
entry: | ||
ret void | ||
} | ||
|
||
define spir_kernel void @"Kernel7"() #7 { | ||
entry: | ||
ret void | ||
} | ||
|
||
define spir_kernel void @"Kernel8"() #8 { | ||
entry: | ||
ret void | ||
} | ||
|
||
define spir_kernel void @"Kernel9"() #9 { | ||
entry: | ||
ret void | ||
} | ||
|
||
define spir_kernel void @"Kernel10"() #10 { | ||
entry: | ||
ret void | ||
} | ||
|
||
; SPIRV execution modes for FP control. | BitMask | ||
; ROUNDING_MODE_RTE = 4462; | 00000001 | ||
; ROUNDING_MODE_RTP_INTEL = 5620; | 00000010 | ||
; ROUNDING_MODE_RTN_INTEL = 5621; | 00000100 | ||
; ROUNDING_MODE_RTZ = 4463; | 00001000 | ||
; DEMORM_FLUSH_TO_ZERO = 4460; | 00010000 | ||
; DENORM_PRESERVE (double) = 4459; | 00100000 | ||
; DENORM_PRESERVE (float) = 4459; | 01000000 | ||
; DENORM_PRESERVE (half) = 4459; | 10000000 | ||
|
||
; rte + ftz (Default) | ||
; CHECK: !0 = !{ptr @Kernel0, i32 [[RTE:4462]], i32 64} | ||
; CHECK: !1 = !{ptr @Kernel0, i32 [[RTE]], i32 32} | ||
; CHECK: !2 = !{ptr @Kernel0, i32 [[RTE]], i32 16} | ||
; CHECK: !3 = !{ptr @Kernel0, i32 [[FTZ:4460]], i32 64} | ||
; CHECK: !4 = !{ptr @Kernel0, i32 [[FTZ]], i32 32} | ||
; CHECK: !5 = !{ptr @Kernel0, i32 [[FTZ]], i32 16} | ||
attributes #0 = { "sycl-floating-point-control"="17" } | ||
|
||
; rtp + ftz | ||
; CHECK: !6 = !{ptr @Kernel1, i32 [[RTP:5620]], i32 64} | ||
; CHECK: !7 = !{ptr @Kernel1, i32 [[RTP]], i32 32} | ||
; CHECK: !8 = !{ptr @Kernel1, i32 [[RTP]], i32 16} | ||
; CHECK: !9 = !{ptr @Kernel1, i32 [[FTZ]], i32 64} | ||
; CHECK: !10 = !{ptr @Kernel1, i32 [[FTZ]], i32 32} | ||
; CHECK: !11 = !{ptr @Kernel1, i32 [[FTZ]], i32 16} | ||
attributes #1 = { "sycl-floating-point-control"="18" } | ||
|
||
; rtn + ftz | ||
; CHECK: !12 = !{ptr @Kernel2, i32 [[RTN:5621]], i32 64} | ||
; CHECK: !13 = !{ptr @Kernel2, i32 [[RTN]], i32 32} | ||
; CHECK: !14 = !{ptr @Kernel2, i32 [[RTN]], i32 16} | ||
; CHECK: !15 = !{ptr @Kernel2, i32 [[FTZ]], i32 64} | ||
; CHECK: !16 = !{ptr @Kernel2, i32 [[FTZ]], i32 32} | ||
; CHECK: !17 = !{ptr @Kernel2, i32 [[FTZ]], i32 16} | ||
attributes #2 = { "sycl-floating-point-control"="20" } | ||
|
||
; rtz + ftz | ||
; CHECK: !18 = !{ptr @Kernel3, i32 [[RTZ:4463]], i32 64} | ||
; CHECK: !19 = !{ptr @Kernel3, i32 [[RTZ]], i32 32} | ||
; CHECK: !20 = !{ptr @Kernel3, i32 [[RTZ]], i32 16} | ||
; CHECK: !21 = !{ptr @Kernel3, i32 [[FTZ]], i32 64} | ||
; CHECK: !22 = !{ptr @Kernel3, i32 [[FTZ]], i32 32} | ||
; CHECK: !23 = !{ptr @Kernel3, i32 [[FTZ]], i32 16} | ||
attributes #3 = { "sycl-floating-point-control"="24" } | ||
|
||
; rte + denorm_preserve(double) | ||
; CHECK: !24 = !{ptr @Kernel4, i32 [[RTE]], i32 64} | ||
; CHECK: !25 = !{ptr @Kernel4, i32 [[RTE]], i32 32} | ||
; CHECK: !26 = !{ptr @Kernel4, i32 [[RTE]], i32 16} | ||
; CHECK: !27 = !{ptr @Kernel4, i32 [[DENORM_PRESERVE:4459]], i32 64} | ||
attributes #4 = { "sycl-floating-point-control"="33" } | ||
|
||
; rte + denorm_preserve(float) | ||
; CHECK: !28 = !{ptr @Kernel5, i32 [[RTE]], i32 64} | ||
; CHECK: !29 = !{ptr @Kernel5, i32 [[RTE]], i32 32} | ||
; CHECK: !30 = !{ptr @Kernel5, i32 [[RTE]], i32 16} | ||
; CHECK: !31 = !{ptr @Kernel5, i32 [[DENORM_PRESERVE]], i32 32} | ||
attributes #5 = { "sycl-floating-point-control"="65" } | ||
|
||
; rte + denorm_preserve(half) | ||
; CHECK: !32 = !{ptr @Kernel6, i32 [[RTE]], i32 64} | ||
; CHECK: !33 = !{ptr @Kernel6, i32 [[RTE]], i32 32} | ||
; CHECK: !34 = !{ptr @Kernel6, i32 [[RTE]], i32 16} | ||
; CHECK: !35 = !{ptr @Kernel6, i32 [[DENORM_PRESERVE]], i32 16} | ||
attributes #6 = { "sycl-floating-point-control"="129" } | ||
|
||
; rte + denorm_allow | ||
; CHECK: !36 = !{ptr @Kernel7, i32 [[RTE]], i32 64} | ||
; CHECK: !37 = !{ptr @Kernel7, i32 [[RTE]], i32 32} | ||
; CHECK: !38 = !{ptr @Kernel7, i32 [[RTE]], i32 16} | ||
; CHECK: !39 = !{ptr @Kernel7, i32 [[DENORM_PRESERVE]], i32 16} | ||
; CHECK: !40 = !{ptr @Kernel7, i32 [[DENORM_PRESERVE]], i32 32} | ||
; CHECK: !41 = !{ptr @Kernel7, i32 [[DENORM_PRESERVE]], i32 64} | ||
attributes #7 = { "sycl-floating-point-control"="225" } | ||
|
||
; rtz + denorm_preserve(double) | ||
; CHECK: !42 = !{ptr @Kernel8, i32 [[RTZ]], i32 64} | ||
; CHECK: !43 = !{ptr @Kernel8, i32 [[RTZ]], i32 32} | ||
; CHECK: !44 = !{ptr @Kernel8, i32 [[RTZ]], i32 16} | ||
; CHECK: !45 = !{ptr @Kernel8, i32 [[DENORM_PRESERVE]], i32 64} | ||
attributes #8 = { "sycl-floating-point-control"="40" } | ||
|
||
; rtp + denorm_preserve(float) | ||
; CHECK: !46 = !{ptr @Kernel9, i32 [[RTP]], i32 64} | ||
; CHECK: !47 = !{ptr @Kernel9, i32 [[RTP]], i32 32} | ||
; CHECK: !48 = !{ptr @Kernel9, i32 [[RTP]], i32 16} | ||
; CHECK: !49 = !{ptr @Kernel9, i32 [[DENORM_PRESERVE]], i32 32} | ||
attributes #9 = { "sycl-floating-point-control"="66" } | ||
|
||
; rtz + denorm_allow | ||
; CHECK: !50 = !{ptr @Kernel10, i32 [[RTZ]], i32 64} | ||
; CHECK: !51 = !{ptr @Kernel10, i32 [[RTZ]], i32 32} | ||
; CHECK: !52 = !{ptr @Kernel10, i32 [[RTZ]], i32 16} | ||
; CHECK: !53 = !{ptr @Kernel10, i32 [[DENORM_PRESERVE]], i32 16} | ||
; CHECK: !54 = !{ptr @Kernel10, i32 [[DENORM_PRESERVE]], i32 32} | ||
; CHECK: !55 = !{ptr @Kernel10, i32 [[DENORM_PRESERVE]], i32 64} | ||
attributes #10 = { "sycl-floating-point-control"="232" } |
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
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.
Uh oh!
There was an error while loading. Please reload this page.