[Libclc-dev] [PATCH 2/3] amdgcn-amdhsa: Add get_num_groups implementation
Matt Arsenault via Libclc-dev
libclc-dev at lists.llvm.org
Wed Sep 14 07:58:03 PDT 2016
> On Sep 14, 2016, at 07:22, Tom Stellard via Libclc-dev <libclc-dev at lists.llvm.org> wrote:
>
> +_CLC_DEF size_t get_num_groups(uint dim) {
> + size_t global_size = get_global_size(dim);
> + size_t local_size = get_local_size(dim);
> + size_t num_groups = global_size / local_size;
> + if (global_size % local_size != 0) {
> + num_groups++;
> + }
> + return num_groups;
LGTM. I hope the % does get optimized out?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/libclc-dev/attachments/20160914/43c3f1af/attachment.html>
More information about the Libclc-dev
mailing list