cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

viscocoa
Adept I

The smallest program ever to crash OpenCL compiler

I have created a tiny kernel that crashes the compiler using either clBuildProgram() or APP KernelAnalyzer. I am working on Windows 7 64 bit with Radeon HD 5870 GPU and AMD-APP-SDK v2.6.
I am a newbie to here, and do not know how to file a bug.
Does anyone have an idea on what is wrong with the kernel? How can I work around?
Thank you in advance!
#pragma OPENCL EXTENSION cl_amd_printf : enable
__kernel void
experiment(     float3 vector)
{
     printf("Vector is: (%.2f, %.2f, %.2f\n)", vector.x, vector.y, vector.z);
}
0 Likes
1 Solution
KNeumann
Adept II

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.

View solution in original post

0 Likes
7 Replies
KNeumann
Adept II

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.

0 Likes

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.

0 Likes

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!

0 Likes

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

0 Likes

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

0 Likes

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

0 Likes