Spurious (?) warning about string constants using a macro in OpenCL -
i use following macro in opencl kernel:
#define ided_printf(_format, ...) printf("(%u,%u,%u) " _format, get_global_id(0), get_group_id(0), get_local_id(0), __va_args__ )
and works fine. however, when compile (i use amd's app opencl library on win7), following warning on each use of macro:
argument of type "const __constant char *" incompatible parameter of type "__constant char *"
why getting that? after all, string literals const's. , if opencl compiler doesn't make them const, why "(%u, %u, %u)" string const'ed while other string (_format) not consted?
i'm assuming compiler bug; if is, workaround appreciated. maybe sort of cast?
based on amd forum's post, bug. , yes cast suggested in same post:
printf((__constant char *)"%d\n", i);
Comments
Post a Comment