macro to enable printf debug in a cl kernel

Discussion created by FangQ on Feb 5, 2010
Latest reply on Mar 9, 2010 by pavandsp

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

#define GPUDEBUG(x)        printf x
#define GPUDEBUG(x)

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