In OpenCL C kernel code, Default built-in functions are good, but what about user-defined functions? do they have any performance and memory decrease when compared with in-built ones? If so, does writing the said user-defined function inside __kernel void once or multiple times better?
For Example:-
gentype clamp ( gentype x,
gentype minval,
gentype maxval)
The Above is an In-built function that has no impact on Performance nor does it reduce gpu l0/l1 cache memory
By user-defined function I mean like this below
int Add(int a, int b)
{
return a + b;
}
do these functions have any impact on l0/l1 memory if so then is it better to Not write these as functions and instead use the code everywhere?