mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-04-03 05:32:24 +00:00
amdgcn-amdhsa: Add get_num_groups implementation
llvm-svn: 281792
This commit is contained in:
parent
e7ad23bad3
commit
f19cf403c4
@ -0,0 +1 @@
|
||||
workitem/get_num_groups.ll
|
@ -1,2 +1,3 @@
|
||||
workitem/get_global_size.ll
|
||||
workitem/get_local_size.ll
|
||||
workitem/get_num_groups.cl
|
||||
|
12
libclc/amdgcn-amdhsa/lib/workitem/get_num_groups.cl
Normal file
12
libclc/amdgcn-amdhsa/lib/workitem/get_num_groups.cl
Normal 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;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user