The problem is: when I use Static C++ OpenCL kernel extension I give mangled names to variants of templated kernel, e.g:
template<typename T>
__kernel void vec_add(__global T *A, __global T *B, __global T *C)
{
int idx = get_global_id(o);
C[idx] = A[idx] + B[idx];
}
template __attribute__((mangled_name(vec_add_int)))
__kernel void vec_add(__global int * A, __global int * B, __global int * C);
}
But if I place it into a cstom namespace as shown below:
namespace my_vec_add_namespace {
template<typename T>
__kernel void vec_add(__global T *A, __global T *B, __global T *C)
{
int idx = get_global_id(o);
C[idx] = A[idx] + B[idx];
}
template __attribute__((mangled_name(vec_add_int)))
__kernel void vec_add(__global int * A, __global int * B, __global int * C);
}
The compiler doesn't see "vec_add_int" kernel during online compilation.
How to use it properly?