9 Replies Latest reply on May 4, 2011 5:55 PM by nbigaouette

    Valgrind reports error for get_global_id(0)


      Hi all,

      I wrote an OpenCL code that I'm running on either a CPU (for development) and on a GPU.

      To debug a problem, I ran it through valgrind and it detected errors in AMD Stream.

      I created a test case that I've uploaded as a github's gist: https://gist.github.com/945170

      Basically, I get these errors:

      Execute OpenCL kernel...
      ==14001== Thread 3:
      ==14001== Use of uninitialised value of size 8
      ==14001==    at 0x64B0FBF: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
      ==14001== Use of uninitialised value of size 8
      ==14001==    at 0xCC50355: __OpenCL_Test_OpenCL_kernel (OCLjoC6u3.cl:8)
      ==14001==    by 0x645EC90: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
      ==14001==    by 0x645F492: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
      ==14001==    by 0x64B308B: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
      ==14001==    by 0x64B119C: ??? (in /opt/amdstream/lib/x86_64/libamdocl64.so)
      ==14001==    by 0x5B36D3F: start_thread (in /lib/libpthread-2.13.so)
      ==14001==    by 0x58A2AEC: clone (in /lib/libc-2.13.so)

      line 8 of the kernel.cl file is the printf:

          unsigned int i = get_global_id(0);
          printf("i = %3d  ", i);


      Could that be a bug in AMD Stream? I'm using v2.4 on ArchLinux.