OpenCL* for CPU
Ask questions and share information on Intel® SDK for OpenCL™ Applications and OpenCL™ implementations for Intel® CPU.
Announcements
This forum covers OpenCL* for CPU only. OpenCL* for GPU questions can be asked in the GPU Compute Software forum. Intel® FPGA SDK for OpenCL™ questions can be ask in the FPGA Intel® High Level Design forum.

Total crash of VS2013 when debugging, when you pass in a global buffer of an enum type

Max_B_
Beginner
1,211 Views

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

0 Kudos
5 Replies
Robert_I_Intel
Employee
1,211 Views

Max,

Thanks for reporting the issue! Could you please attach the whole HelloWorld example? I will try to reproduce the issue and file it with our OpenCL Debugger team.

0 Kudos
Max_B_
Beginner
1,211 Views

Rename the .txt file to HelloWorld_Kernel.cl , and that's it.

0 Kudos
Robert_I_Intel
Employee
1,211 Views

Max,

I am in the process of reproducing your issue: haven't been able to do it yet due to the problems with my development system. Are you creating a buffer for the integer that you are passing into your code when uncommenting __global MyEnum* in ?

 

Thank you for your patience!

Robert

0 Kudos
Max_B_
Beginner
1,211 Views

Are you creating a buffer for the integer that you are passing into your code when uncommenting __global MyEnum* in ?

The C++ code that I attached above (HelloWorld.cpp) is exactly the code that I'm running to trigger the bug. It does not use OpenCL buffers.

0 Kudos
majeed_k_
Beginner
1,211 Views
0 Kudos
Reply