Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Vishvas
Novice
190 Views

Kernel doesn't finish building on CPU

The following kernel runs fine on my GPU (GTX 1060) and my iGPU on my i5-6500

But if I run this on my CPU, it doesn't go past the clBuildProgram function 

I don't get any error, the clBuildProgram executes forever

 

__kernel void multiply(__global int* res, __global int* b, __global int* p, __global int* r,  __global int* q, const int count, const int am, const int bn)
{
    int l, j, k;
    
    int i = get_global_id(0);

    //printf("\n\n%d", i);

    {
        for(j = 0; j < am;)
        {
            l = 0;
            for (int k = 0; k < count; k++)
            {
                *(res + j * bn + i) += p[k] * *(b + r[k] * bn + i);

                if (k == (q[l + 1] - 1))
                {
                    j++;
                    l++;
                }
            }
        }
    }
}

 

 

I was able to recreate this error on a different PC as well

Why is this happening and how can I fix this?

 

Thank you 

Labels (1)
2 Replies
Sergey_I_Intel1
Employee
163 Views

Hello,

 

Condition, in theory, can be triggered rarely, and it depends on "q", and what's there.

Can you send your host_code, where you run this kernel?

 

Best regards,

Sergey

Vishvas
Novice
158 Views

I've attached the host code

One thing I noticed is that if I uncomment the print statement in my kernel, then the code runs without any issues

The clBuildProgram function is in line 305