5
votes

i'm making my first steps with opencl and now have a problem. i'm using the NVIDIA OpenCL lib with a GT540m graphics card.

Now it seems that the kernel gets cached after compiling and is not recompiled when i do some changes to the kernel. To test i'm writing some values to the output buffer but when i change these values in the kernel the output remains the same.

How can i prevent this behaviour?

Thanks a lot. greetings robin

1
In what way are you compiling the kernel. Is t compiled at runtime or at compilation time? - Christian

1 Answers

6
votes
void enable_cuda_build_cache(bool enable)
{
#ifdef _MSC_VER
    if (enable)
        _putenv("CUDA_CACHE_DISABLE=0");
    else
        _putenv("CUDA_CACHE_DISABLE=1");
#else // GCC
    if (enable)
        putenv("CUDA_CACHE_DISABLE=0");
    else
        putenv("CUDA_CACHE_DISABLE=1");
#endif
}

To disable cache call: enable_cuda_build_cache(false);