File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed
source/adapters/level_zero Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -424,9 +424,7 @@ ur_exp_command_buffer_handle_t_::ur_exp_command_buffer_handle_t_(
424
424
urDeviceRetain (Device);
425
425
}
426
426
427
- // The ur_exp_command_buffer_handle_t_ destructor releases all the memory
428
- // objects allocated for command_buffer management.
429
- ur_exp_command_buffer_handle_t_::~ur_exp_command_buffer_handle_t_ () {
427
+ void ur_exp_command_buffer_handle_t_::cleanupCommandBufferResources () {
430
428
// Release the memory allocated to the Context stored in the command_buffer
431
429
urContextRelease (Context);
432
430
@@ -703,6 +701,7 @@ urCommandBufferReleaseExp(ur_exp_command_buffer_handle_t CommandBuffer) {
703
701
if (!CommandBuffer->RefCount .decrementAndTest ())
704
702
return UR_RESULT_SUCCESS;
705
703
704
+ CommandBuffer->cleanupCommandBufferResources ();
706
705
delete CommandBuffer;
707
706
return UR_RESULT_SUCCESS;
708
707
}
Original file line number Diff line number Diff line change @@ -34,8 +34,6 @@ struct ur_exp_command_buffer_handle_t_ : public _ur_object {
34
34
ur_event_handle_t WaitEvent, ur_event_handle_t AllResetEvent,
35
35
const ur_exp_command_buffer_desc_t *Desc, const bool IsInOrderCmdList);
36
36
37
- ~ur_exp_command_buffer_handle_t_ ();
38
-
39
37
void registerSyncPoint (ur_exp_command_buffer_sync_point_t SyncPoint,
40
38
ur_event_handle_t Event);
41
39
@@ -65,6 +63,10 @@ struct ur_exp_command_buffer_handle_t_ : public _ur_object {
65
63
*/
66
64
ze_command_list_handle_t chooseCommandList (bool PreferCopyEngine);
67
65
66
+ // Releases the resources associated with the command-buffer before the
67
+ // command-buffer object is destroyed.
68
+ void cleanupCommandBufferResources ();
69
+
68
70
// UR context associated with this command-buffer
69
71
ur_context_handle_t Context;
70
72
// Device associated with this command buffer
You can’t perform that action at this time.
0 commit comments