From ffb87e5a61314cfa6551aa7a085da4f8486dc54f Mon Sep 17 00:00:00 2001 From: Michal Zientkiewicz Date: Mon, 30 Sep 2024 11:50:36 +0200 Subject: [PATCH] Fix issues detected by Coverity (2024.09.30) Signed-off-by: Michal Zientkiewicz --- dali/operators/image/remap/cvcuda/matrix_adjust.cu | 1 + dali/operators/image/remap/cvcuda/warp_perspective.cc | 2 +- dali/pipeline/executor/executor2/exec2.cc | 2 +- dali/pipeline/executor/executor2/exec2_ops_for_test.cu | 1 + dali/pipeline/executor/executor2/exec_node_task.cc | 1 + 5 files changed, 5 insertions(+), 2 deletions(-) diff --git a/dali/operators/image/remap/cvcuda/matrix_adjust.cu b/dali/operators/image/remap/cvcuda/matrix_adjust.cu index 4651c880ce..d2928413a2 100644 --- a/dali/operators/image/remap/cvcuda/matrix_adjust.cu +++ b/dali/operators/image/remap/cvcuda/matrix_adjust.cu @@ -55,6 +55,7 @@ void adjustMatrices(nvcv::Tensor &matrices, cudaStream_t stream) { int num_blocks = div_ceil(bs, 256); int threads_per_block = std::min(bs, 256); adjustMatricesKernel2<<>>(wrap, bs); + CUDA_CALL(cudaGetLastError()); } } // namespace warp_perspective diff --git a/dali/operators/image/remap/cvcuda/warp_perspective.cc b/dali/operators/image/remap/cvcuda/warp_perspective.cc index 67a42a9409..1f646e3311 100644 --- a/dali/operators/image/remap/cvcuda/warp_perspective.cc +++ b/dali/operators/image/remap/cvcuda/warp_perspective.cc @@ -231,7 +231,7 @@ class WarpPerspective : public nvcvop::NVCVSequenceOperator { NVCVBorderType border_mode_ = NVCV_BORDER_CONSTANT; NVCVInterpolationType interp_type_ = NVCV_INTERP_NEAREST; std::vector fill_value_arg_{0, 0, 0, 0}; - float4 fill_value_; + float4 fill_value_{}; bool inverse_map_ = false; bool ocv_pixel_ = true; std::optional warp_perspective_; diff --git a/dali/pipeline/executor/executor2/exec2.cc b/dali/pipeline/executor/executor2/exec2.cc index c3fe5df5ee..bb989a2163 100644 --- a/dali/pipeline/executor/executor2/exec2.cc +++ b/dali/pipeline/executor/executor2/exec2.cc @@ -347,7 +347,7 @@ class Executor2::Impl { auto stream_idx = assignment[&node]; node.env.order = stream_idx.has_value() - ? AccessOrder(streams_[*stream_idx]) + ? AccessOrder(streams_[*stream_idx].get()) : AccessOrder::host(); } } diff --git a/dali/pipeline/executor/executor2/exec2_ops_for_test.cu b/dali/pipeline/executor/executor2/exec2_ops_for_test.cu index e91fb186c0..65a327f753 100644 --- a/dali/pipeline/executor/executor2/exec2_ops_for_test.cu +++ b/dali/pipeline/executor/executor2/exec2_ops_for_test.cu @@ -99,6 +99,7 @@ void DummyOpGPU::RunImpl(Workspace &ws) { scratch.ToGPU(ws.stream(), pointers), ws.NumInput() + 1, N); + CUDA_CALL(cudaGetLastError()); } diff --git a/dali/pipeline/executor/executor2/exec_node_task.cc b/dali/pipeline/executor/executor2/exec_node_task.cc index 36360ce47b..99ef627bce 100644 --- a/dali/pipeline/executor/executor2/exec_node_task.cc +++ b/dali/pipeline/executor/executor2/exec_node_task.cc @@ -259,6 +259,7 @@ void OpTask::RunOp() { ResetInputLayouts(); PropagateSourceInfo(*ws_); } + assert(ws_->GetIterationData()); if (auto cpt = ws_->GetIterationData()->checkpoint) { node_->op->SaveState(cpt->GetOpCheckpoint(node_->instance_name), ws_->output_order()); }