Gromacs
5.1
|
Declare infrastructure for OpenCL JIT compilation for Gromacs.
TODO Currently this file handles compilation of NBNXN kernels, but e.g. organizing the defines for various physics models is leaking in here a bit.
Enumerations | |
enum | kernel_vendor_spec_t { generic_vendor_kernels = 0, nvidia_vendor_kernels, amd_vendor_kernels, auto_vendor_kernels } |
Vendor specific kernel sources. More... | |
enum | kernel_source_index_t { default_source = 0 } |
Kernel sources index. More... | |
Functions | |
cl_int | ocl_compile_program (kernel_source_index_t kernel_source_file, kernel_vendor_spec_t kernel_vendor_spec, const char *defines_for_kernel_types, char *result_str, cl_context context, cl_device_id device_id, ocl_vendor_id_t ocl_device_vendor, cl_program *p_program, const char *custom_build_options) |
Compile the kernels as described by kernel src id and vendor spec. More... | |
Kernel sources index.
For now there is only default source. One may add here future kernel versions etc. This affect the top level kernel sources (nbnxn_ocl_kernels.cl)
enum kernel_vendor_spec_t |
Vendor specific kernel sources.
Only affects the bottom level kernel sources (nbnxn_ocl_kernel_[spec].cl)
cl_int ocl_compile_program | ( | kernel_source_index_t | kernel_source_file, |
kernel_vendor_spec_t | kernel_vendor_spec, | ||
const char * | defines_for_kernel_types, | ||
char * | result_str, | ||
cl_context | context, | ||
cl_device_id | device_id, | ||
ocl_vendor_id_t | ocl_device_vendor, | ||
cl_program * | p_program, | ||
const char * | runtime_consts | ||
) |
Compile the kernels as described by kernel src id and vendor spec.
[in] | kernel_source_file | Index of the kernel src to be used (default) |
[in] | kernel_vendor_spec | Vendor-specific compilation (auto,nvidia,amd,nowarp) |
[in] | defines_for_kernel_types | Preprocessor defines that trigger the compilation of the kernels |
[out] | result_str | Gromacs error string |
[in] | context | Current context on the device to compile for |
[in] | device_id | OpenCL device id of the device to compile for |
[in] | ocl_device_vendor | Enumerator of the device vendor to compile for |
[out] | p_program | Pointer to the cl_program where the compiled cl_program will be stored |
[in] | runtime_consts | Optional string with runtime constants. Each constant is given according to the following format: "-Dname=value". Multiple defines are separated by blanks. |
std::bad_alloc | if out of memory |