AnsweredAssumed Answered

Error in Bubble Sort Program

Question asked by shreedhar_pawar on Feb 9, 2013
Latest reply on Feb 9, 2013 by himanshu.gautam

I've created a bubble sort code. The createProgram function is giving an error which I've attached as a png photo and also  attached the host code.

My kernel looks like:

 

__kernel void sort_kernel(__global const float *a, __global const float *b)

{

  const int n=100;

    int j;

    float temp;

  int gid = get_global_id(0);

  b[gid]=a[gid];

 

  for(j=0; j < n-gid; j++)

        {

               if(b[j+1]<b[j])

                 {

                   temp=b[j];

                   b[j]=b[j+1];

                   b[j+1]=temp;

                  }

         }

 

}

 

 

clbuildprogram is giving an error as per the runtime error. Please tell me what is the error in the user defined function createProgram or in the kernel code and how can I rectify it...?

Attachments

Outcomes