From 13b8af95fb7b9e235bdbbc9ec871bfd849b6cf29 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Thu, 12 Dec 2024 07:16:31 -0500 Subject: [PATCH] clc: plumb cl_khr_subgroup_ballot although rusticl isn't lighting it up yet, it's helpful to get sub_group_ballot for driver CL, which is all standard Vulkan-compatible spirv. Signed-off-by: Alyssa Rosenzweig Reviewed-by: Karol Herbst Part-of: --- src/compiler/clc/clc.h | 1 + src/compiler/clc/clc_helpers.cpp | 3 +++ 2 files changed, 4 insertions(+) diff --git a/src/compiler/clc/clc.h b/src/compiler/clc/clc.h index a41c365838e..9e8604c0953 100644 --- a/src/compiler/clc/clc.h +++ b/src/compiler/clc/clc.h @@ -71,6 +71,7 @@ struct clc_optional_features { bool subgroups_ifp; bool subgroups_shuffle; bool subgroups_shuffle_relative; + bool subgroups_ballot; }; struct clc_compile_args { diff --git a/src/compiler/clc/clc_helpers.cpp b/src/compiler/clc/clc_helpers.cpp index 836439fe105..bec802b1317 100644 --- a/src/compiler/clc/clc_helpers.cpp +++ b/src/compiler/clc/clc_helpers.cpp @@ -1001,6 +1001,9 @@ clc_compile_to_llvm_module(LLVMContext &llvm_ctx, if (args->features.subgroups_shuffle_relative) { c->getPreprocessorOpts().addMacroDef("cl_khr_subgroup_shuffle_relative=1"); } + if (args->features.subgroups_ballot) { + c->getPreprocessorOpts().addMacroDef("cl_khr_subgroup_ballot=1"); + } } if (args->features.subgroups_ifp) { assert(args->features.subgroups);