OpenCL: preventing kernel caching

I am taking the first steps with opencl and now have a problem. I am using NVIDIA OpenCL lib with GT540m graphics card.

Now it seems that the kernel is cached after compilation and not recompiled when I make some changes in the kernel. To verify that I write 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 behavior?

Many thanks. greetings robin

+4
source share
1 answer
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 the cache call: enable_cuda_build_cache (false);

+1
source

All Articles