CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
99 lines
5.3 KiB
LLVM
99 lines
5.3 KiB
LLVM
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 6
|
|
; RUN: opt < %s -S -mtriple=nvptx-nvidia-cuda -mcpu=sm_100 -passes=nvvm-intr-range | FileCheck %s
|
|
|
|
; When .reqnctapercluster specifies 3D dimensions, cluster_nctaid.x/y/z and
|
|
; cluster_nctarank should be replaced with constants, and cluster_ctaid.x/y/z
|
|
; should get per-dimension ranges.
|
|
define ptx_kernel i32 @test_cluster_dim_3d() "nvvm.cluster_dim"="4,2,1" {
|
|
; CHECK-LABEL: define ptx_kernel i32 @test_cluster_dim_3d(
|
|
; CHECK-SAME: ) #[[ATTR0:[0-9]+]] {
|
|
; CHECK-NEXT: [[CTAID_X:%.*]] = call range(i32 0, 4) i32 @llvm.nvvm.read.ptx.sreg.cluster.ctaid.x()
|
|
; CHECK-NEXT: [[CTAID_Y:%.*]] = call range(i32 0, 2) i32 @llvm.nvvm.read.ptx.sreg.cluster.ctaid.y()
|
|
; CHECK-NEXT: [[CTAID_Z:%.*]] = call range(i32 0, 1) i32 @llvm.nvvm.read.ptx.sreg.cluster.ctaid.z()
|
|
; CHECK-NEXT: [[NCTAID_X:%.*]] = call range(i32 4, 5) i32 @llvm.nvvm.read.ptx.sreg.cluster.nctaid.x()
|
|
; CHECK-NEXT: [[NCTAID_Y:%.*]] = call range(i32 2, 3) i32 @llvm.nvvm.read.ptx.sreg.cluster.nctaid.y()
|
|
; CHECK-NEXT: [[NCTAID_Z:%.*]] = call range(i32 1, 2) i32 @llvm.nvvm.read.ptx.sreg.cluster.nctaid.z()
|
|
; CHECK-NEXT: [[RANK:%.*]] = call range(i32 0, 8) i32 @llvm.nvvm.read.ptx.sreg.cluster.ctarank()
|
|
; CHECK-NEXT: [[NRANK:%.*]] = call range(i32 8, 9) i32 @llvm.nvvm.read.ptx.sreg.cluster.nctarank()
|
|
; CHECK-NEXT: [[A:%.*]] = add i32 [[CTAID_X]], [[CTAID_Y]]
|
|
; CHECK-NEXT: [[B:%.*]] = add i32 [[A]], [[CTAID_Z]]
|
|
; CHECK-NEXT: [[C:%.*]] = add i32 [[B]], [[NCTAID_X]]
|
|
; CHECK-NEXT: [[D:%.*]] = add i32 [[C]], [[NCTAID_Y]]
|
|
; CHECK-NEXT: [[E:%.*]] = add i32 [[D]], [[NCTAID_Z]]
|
|
; CHECK-NEXT: [[F:%.*]] = add i32 [[E]], [[RANK]]
|
|
; CHECK-NEXT: [[G:%.*]] = add i32 [[F]], [[NRANK]]
|
|
; CHECK-NEXT: ret i32 [[G]]
|
|
;
|
|
%ctaid.x = call i32 @llvm.nvvm.read.ptx.sreg.cluster.ctaid.x()
|
|
%ctaid.y = call i32 @llvm.nvvm.read.ptx.sreg.cluster.ctaid.y()
|
|
%ctaid.z = call i32 @llvm.nvvm.read.ptx.sreg.cluster.ctaid.z()
|
|
%nctaid.x = call i32 @llvm.nvvm.read.ptx.sreg.cluster.nctaid.x()
|
|
%nctaid.y = call i32 @llvm.nvvm.read.ptx.sreg.cluster.nctaid.y()
|
|
%nctaid.z = call i32 @llvm.nvvm.read.ptx.sreg.cluster.nctaid.z()
|
|
%rank = call i32 @llvm.nvvm.read.ptx.sreg.cluster.ctarank()
|
|
%nrank = call i32 @llvm.nvvm.read.ptx.sreg.cluster.nctarank()
|
|
%a = add i32 %ctaid.x, %ctaid.y
|
|
%b = add i32 %a, %ctaid.z
|
|
%c = add i32 %b, %nctaid.x
|
|
%d = add i32 %c, %nctaid.y
|
|
%e = add i32 %d, %nctaid.z
|
|
%f = add i32 %e, %rank
|
|
%g = add i32 %f, %nrank
|
|
ret i32 %g
|
|
}
|
|
|
|
; When .reqnctapercluster specifies only 1D, y and z default to 1.
|
|
define ptx_kernel i32 @test_cluster_dim_1d() "nvvm.cluster_dim"="4" {
|
|
; CHECK-LABEL: define ptx_kernel i32 @test_cluster_dim_1d(
|
|
; CHECK-SAME: ) #[[ATTR1:[0-9]+]] {
|
|
; CHECK-NEXT: [[CTAID_X:%.*]] = call range(i32 0, 4) i32 @llvm.nvvm.read.ptx.sreg.cluster.ctaid.x()
|
|
; CHECK-NEXT: [[CTAID_Y:%.*]] = call range(i32 0, 1) i32 @llvm.nvvm.read.ptx.sreg.cluster.ctaid.y()
|
|
; CHECK-NEXT: [[CTAID_Z:%.*]] = call range(i32 0, 1) i32 @llvm.nvvm.read.ptx.sreg.cluster.ctaid.z()
|
|
; CHECK-NEXT: [[NCTAID_X:%.*]] = call range(i32 4, 5) i32 @llvm.nvvm.read.ptx.sreg.cluster.nctaid.x()
|
|
; CHECK-NEXT: [[NCTAID_Y:%.*]] = call range(i32 1, 2) i32 @llvm.nvvm.read.ptx.sreg.cluster.nctaid.y()
|
|
; CHECK-NEXT: [[NCTAID_Z:%.*]] = call range(i32 1, 2) i32 @llvm.nvvm.read.ptx.sreg.cluster.nctaid.z()
|
|
; CHECK-NEXT: [[A:%.*]] = add i32 [[CTAID_X]], [[CTAID_Y]]
|
|
; CHECK-NEXT: [[B:%.*]] = add i32 [[A]], [[CTAID_Z]]
|
|
; CHECK-NEXT: [[C:%.*]] = add i32 [[B]], [[NCTAID_X]]
|
|
; CHECK-NEXT: [[D:%.*]] = add i32 [[C]], [[NCTAID_Y]]
|
|
; CHECK-NEXT: [[E:%.*]] = add i32 [[D]], [[NCTAID_Z]]
|
|
; CHECK-NEXT: ret i32 [[E]]
|
|
;
|
|
%ctaid.x = call i32 @llvm.nvvm.read.ptx.sreg.cluster.ctaid.x()
|
|
%ctaid.y = call i32 @llvm.nvvm.read.ptx.sreg.cluster.ctaid.y()
|
|
%ctaid.z = call i32 @llvm.nvvm.read.ptx.sreg.cluster.ctaid.z()
|
|
%nctaid.x = call i32 @llvm.nvvm.read.ptx.sreg.cluster.nctaid.x()
|
|
%nctaid.y = call i32 @llvm.nvvm.read.ptx.sreg.cluster.nctaid.y()
|
|
%nctaid.z = call i32 @llvm.nvvm.read.ptx.sreg.cluster.nctaid.z()
|
|
%a = add i32 %ctaid.x, %ctaid.y
|
|
%b = add i32 %a, %ctaid.z
|
|
%c = add i32 %b, %nctaid.x
|
|
%d = add i32 %c, %nctaid.y
|
|
%e = add i32 %d, %nctaid.z
|
|
ret i32 %e
|
|
}
|
|
|
|
; maxclusterrank is still an upper bound, not an exact cluster shape.
|
|
define ptx_kernel i32 @test_maxclusterrank() "nvvm.maxclusterrank"="8" {
|
|
; CHECK-LABEL: define ptx_kernel i32 @test_maxclusterrank(
|
|
; CHECK-SAME: ) #[[ATTR2:[0-9]+]] {
|
|
; CHECK-NEXT: [[NCTAID_X:%.*]] = call range(i32 1, 9) i32 @llvm.nvvm.read.ptx.sreg.cluster.nctaid.x()
|
|
; CHECK-NEXT: [[NRANK:%.*]] = call range(i32 1, 9) i32 @llvm.nvvm.read.ptx.sreg.cluster.nctarank()
|
|
; CHECK-NEXT: [[A:%.*]] = add i32 [[NCTAID_X]], [[NRANK]]
|
|
; CHECK-NEXT: ret i32 [[A]]
|
|
;
|
|
%nctaid.x = call i32 @llvm.nvvm.read.ptx.sreg.cluster.nctaid.x()
|
|
%nrank = call i32 @llvm.nvvm.read.ptx.sreg.cluster.nctarank()
|
|
%a = add i32 %nctaid.x, %nrank
|
|
ret i32 %a
|
|
}
|
|
|
|
declare i32 @llvm.nvvm.read.ptx.sreg.cluster.ctaid.x()
|
|
declare i32 @llvm.nvvm.read.ptx.sreg.cluster.ctaid.y()
|
|
declare i32 @llvm.nvvm.read.ptx.sreg.cluster.ctaid.z()
|
|
declare i32 @llvm.nvvm.read.ptx.sreg.cluster.nctaid.x()
|
|
declare i32 @llvm.nvvm.read.ptx.sreg.cluster.nctaid.y()
|
|
declare i32 @llvm.nvvm.read.ptx.sreg.cluster.nctaid.z()
|
|
declare i32 @llvm.nvvm.read.ptx.sreg.cluster.ctarank()
|
|
declare i32 @llvm.nvvm.read.ptx.sreg.cluster.nctarank()
|