Solved! Go to Solution.
Even smaller code:
#pragma OPENCL EXTENSION cl_amd_printf : enable
__kernel void
experiment(float3 vector)
{
printf("%f", vector.x);
}
seems that the compiler doesn't like float3 arguments. float2 is working!
Also, this is working:
#pragma OPENCL EXTENSION cl_amd_printf : enable
__kernel void
experiment(__global float3* vector)
{
printf("%f", vector[0].x);
}
As a workaround for you I'd suggest you pass 3 float arguments to the kernel and use them instead.
Even smaller code:
#pragma OPENCL EXTENSION cl_amd_printf : enable
__kernel void
experiment(float3 vector)
{
printf("%f", vector.x);
}
seems that the compiler doesn't like float3 arguments. float2 is working!
Also, this is working:
#pragma OPENCL EXTENSION cl_amd_printf : enable
__kernel void
experiment(__global float3* vector)
{
printf("%f", vector[0].x);
}
As a workaround for you I'd suggest you pass 3 float arguments to the kernel and use them instead.
viscocoa,
Thank you for giving us a test case. This example is good enough for us to analyze the issue. After looking at it, it looks like with our internal builds this kernel and the fixes should show up in one of the near-future catalyst builds.
Hi Micah,
I wonder if you could repeat the crash on your computer. Is there any method to work around the problem?
The previous runtime did not have the problem. Is it possible to downgrade to the previous version?
Thank you!
Not sure, if you read my post there, but I could reproduce the crash with your program as well with the smaller program I posted.
Also, you could use the workaround as I posted:
Instead of using one float3 argument to the kernel, call the kernel with 3 float arguments:
__kernel mykernel( float x, float y, float z ) {...
...
}
Hi KNeumann,
Both methods you mentioned work well. However, I prefer the float3*, because I have already got 12 arguments for my Kernel.
Is it common to have so many arguments for a kernel? I don't wanna bother packing all in a structure and aligning all elements. I think even if I pack small arguments, memory objects have to be past separately, which makes things even messier.
Thank you very much!
Viscocoa
Hi viscocoa,
because you mentioned you want to use float3* (Pointer !) argument:
Before you always said you have an argument of type float3, not float3* .
This is somewhat important because the compiler does not crash (at least not on my computer), when you pass an __global float3* and access any index of it.
See my first post for details.
Just wanted to mention that, but I am sure you know what you want to do.
Cheers
Hi KNeumann,
I intended to use a float3 type argument. And finally I used float3* to work around the problem, as you suggested.
Thank you very much for all of your help!
VisCocoa