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
123 lines
3.8 KiB
MLIR
123 lines
3.8 KiB
MLIR
// RUN: mlir-opt -split-input-file -convert-gpu-to-spirv -verify-diagnostics %s -o - | FileCheck %s
|
|
|
|
module attributes {
|
|
gpu.container_module,
|
|
spirv.target_env = #spirv.target_env<#spirv.vce<v1.3, [Shader, GroupNonUniformBallot], []>, #spirv.resource_limits<>>
|
|
} {
|
|
|
|
gpu.module @kernels {
|
|
// CHECK-LABEL: spirv.func @ballot_i32
|
|
gpu.func @ballot_i32() kernel
|
|
attributes {spirv.entry_point_abi = #spirv.entry_point_abi<workgroup_size = [32, 1, 1]>} {
|
|
%c1 = arith.constant 1 : index
|
|
%lane_id = gpu.lane_id
|
|
%pred = arith.cmpi ult, %lane_id, %c1 : index
|
|
|
|
// CHECK: %[[VEC:.*]] = spirv.GroupNonUniformBallot <Subgroup> %{{.*}} : vector<4xi32>
|
|
// CHECK: %{{.*}} = spirv.CompositeExtract %[[VEC]][0 : i32] : vector<4xi32>
|
|
%result = gpu.ballot %pred : i32
|
|
gpu.return
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
// -----
|
|
|
|
module attributes {
|
|
gpu.container_module,
|
|
spirv.target_env = #spirv.target_env<#spirv.vce<v1.3, [Shader, GroupNonUniformBallot, Int64], []>, #spirv.resource_limits<>>
|
|
} {
|
|
|
|
gpu.module @kernels {
|
|
// CHECK-LABEL: spirv.func @ballot_i64
|
|
gpu.func @ballot_i64() kernel
|
|
attributes {spirv.entry_point_abi = #spirv.entry_point_abi<workgroup_size = [32, 1, 1]>} {
|
|
%c1 = arith.constant 1 : index
|
|
%lane_id = gpu.lane_id
|
|
%pred = arith.cmpi ult, %lane_id, %c1 : index
|
|
|
|
// CHECK: %[[VEC:.*]] = spirv.GroupNonUniformBallot <Subgroup> %{{.*}} : vector<4xi32>
|
|
// CHECK: %[[LOW:.*]] = spirv.CompositeExtract %[[VEC]][0 : i32] : vector<4xi32>
|
|
// CHECK: %[[HIGH:.*]] = spirv.CompositeExtract %[[VEC]][1 : i32] : vector<4xi32>
|
|
// CHECK: %[[LOW_EXT:.*]] = spirv.UConvert %[[LOW]] : i32 to i64
|
|
// CHECK: %[[HIGH_EXT:.*]] = spirv.UConvert %[[HIGH]] : i32 to i64
|
|
// CHECK: %[[C32:.*]] = spirv.Constant 32 : i64
|
|
// CHECK: %[[HIGH_SHIFTED:.*]] = spirv.ShiftLeftLogical %[[HIGH_EXT]], %[[C32]] : i64, i64
|
|
// CHECK: %{{.*}} = spirv.BitwiseOr %[[LOW_EXT]], %[[HIGH_SHIFTED]] : i64
|
|
%result = gpu.ballot %pred : i64
|
|
gpu.return
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
// -----
|
|
|
|
module attributes {
|
|
gpu.container_module,
|
|
spirv.target_env = #spirv.target_env<#spirv.vce<v1.3, [Shader, GroupNonUniformBallot], []>, #spirv.resource_limits<>>
|
|
} {
|
|
|
|
gpu.module @kernels {
|
|
gpu.func @ballot_invalid_i8() kernel
|
|
attributes {spirv.entry_point_abi = #spirv.entry_point_abi<workgroup_size = [32, 1, 1]>} {
|
|
%c1 = arith.constant 1 : index
|
|
%lane_id = gpu.lane_id
|
|
%pred = arith.cmpi ult, %lane_id, %c1 : index
|
|
|
|
// Cannot convert i8 ballot result type
|
|
// expected-error @+1 {{failed to legalize operation 'gpu.ballot'}}
|
|
%result = gpu.ballot %pred : i8
|
|
gpu.return
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
// -----
|
|
|
|
module attributes {
|
|
gpu.container_module,
|
|
spirv.target_env = #spirv.target_env<#spirv.vce<v1.3, [Shader, GroupNonUniformBallot], []>, #spirv.resource_limits<>>
|
|
} {
|
|
|
|
gpu.module @kernels {
|
|
gpu.func @ballot_invalid_i16() kernel
|
|
attributes {spirv.entry_point_abi = #spirv.entry_point_abi<workgroup_size = [32, 1, 1]>} {
|
|
%c1 = arith.constant 1 : index
|
|
%lane_id = gpu.lane_id
|
|
%pred = arith.cmpi ult, %lane_id, %c1 : index
|
|
|
|
// Cannot convert i16 ballot result type
|
|
// expected-error @+1 {{failed to legalize operation 'gpu.ballot'}}
|
|
%result = gpu.ballot %pred : i16
|
|
gpu.return
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
// -----
|
|
|
|
module attributes {
|
|
gpu.container_module,
|
|
spirv.target_env = #spirv.target_env<#spirv.vce<v1.3, [Shader, GroupNonUniformBallot], []>, #spirv.resource_limits<>>
|
|
} {
|
|
|
|
gpu.module @kernels {
|
|
gpu.func @ballot_invalid_i128() kernel
|
|
attributes {spirv.entry_point_abi = #spirv.entry_point_abi<workgroup_size = [32, 1, 1]>} {
|
|
%c1 = arith.constant 1 : index
|
|
%lane_id = gpu.lane_id
|
|
%pred = arith.cmpi ult, %lane_id, %c1 : index
|
|
|
|
// Cannot convert i128 ballot result type
|
|
// expected-error @+1 {{failed to legalize operation 'gpu.ballot'}}
|
|
%result = gpu.ballot %pred : i128
|
|
gpu.return
|
|
}
|
|
}
|
|
|
|
}
|