Skip to content
AncaSC edited this page Nov 13, 2014 · 5 revisions

Status: in progress

Structures passed as OpenCL kernel parameters cannot have fields of type pointer (OpenCL objects)
As a consequence, the data structures used for passing the input parameters to CUDA kernels cannot be used in a similar way for the OpenCL kernels. These data structures are:
  • cu_atomdata_t / ocl_atomdata_t
  • cu_nbparam_t / ocl_nbparam_t
  • cu_plist_t / ocl_plist_t
Current approach:
  • the OpenCL kernel will have one parameter for each pointer field in the above mentioned structures
  • a new data structure has been defined for each of the three mentioned above by stripping away all pointer fields
  • the OpenCL kernel will have three more parameters corresponding to the newly defined data structures
  • there will be one single place where the translation from the larger to the smaller data structures will take place
See OpenCL 1.1 Specs, Chapter 6.8, item p. The restriction also exists in OpenCL 1.2 (Chapter 6.9, item p).
1D textures not supported in OpenCL 1.1
1D textures have been implemented by using 2D textures (images) with one single line
OpenCL kernel parameters of type Image2D cannot be NULL
In the CUDA implementation, fields of type texture were initialized and used depending on the context. In OpenCL, 2D texture cannot be left NULL. Consequently, the host code has been modified to always initializes the 2D images.
Missing memset functions for device buffers
There is no OpenCL equivalent for cudaMemset function. Auxiliary kernels have been added to implement memset functionality.
clBuildProgram for NVIDIA GPUs
Building the program can appear to take less time for NVIDIA GPUs because of caching. However, the caching does not work correctly, as the re-build is not triggered when changing anything from any of the files included by the main .cl source file. To disable the caching add CUDA_CACHE_DISABLE system variable and set it to 1

Clone this wiki locally