Closed ancahamuraru closed 9 years ago
Hi Anca,
I got a fix for the OpenCL kernel source. I added a rule in the CMake to install the OpenCL source files along with Gromacs:
... -- Installing: /home/dimitris/HPC/gromacs-mine/bin_dbg/include/gromacs/version.h -- Installing: /home/dimitris/HPC/gromacs-mine/bin_dbg/lib/x86_64-linux-gnu/libgromacs.a -- Installing: /home/dimitris/HPC/gromacs-mine/bin_dbg/lib/x86_64-linux-gnu/pkgconfig/libgromacs.pc -- Installing: /home/dimitris/HPC/gromacs-mine/bin_dbg/bin/opencl/nbnxn_ocl_kernels.cl -- Installing: /home/dimitris/HPC/gromacs-mine/bin_dbg/bin/opencl/nbnxn_ocl_kernel_utils.clh -- Installing: /home/dimitris/HPC/gromacs-mine/bin_dbg/bin/opencl/nbnxn_ocl_kernels.clh -- Installing: /home/dimitris/HPC/gromacs-mine/bin_dbg/bin/opencl/nbnxn_ocl_kernel_nvidia.clh ...
The rule is active only for development builds. Anyway, currently if you just move the gromacs installation folder the OpenCL part will break! As you suggested for the release builds there are two possibilities: 1) Embedding the kernels in a header as a string via a script or a hexdump 2) Get the kernel files from the known relative path to the executable
First should be more robust, second is simpler.
I have pushed the changes that implement (2) in the dk branch. If you are not running from the installation folder you can set the OCL_FILE_PATH environment variable to point to the full path of the kernel (same way as you were defining it in the source until now)
Tested the approach with OCL_FILE_PATH environment variable - worked ok.
The OCL_FILE_PATH has been changed so that it now describes the location of the source directory. Previously it searched for the kernel using this but still searched for include files using relative paths.
The path for the main OpenCL file is determined
Further on, this path is used to generate the include paths needed when building the OpenCL source code.
Improve the way OpenCL code is loaded and built. Consider the following: