2525/* Accelerator API's */
2626static int accelerator_cuda_check_addr (const void * addr , int * dev_id , uint64_t * flags );
2727static int accelerator_cuda_create_stream (int dev_id , opal_accelerator_stream_t * * stream );
28+ static int accelerator_cuda_destroy_stream (opal_accelerator_stream_t * stream );
29+ static int accelerator_cuda_synchronize_stream (opal_accelerator_stream_t * stream );
30+ static int accelerator_cuda_stream_wait_event (opal_accelerator_stream_t * stream ,
31+ opal_accelerator_event_t * event );
2832
2933static int accelerator_cuda_create_event (int dev_id , opal_accelerator_event_t * * event );
34+ static int accelerator_cuda_destroy_event (opal_accelerator_event_t * event );
3035static int accelerator_cuda_record_event (int dev_id , opal_accelerator_event_t * event , opal_accelerator_stream_t * stream );
3136static int accelerator_cuda_query_event (int dev_id , opal_accelerator_event_t * event );
3237
@@ -41,6 +46,17 @@ static int accelerator_cuda_mem_release(int dev_id, void *ptr);
4146static int accelerator_cuda_get_address_range (int dev_id , const void * ptr , void * * base ,
4247 size_t * size );
4348
49+ static bool accelerator_cuda_is_ipc_enabled (void );
50+ static int accelerator_cuda_get_ipc_handle (int dev_id , void * dev_ptr ,
51+ opal_accelerator_ipc_handle_t * handle );
52+ static int accelerator_cuda_open_ipc_handle (int dev_id , opal_accelerator_ipc_handle_t * handle ,
53+ void * * dev_ptr );
54+ static int accelerator_cuda_get_ipc_event_handle (opal_accelerator_event_t * event ,
55+ opal_accelerator_ipc_event_handle_t * handle );
56+ static int accelerator_cuda_open_ipc_event_handle (opal_accelerator_ipc_event_handle_t * handle ,
57+ opal_accelerator_event_t * event );
58+ static int accelerator_cuda_close_ipc_handle (int dev_id , void * dev_ptr );
59+
4460static int accelerator_cuda_host_register (int dev_id , void * ptr , size_t size );
4561static int accelerator_cuda_host_unregister (int dev_id , void * ptr );
4662
@@ -55,8 +71,12 @@ opal_accelerator_base_module_t opal_accelerator_cuda_module =
5571 accelerator_cuda_check_addr ,
5672
5773 accelerator_cuda_create_stream ,
74+ accelerator_cuda_destroy_stream ,
75+ accelerator_cuda_synchronize_stream ,
76+ accelerator_cuda_stream_wait_event ,
5877
5978 accelerator_cuda_create_event ,
79+ accelerator_cuda_destroy_event ,
6080 accelerator_cuda_record_event ,
6181 accelerator_cuda_query_event ,
6282
@@ -67,6 +87,13 @@ opal_accelerator_base_module_t opal_accelerator_cuda_module =
6787 accelerator_cuda_mem_release ,
6888 accelerator_cuda_get_address_range ,
6989
90+ accelerator_cuda_is_ipc_enabled ,
91+ accelerator_cuda_get_ipc_handle ,
92+ accelerator_cuda_open_ipc_handle ,
93+ accelerator_cuda_get_ipc_event_handle ,
94+ accelerator_cuda_open_ipc_event_handle ,
95+ accelerator_cuda_close_ipc_handle ,
96+
7097 accelerator_cuda_host_register ,
7198 accelerator_cuda_host_unregister ,
7299
@@ -254,6 +281,23 @@ static void opal_accelerator_cuda_stream_destruct(opal_accelerator_cuda_stream_t
254281 }
255282}
256283
284+ static int accelerator_cuda_destroy_stream (opal_accelerator_stream_t * stream )
285+ {
286+ opal_accelerator_cuda_stream_destruct (stream );
287+ return OPAL_SUCCESS ;
288+ }
289+
290+ static int accelerator_cuda_synchronize_stream (opal_accelerator_stream_t * stream )
291+ {
292+ return OPAL_ERR_NOT_IMPLEMENTED ;
293+ }
294+
295+ static int accelerator_cuda_stream_wait_event (opal_accelerator_stream_t * stream ,
296+ opal_accelerator_event_t * event )
297+ {
298+ return OPAL_ERR_NOT_IMPLEMENTED ;
299+ }
300+
257301OBJ_CLASS_INSTANCE (
258302 opal_accelerator_cuda_stream_t ,
259303 opal_accelerator_stream_t ,
@@ -302,6 +346,12 @@ static void opal_accelerator_cuda_event_destruct(opal_accelerator_cuda_event_t *
302346 }
303347}
304348
349+ static int accelerator_cuda_destroy_event (opal_accelerator_event_t * event )
350+ {
351+ opal_accelerator_cuda_event_destruct (event );
352+ return OPAL_SUCCESS ;
353+ }
354+
305355OBJ_CLASS_INSTANCE (
306356 opal_accelerator_cuda_event_t ,
307357 opal_accelerator_event_t ,
@@ -520,6 +570,40 @@ static int accelerator_cuda_get_address_range(int dev_id, const void *ptr, void
520570 return 0 ;
521571}
522572
573+ static bool accelerator_null_is_ipc_enabled (void )
574+ {
575+ return false;
576+ }
577+
578+ static int accelerator_cuda_get_ipc_handle (int dev_id , void * dev_ptr ,
579+ opal_accelerator_ipc_handle_t * handle )
580+ {
581+ return OPAL_ERR_NOT_IMPLEMENTED ;
582+ }
583+
584+ static int accelerator_cuda_open_ipc_handle (int dev_id , opal_accelerator_ipc_handle_t * handle ,
585+ void * * dev_ptr )
586+ {
587+ return OPAL_ERR_NOT_IMPLEMENTED ;
588+ }
589+
590+ static int accelerator_cuda_get_ipc_event_handle (opal_accelerator_event_t * event ,
591+ opal_accelerator_ipc_event_handle_t * handle )
592+ {
593+ return OPAL_ERR_NOT_IMPLEMENTED ;
594+ }
595+
596+ static int accelerator_cuda_open_ipc_event_handle (opal_accelerator_ipc_event_handle_t * handle ,
597+ opal_accelerator_event_t * event )
598+ {
599+ return OPAL_ERR_NOT_IMPLEMENTED ;
600+ }
601+
602+ static int accelerator_cuda_close_ipc_handle (int dev_id , void * dev_ptr )
603+ {
604+ return OPAL_ERR_NOT_IMPLEMENTED ;
605+ }
606+
523607static int accelerator_cuda_host_register (int dev_id , void * ptr , size_t size )
524608{
525609 CUresult result ;
0 commit comments