amdgcn-amdhsa: Add get_num_groups implementation

llvm-svn: 281792
This commit is contained in:
Tom Stellard 2016-09-16 22:43:31 +00:00
parent e7ad23bad3
commit f19cf403c4
3 changed files with 14 additions and 0 deletions

View File

@ -0,0 +1 @@
workitem/get_num_groups.ll

View File

@ -1,2 +1,3 @@
workitem/get_global_size.ll
workitem/get_local_size.ll
workitem/get_num_groups.cl

View File

@ -0,0 +1,12 @@
#include <clc/clc.h>
_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;
}