| |
| |
| |
| |
| |
| |
| #ifndef UCT_CUDA_IPC_MD_H |
| #define UCT_CUDA_IPC_MD_H |
| |
| #include <uct/base/uct_md.h> |
| #include <uct/cuda/base/cuda_md.h> |
| #include <uct/cuda/base/cuda_iface.h> |
| |
| |
| |
| |
| |
| typedef struct uct_cuda_ipc_md { |
| struct uct_md super; |
| CUuuid* uuid_map; |
| char* peer_accessible_cache; |
| int uuid_map_size; |
| int uuid_map_capacity; |
| } uct_cuda_ipc_md_t; |
| |
| |
| |
| |
| typedef struct uct_cuda_ipc_component { |
| uct_component_t super; |
| uct_cuda_ipc_md_t* md; |
| } uct_cuda_ipc_component_t; |
| |
| extern uct_cuda_ipc_component_t uct_cuda_ipc_component; |
| |
| |
| |
| |
| typedef struct uct_cuda_ipc_md_config { |
| uct_md_config_t super; |
| } uct_cuda_ipc_md_config_t; |
| |
| |
| |
| |
| |
| typedef struct uct_cuda_ipc_key { |
| CUipcMemHandle ph; |
| CUdeviceptr d_bptr; |
| size_t b_len; |
| int dev_num; |
| CUuuid uuid; |
| CUdeviceptr d_mapped; |
| } uct_cuda_ipc_key_t; |
| |
| |
| #define UCT_CUDA_IPC_GET_DEVICE(_cu_device) \ |
| do { \ |
| if (UCS_OK != UCT_CUDADRV_FUNC(cuCtxGetDevice(&_cu_device))) { \ |
| return UCS_ERR_IO_ERROR; \ |
| } \ |
| } while(0); |
| |
| #define UCT_CUDA_IPC_DEVICE_GET_COUNT(_num_device) \ |
| do { \ |
| if (UCS_OK != UCT_CUDADRV_FUNC(cuDeviceGetCount(&_num_device))) { \ |
| return UCS_ERR_IO_ERROR; \ |
| } \ |
| } while(0); |
| |
| #endif |