[llvm-branch-commits] [libclc] libclc: Add sub_group_broadcast (PR #184846)

Wenju He via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu Mar 5 15:46:24 PST 2026


================
@@ -0,0 +1,32 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "clc/subgroup/sub_group_broadcast.h"
+
+#define CLC_SUB_GROUP_BROADCAST_IMPL(GENTYPE)                                  \
----------------
wenju-he wrote:

this file could be refined as:
```
#define __CLC_BODY <sub_group_broadcast.inc>
#include <clc/integer/gentype.inc>

#define __CLC_BODY <sub_group_broadcast.inc>
#include <clc/math/gentype.inc>
```
content in sub_group_broadcast.inc:
```

#if defined(__CLC_SCALAR) || defined(cl_khr_subgroup_extended_types)

_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE
sub_group_broadcast(__CLC_GENTYPE x, uint sub_group_local_id) {
  return __clc_sub_group_broadcast(x, sub_group_local_id);
}

#endif

```

https://github.com/llvm/llvm-project/pull/184846


More information about the llvm-branch-commits mailing list