@@ -150,7 +150,9 @@ typedef int (*opal_accelerator_base_module_check_addr_fn_t)(
150
150
151
151
/**
152
152
* Creates a stream for asynchonous operations. This function will allocate
153
- * memory for the object. To release the memory, call OBJ_RELEASE(*stream);
153
+ * memory for the object.
154
+ * To release the memory and associated resources,
155
+ * call opal_accelerator_base_module_create_stream_fn_t
154
156
*
155
157
* @param[IN] dev_id Associated device for the stream or
156
158
* MCA_ACCELERATOR_NO_DEVICE_ID
@@ -161,6 +163,18 @@ typedef int (*opal_accelerator_base_module_check_addr_fn_t)(
161
163
typedef int (* opal_accelerator_base_module_create_stream_fn_t )(
162
164
int dev_id , opal_accelerator_stream_t * * stream );
163
165
166
+ /**
167
+ * Destroys a stream and release the object memory.
168
+ * This function should return immediately, but resources associated with
169
+ * the stream may be released later.
170
+ *
171
+ * @param[IN] stream Stream to destroy
172
+ *
173
+ * @return OPAL_SUCCESS or error status on failure
174
+ */
175
+ typedef int (* opal_accelerator_base_module_destroy_stream_fn_t )(
176
+ opal_accelerator_stream_t * stream );
177
+
164
178
/**
165
179
* Creates an event. An event is a synchronization marker that can be
166
180
* appended to a stream to monitor device progress or synchronize the
@@ -402,6 +416,7 @@ typedef struct {
402
416
opal_accelerator_base_module_check_addr_fn_t check_addr ;
403
417
404
418
opal_accelerator_base_module_create_stream_fn_t create_stream ;
419
+ opal_accelerator_base_module_destroy_stream_fn_t destroy_stream ;
405
420
opal_accelerator_base_module_create_event_fn_t create_event ;
406
421
opal_accelerator_base_module_record_event_fn_t record_event ;
407
422
opal_accelerator_base_module_query_event_fn_t query_event ;
0 commit comments