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.
1718 Discussions

Kernel doesn't finish building on CPU

Vishvas
Novice
1,162 Views

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
1,135 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

0 Kudos
Vishvas
Novice
1,130 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

0 Kudos
Reply