|
| 1 | +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5 |
| 2 | +; RUN: llc < %s -mtriple=nvptx64 -mcpu=sm_100 | FileCheck %s |
| 3 | + |
| 4 | +target triple = "nvptx64-nvidia-cuda" |
| 5 | + |
| 6 | +; Test "blocksareclusters" attribute with full "reqntid" and "cluster_dim" |
| 7 | +; attributes. |
| 8 | +define ptx_kernel void @kernel1(i32* %input, i32* %output) #0 #1 #2 { |
| 9 | +; CHECK-LABEL: kernel1( |
| 10 | +; CHECK: .blocksareclusters |
| 11 | +; CHECK-NEXT: .reqntid 1024, 1, 1 |
| 12 | +; CHECK-NEXT: .reqnctapercluster 2, 2, 2 |
| 13 | +; CHECK-NEXT: { |
| 14 | +; CHECK-EMPTY: |
| 15 | +; CHECK-EMPTY: |
| 16 | +; CHECK-NEXT: // %bb.0: |
| 17 | +; CHECK-NEXT: ret; |
| 18 | + ret void |
| 19 | +} |
| 20 | + |
| 21 | +; Test "blocksareclusters" attribute with single dimension "reqntid" and |
| 22 | +; "cluster_dim" attributes. |
| 23 | +define ptx_kernel void @kernel2(i32* %input, i32* %output) #0 #3 #4 { |
| 24 | +; CHECK-LABEL: kernel2( |
| 25 | +; CHECK: .blocksareclusters |
| 26 | +; CHECK-NEXT: .reqntid 1024 |
| 27 | +; CHECK-NEXT: .reqnctapercluster 2 // @kernel2 |
| 28 | +; CHECK-NEXT: { |
| 29 | +; CHECK-EMPTY: |
| 30 | +; CHECK-EMPTY: |
| 31 | +; CHECK-NEXT: // %bb.0: |
| 32 | +; CHECK-NEXT: ret; |
| 33 | + ret void |
| 34 | +} |
| 35 | + |
| 36 | +; Test "blocksareclusters" attribute with two dimensions(not z dimension) |
| 37 | +; "reqntid" and "cluster_dim" attributes. |
| 38 | +define ptx_kernel void @kernel3(i32* %input, i32* %output) #0 #5 #6 { |
| 39 | +; CHECK-LABEL: kernel3( |
| 40 | +; CHECK: .blocksareclusters |
| 41 | +; CHECK-NEXT: .reqntid 512, 2 |
| 42 | +; CHECK-NEXT: .reqnctapercluster 2, 2 // @kernel3 |
| 43 | +; CHECK-NEXT: { |
| 44 | +; CHECK-EMPTY: |
| 45 | +; CHECK-EMPTY: |
| 46 | +; CHECK-NEXT: // %bb.0: |
| 47 | +; CHECK-NEXT: ret; |
| 48 | + ret void |
| 49 | +} |
| 50 | + |
| 51 | +; Test "blocksareclusters" attribute with full "reqntid" and "cluster_dim" |
| 52 | +; attributes where kernel attribute is provided through metadata. |
| 53 | +define void @kernel4(i32* %input, i32* %output) #0 #1 #2 { |
| 54 | +; CHECK-LABEL: kernel4( |
| 55 | +; CHECK: .blocksareclusters |
| 56 | +; CHECK-NEXT: .reqntid 1024, 1, 1 |
| 57 | +; CHECK-NEXT: .reqnctapercluster 2, 2, 2 // @kernel4 |
| 58 | +; CHECK-NEXT: { |
| 59 | +; CHECK-EMPTY: |
| 60 | +; CHECK-EMPTY: |
| 61 | +; CHECK-NEXT: // %bb.0: |
| 62 | +; CHECK-NEXT: ret; |
| 63 | + ret void |
| 64 | +} |
| 65 | + |
| 66 | +attributes #0 = { "nvvm.blocksareclusters" } |
| 67 | + |
| 68 | +attributes #1 = { "nvvm.reqntid"="1024,1,1" } |
| 69 | +attributes #2 = { "nvvm.cluster_dim"="2,2,2" } |
| 70 | + |
| 71 | +attributes #3 = { "nvvm.reqntid"="1024" } |
| 72 | +attributes #4 = { "nvvm.cluster_dim"="2" } |
| 73 | + |
| 74 | +attributes #5 = { "nvvm.reqntid"="512,2" } |
| 75 | +attributes #6 = { "nvvm.cluster_dim"="2,2" } |
| 76 | + |
| 77 | +!0 = !{void (i32*, i32*)* @kernel4, !"kernel", i32 1 } |
| 78 | +!nvvm.annotations = !{!0} |
0 commit comments