Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OpenCL: Prevent kernel caching

Tags:

gpgpu

opencl

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

like image 782
user3507003 Avatar asked May 14 '15 16:05

user3507003


1 Answers

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);

like image 110
doqtor Avatar answered Sep 20 '22 20:09

doqtor