25
25
/* Accelerator API's */
26
26
static int accelerator_cuda_check_addr (const void * addr , int * dev_id , uint64_t * flags );
27
27
static 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 );
28
32
29
33
static 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 );
30
35
static int accelerator_cuda_record_event (int dev_id , opal_accelerator_event_t * event , opal_accelerator_stream_t * stream );
31
36
static int accelerator_cuda_query_event (int dev_id , opal_accelerator_event_t * event );
32
37
@@ -41,6 +46,17 @@ static int accelerator_cuda_mem_release(int dev_id, void *ptr);
41
46
static int accelerator_cuda_get_address_range (int dev_id , const void * ptr , void * * base ,
42
47
size_t * size );
43
48
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
+
44
60
static int accelerator_cuda_host_register (int dev_id , void * ptr , size_t size );
45
61
static int accelerator_cuda_host_unregister (int dev_id , void * ptr );
46
62
@@ -55,8 +71,12 @@ opal_accelerator_base_module_t opal_accelerator_cuda_module =
55
71
accelerator_cuda_check_addr ,
56
72
57
73
accelerator_cuda_create_stream ,
74
+ accelerator_cuda_destroy_stream ,
75
+ accelerator_cuda_synchronize_stream ,
76
+ accelerator_cuda_stream_wait_event ,
58
77
59
78
accelerator_cuda_create_event ,
79
+ accelerator_cuda_destroy_event ,
60
80
accelerator_cuda_record_event ,
61
81
accelerator_cuda_query_event ,
62
82
@@ -67,6 +87,13 @@ opal_accelerator_base_module_t opal_accelerator_cuda_module =
67
87
accelerator_cuda_mem_release ,
68
88
accelerator_cuda_get_address_range ,
69
89
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
+
70
97
accelerator_cuda_host_register ,
71
98
accelerator_cuda_host_unregister ,
72
99
@@ -254,6 +281,23 @@ static void opal_accelerator_cuda_stream_destruct(opal_accelerator_cuda_stream_t
254
281
}
255
282
}
256
283
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
+
257
301
OBJ_CLASS_INSTANCE (
258
302
opal_accelerator_cuda_stream_t ,
259
303
opal_accelerator_stream_t ,
@@ -302,6 +346,12 @@ static void opal_accelerator_cuda_event_destruct(opal_accelerator_cuda_event_t *
302
346
}
303
347
}
304
348
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
+
305
355
OBJ_CLASS_INSTANCE (
306
356
opal_accelerator_cuda_event_t ,
307
357
opal_accelerator_event_t ,
@@ -520,6 +570,40 @@ static int accelerator_cuda_get_address_range(int dev_id, const void *ptr, void
520
570
return 0 ;
521
571
}
522
572
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
+
523
607
static int accelerator_cuda_host_register (int dev_id , void * ptr , size_t size )
524
608
{
525
609
CUresult result ;
0 commit comments