You do not need to create one program for each function, instead you create a program for a set of functions that are marked with __kernel (or kernel ) and potentially auxiliary functions (for example, your AddVectors function), using, for example, calling clCreateProgramWithSource .
Check out basic tutorials from Apple, AMD, NVIDIA ..
source share