File tree 4 files changed +6
-10
lines changed
4 files changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -401,7 +401,8 @@ urCommandBufferReleaseExp(ur_exp_command_buffer_handle_t hCommandBuffer) {
401
401
402
402
UR_APIEXPORT ur_result_t UR_APICALL
403
403
urCommandBufferFinalizeExp (ur_exp_command_buffer_handle_t hCommandBuffer) {
404
- UR_ASSERT (!hCommandBuffer->IsFinalized , UR_RESULT_ERROR_INVALID_OPERATION);
404
+ UR_ASSERT (hCommandBuffer->CudaGraphExec == nullptr ,
405
+ UR_RESULT_ERROR_INVALID_OPERATION);
405
406
try {
406
407
const unsigned long long flags = 0 ;
407
408
#if CUDA_VERSION >= 12000
@@ -419,7 +420,6 @@ urCommandBufferFinalizeExp(ur_exp_command_buffer_handle_t hCommandBuffer) {
419
420
} catch (...) {
420
421
return UR_RESULT_ERROR_UNKNOWN;
421
422
}
422
- hCommandBuffer->IsFinalized = true ;
423
423
return UR_RESULT_SUCCESS;
424
424
}
425
425
Original file line number Diff line number Diff line change @@ -352,12 +352,10 @@ struct ur_exp_command_buffer_handle_t_ {
352
352
ur_device_handle_t Device;
353
353
// Whether commands in the command-buffer can be updated
354
354
bool IsUpdatable;
355
- // Keep track of whether command buffer is finalized
356
- bool IsFinalized = false ;
357
355
// Cuda Graph handle
358
356
CUgraph CudaGraph;
359
357
// Cuda Graph Exec handle
360
- CUgraphExec CudaGraphExec;
358
+ CUgraphExec CudaGraphExec = nullptr ;
361
359
// Atomic variable counting the number of reference to this command_buffer
362
360
// using std::atomic prevents data race when incrementing/decrementing.
363
361
std::atomic_uint32_t RefCountInternal;
Original file line number Diff line number Diff line change @@ -306,15 +306,15 @@ urCommandBufferReleaseExp(ur_exp_command_buffer_handle_t hCommandBuffer) {
306
306
307
307
UR_APIEXPORT ur_result_t UR_APICALL
308
308
urCommandBufferFinalizeExp (ur_exp_command_buffer_handle_t hCommandBuffer) {
309
- UR_ASSERT (!hCommandBuffer->IsFinalized , UR_RESULT_ERROR_INVALID_OPERATION);
309
+ UR_ASSERT (hCommandBuffer->HIPGraphExec == nullptr ,
310
+ UR_RESULT_ERROR_INVALID_OPERATION);
310
311
try {
311
312
const unsigned long long flags = 0 ;
312
313
UR_CHECK_ERROR (hipGraphInstantiateWithFlags (
313
314
&hCommandBuffer->HIPGraphExec , hCommandBuffer->HIPGraph , flags));
314
315
} catch (...) {
315
316
return UR_RESULT_ERROR_UNKNOWN;
316
317
}
317
- hCommandBuffer->IsFinalized = true ;
318
318
return UR_RESULT_SUCCESS;
319
319
}
320
320
Original file line number Diff line number Diff line change @@ -172,12 +172,10 @@ struct ur_exp_command_buffer_handle_t_ {
172
172
ur_device_handle_t Device;
173
173
// Whether commands in the command-buffer can be updated
174
174
bool IsUpdatable;
175
- // Keep track of whether command buffer is finalized
176
- bool IsFinalized = false ;
177
175
// HIP Graph handle
178
176
hipGraph_t HIPGraph;
179
177
// HIP Graph Exec handle
180
- hipGraphExec_t HIPGraphExec;
178
+ hipGraphExec_t HIPGraphExec = nullptr ;
181
179
// Atomic variable counting the number of reference to this command_buffer
182
180
// using std::atomic prevents data race when incrementing/decrementing.
183
181
std::atomic_uint32_t RefCountInternal;
You can’t perform that action at this time.
0 commit comments