
#include "cg.h"

#ifndef LSIZE
#error "LSIZE is not defined!"
#endif

//////////////////////////////////////////////////////////////////////////
// Kernels for main()
//////////////////////////////////////////////////////////////////////////
__kernel __attribute__((reqd_work_group_size(LSIZE,1,1)))
void main_0(__global int *colidx,
            __global int *rowstr,
            int firstcol,
            int n)
{
  int j = (int)(get_global_id(0) / LSIZE);
  int lid = get_local_id(0);

  int row_start = rowstr[j];
  int row_end = rowstr[j+1];
  for (int k = row_start+lid; k < row_end; k += LSIZE) {
    colidx[k] = colidx[k] - firstcol;
  }
}

