I have 4 kernel and need to done by step like kernel[0]-->kernel[1]-->kernel[2]-->kernel[3]
but the get_global_id() seem to run at the first time only...
Any suggestions?

here is my code
source.c
Code :
kernel[0]=clCreateKernel(program[0],"kernel1",&ret);
kernel[1]=clCreateKernel(program[1],"kernel2",&ret);
kernel[2]=clCreateKernel(program[2],"kernel3",&ret);
kernel[3]=clCreateKernel(program[3],"kernel4",&ret);
 
size_t globalWorkSize[2] = {M,M}; 
size_t localWorkSize[2] = {M,M}; 
 
clEnqueueNDRangeKernel(command_queue, kernel[0], 2, NULL, globalWorkSize, localWorkSize, 0,NULL, NULL);
clEnqueueNDRangeKernel(command_queue, kernel[1], 2, NULL, globalWorkSize, localWorkSize, 0,NULL, NULL);

source.cl
Code :
__kernel void kernel1(__global float* a,__global float* b,__global float* c,__global float* d,__global float* e,__global float* f)
{
    int i = get_global_id(0);
	a[i]=b[i]-c[i];
	d[i]=e[i]-f[i];
}