Skip to content

Commit 9e976bd

Browse files
committed
Add checkCudaErrorWithCode to cudaDestroyDescriptor() for add and expand
1 parent 514cc27 commit 9e976bd

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/ops/add/cuda/add.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,9 @@ infiniopStatus_t cudaCreateAddDescriptor(CudaHandle_t handle,
7373
}
7474

7575
infiniopStatus_t cudaDestroyAddDescriptor(AddCudaDescriptor_t desc) {
76-
cudaFree((void *) desc->a_strides);
77-
cudaFree((void *) desc->b_strides);
78-
cudaFree((void *) desc->c_strides);
76+
checkCudaErrorWithCode(cudaFree((void *) desc->a_strides), STATUS_EXECUTION_FAILED);
77+
checkCudaErrorWithCode(cudaFree((void *) desc->b_strides), STATUS_EXECUTION_FAILED);
78+
checkCudaErrorWithCode(cudaFree((void *) desc->c_strides), STATUS_EXECUTION_FAILED);
7979
delete desc;
8080
return STATUS_SUCCESS;
8181
}

src/ops/expand/cuda/expand.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ infiniopStatus_t cudaCreateExpandDescriptor(CudaHandle_t handle,
4545
}
4646

4747
infiniopStatus_t cudaDestroyExpandDescriptor(ExpandCudaDescriptor_t desc) {
48-
cudaFree((void *) desc->strides_and_shape_d);
48+
checkCudaErrorWithCode(cudaFree((void *) desc->strides_and_shape_d), STATUS_EXECUTION_FAILED);
4949
delete desc;
5050
return STATUS_SUCCESS;
5151
}

0 commit comments

Comments
 (0)