I made a simple sample:
#include <CL/cl.h>
int main() {
clGetPlatformIDs(0, NULL, NULL);
return 0;
}
I compiled it with and with the options -fsanitize=leak that enables leak sanitizer and I have the following output
==17663==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 8 byte(s) in 1 object(s) allocated from:
#0 0x4079ef (/home/xxx/dev/cuda_sample/a.out+0x4079ef)
#1 0x7f4231239036 (/usr/local/cuda-8.0/lib64/libOpenCL.so.1+0x2036)
(I have similar results with valgrind)
Using CUDA 8 on a GT640 driver 367.57 on ubuntu