9 Replies Latest reply on Mar 9, 2010 9:22 AM by pavandsp

    macro to enable printf debug in a cl kernel

    FangQ

      I am trying to debug an OpenCL kernel translated from a CUDA code. In the CUDA code, I defined a macro:

      #ifdef __DEVICE_EMULATION__
      #define GPUDEBUG(x)        printf x
      #else
      #define GPUDEBUG(x)
      #endif

      to enable printing under device emulation mode. When I ran the translated unit on ATI stream sdk, I can not find a macro similar to "__DEVICE_EMULATION__".

      printf does work when using CPU device, but will crash for GPU devices.

      I am curious if there is such a macro so that I can keep my debug approach. Or if there is an alternative?

      thank you