Reputation: 3742
Suppose I have a .cl
like this:
void func(whatever){
int id = get_global_id(0);
do stuff;
}
__kernel void (whatever){
func(whatever);
}
Will func
be able to access thread-specific functions like get_global_id
? It would be annoying to have to manually inline all these functions, and would make the code much less readable.
Upvotes: 1
Views: 872
Reputation: 9925
Yes, all functions are able to use work-item functions like get_global_id()
. The only thing you cannot do in a function that is called from a kernel is declare a function scope local memory array.
Upvotes: 1