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.

Debugger doesn't display local variable

Tar__Alex
Beginner
506 Views

I try to debug some opencl kernel in Visual Studio 2013. After entering in kernel debugger show me local variables, but only before row with union operator (#11). Once debug go to row 11 a "Locals" window is cleared. I think this is a bug. (sorry for my english)

__kernel void randn2(float sigma, unsigned int user_k, __global float4* out)
{
	philox4x32_key_t k = {{get_global_id(0), get_global_id(1)}};
	philox4x32_ctr_t c = {{ 0, 0xf00dcafe, 0xdeadbeef, user_k }};
	float4 buf={0, 0, 0, 0};
	float2 cos2;
	union {
		philox4x32_ctr_t c;
		uint4 ui;
		float4 f;
	} u;
	u.c = philox4x32_R(7,c, k);
	u.f = convert_float4(u.ui) / UINT_MAX;

 

0 Kudos
3 Replies
Jeffrey_M_Intel1
Employee
506 Views

Thanks Alex!  I agree that this looks like a bug.  I've replicated the behavior you've described and reported to the development team.  

0 Kudos
Jeffrey_M_Intel1
Employee
506 Views

Sorry for the delay in getting back to you.  There are several issues with unions, including support in the kernel builder.  We're looking into what can be done.  There are many things that need to be prioritized, and your feedback can help.  How critical is union support for your application?  

0 Kudos
Tar__Alex
Beginner
506 Views

In the future it is will be critical, but not now. Simply in some cases using union is very convenient.

Now I can use workaround.

0 Kudos
Reply