If a kernel takes an argument which is a pointer to a __global enum type, and that enum type has at least one member defined as having the value of other another (previous) member, then attempting to use breakpoints in the kernel will cause a catastrophic crash of Visual Studio 2013.
The program being debugged will continue to run.
The problem is transitive through inclusion of the enum type in a struct.
OpenCL kernel code illustrating the issue:
typedef enum MyEnum_e { FIRST, SECOND = FIRST // further entries make no difference } MyEnum; __kernel void helloworld( __global MyEnum* in // remove this arg to avoid breakpoint-time crash ) { int i; i = 41; i = 42; // set breakpoint here i = 43; }
I have attached a screenshot showing VS2013 having crashed.
As a slight aside: I presume it is dangerous to use such types to pass data from the host to the device, or vice-versa; as I understand it the size of an enum type is compiler-dependent (see these StackOverflow threads).
I am using:
Visual Studio 2013 Ultimate.
Windows 7, 64-bit.
OpenCL runtime for Intel Core and Xeon Processors [...] version 4.5.0.8
Intel SDK for OpenCL Applications 2014 version 4.6.0.92