Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the OpenCL analogue for CUDA's __syncthreads() and blockIdx.x?

I am trying to translate CUDA code into OpenCL and right now I am stuck with these functions/variables:

  • __syncthreads()
  • blockIdx.x
like image 537
Vladimir Avatar asked Mar 05 '13 13:03

Vladimir


1 Answers

Actually I found it by my own! Here is a useful article: http://www.netlib.org/utk/people/JackDongarra/PAPERS/parcocudaopencl.pdf

The answer is: for the __syncthreads() use barrier(CLK_LOCAL_MEM_FENCE); for blockIdx.x use get_group_id(0)!

like image 113
Vladimir Avatar answered Sep 20 '22 15:09

Vladimir