C GPU bindings
Fully functional GPU bindings in C
Closes #17 (closed).
The C Host functions have not changed, they could be implemented in terms of device functions, and/or have a new _host prefix. No such change has been made yet.
Removals:
- GlobalRegistry's
copy_from_host_toandcopy_to_host_fromfunctions which are now unneeded
Additions:
- Tests and CI: add C support with HIP, CUDA, CUDA+OpenACC.
- Docs: add documentation for C device support
- CMake: new MM_NUM_MAX_GPU option (default 8) to control the number of GPUs of each type on the platform (HIP/CUDA currently).
- C:
- Add functions
mm_device_ctx_create(),mm_device_ctx_is_valid(),mm_device_ctx_delete()andmm_device_ctx_delete_all()to request a and manipulate device contexts. The device descriptions are done with theenum mm_device - Note: All further functions use the context (a number) to interact with the requested device. Also, the host is simply considered a device in all the new functions.
- Add functions
mm_device_allocate_<type>()andmm_device_is_allocated(). - Add function
mm_device_copyto copy between host and device, or peer devices. - Add functions
mm_device_find_<type>()to access a variable's pointer.
- Add functions
- C++
- Device VarData can now be initialized with the host initialization parameters
-
get_device_id<Device>()andset_device_id<Device>()functions to access and set device IDs
Changes (C++):
- Exception error message improvements
- Change the device representation types for simplicity and templated information access
- Global Registry templated
copy_varallows a generic copy between any device source and destination (except HIP<->CUDA, which requires a host jump). - Template all high-level interface functions, such as
is_allocated,allocate_var, andfindto address a specific device
Edited by Terry Cojean