I was wondering if there is some sort of define that is set whenever a kernel/program is compiled /built for a certain architecture type. I usually debug my kernels on the CPU using printfs, which result in an empty build error log when I try to compile for the GPU on Lion. I figured if I had a way to wrap my printfs like the following
Code :#if defined(_CPU_) #define PRINT(fmt, ...) printf(fmt, ...) #else #define PRINT(fmt, ...) #endif
Then I would not need to uncomment my debug code whenever I do a quick switch to my GPU to see if the code runs.