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.

Beta SDK : crash 2 ...

Polar01
Beginner
573 Views
Hi,

I have just add a small set of line of code in my kernel and it crash ! (I don't have this crash with AMD SDK by example).
My code looks like this (rayHit : is a __local variable) :
...
float3 normal, tangent;
AnalyseNormalAndTangent(rayHit->index, &normal, &tangent, scene->vertices, scene->tris, rayHit->b1, rayHit->b2);
Where :
inline void AnalyseNormalAndTangent(
uint hitIndex,
clVector3* normal,
clVector3* tangent,
__global Vertex* vertices,
__global Triangle* tris,
float b1, float b2)
{
...
*normal = normalize(b0 * n0 + b1 * n1 + b2 * n2);
/** REMOVE TO AVOID THE CRASH **/
if (fabs((*normal).x) > fabs((*normal).y))
{
float invLen = 1.f / sqrt((*normal).x * (*normal).x + (*normal).z * (*normal).z);
(*tangent).x = -(*normal).z * invLen;
(*tangent).y = 0.f;
(*tangent).z = (*normal).x * invLen;
}
else
{
float invLen = 1.f / sqrt((*normal).y * (*normal).y + (*normal).z * (*normal).z);
(*tangent).x = 0.f;
(*tangent).y = (*normal).z * invLen;
(*tangent).z = -(*normal).y * invLen;
}
/** REMOVE TO AVOID THE CRASH **/
}
If I remove the code in "REMOVE TO AVOID THE CRASH" I got no crash !!!
It sounds that the access to "normal" cause a crash !
How can I debug this... or help you to fix it ? ! It seems that it is a bug of the SDK !
0 Kudos
1 Reply
Shiri_M_Intel
Employee
573 Views
Hi
Thanks for this report
Are you facing the failure during build or execution of the kernel?
Thanks, Shiri
0 Kudos
Reply