diff options
Diffstat (limited to 'kernels/builtin_num_sub_groups.cl')
-rw-r--r-- | kernels/builtin_num_sub_groups.cl | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/kernels/builtin_num_sub_groups.cl b/kernels/builtin_num_sub_groups.cl new file mode 100644 index 00000000..08b56733 --- /dev/null +++ b/kernels/builtin_num_sub_groups.cl @@ -0,0 +1,7 @@ +__kernel void builtin_num_sub_groups(global int *dst) +{ + int lid = get_local_linear_id(); + int lsz = get_local_size(0) * get_local_size(1) * get_local_size(2); + int gid = lid + lsz*(get_num_groups(1) * get_num_groups(0) * get_group_id(2) + get_num_groups(0) * get_group_id(1) + get_group_id(0)); + dst[gid] = get_num_sub_groups(); +} |