I am unsure if this is necessary. I have two kernels which I need to launch in serial. Do I need to create an event for the first one and then have the second kernel launch wait for that event or can I assume that everything is the queue executes in the order in which I placed it? Is my use of cl_event in the code bellow nessary?
cl_event acceleration_finished;
cl_check(clEnqueueNDRangeKernel(cmdq, acceleration_kernel, 1, NULL, &acceleration_blocks,
&acceleration_threads, 0, NULL, &acceleration_finished));
cl_event stepper_finished;
cl_check(clEnqueueNDRangeKernel(cmdq, stepper_kernel, 1, NULL, &N,
NULL, 1, &acceleration_finished, &stepper_finished));
cl_double3* positions_mapped = clEnqueueMapBuffer(cmdq, positions, CL_TRUE, CL_MAP_READ, 0,
sizeof(cl_double3) * N, 1, &stepper_finished, NULL, &error);
cl_check(error);