Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Coverity fixes 09-2024 #5633

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dali/operators/image/remap/cvcuda/matrix_adjust.cu
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,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<<<num_blocks, threads_per_block, 0, stream>>>(wrap, bs);
CUDA_CALL(adjustMatricesKernel2<<<num_blocks, threads_per_block, 0, stream>>>(wrap, bs));
Copy link
Contributor

@mzient mzient Sep 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this would compile. A CUDA kernel invocation doesn't return a value.
Use CUDA_CALL(cudaGetLastError()); after the kernel invocation.

}

} // namespace warp_perspective
Expand Down
2 changes: 1 addition & 1 deletion dali/operators/image/remap/cvcuda/warp_perspective.cc
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ class WarpPerspective : public nvcvop::NVCVSequenceOperator<StatelessOperator> {
NVCVBorderType border_mode_ = NVCV_BORDER_CONSTANT;
NVCVInterpolationType interp_type_ = NVCV_INTERP_NEAREST;
std::vector<float> fill_value_arg_{0, 0, 0, 0};
float4 fill_value_;
float4 fill_value_{0, 0, 0, 0};
bool inverse_map_ = false;
bool ocv_pixel_ = true;
std::optional<cvcuda::WarpPerspective> warp_perspective_;
Expand Down
8 changes: 3 additions & 5 deletions dali/pipeline/executor/executor2/exec2_ops_for_test.cu
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,9 @@ void DummyOpGPU::RunImpl(Workspace &ws) {
out.Resize(uniform_list_shape(N, TensorShape<0>()), DALI_INT32);
assert(out.IsContiguousInMemory());
}
Sum<<<div_ceil(N, 256), 256, 0, ws.stream()>>>(
out[0].mutable_data<int>(),
scratch.ToGPU(ws.stream(), pointers),
ws.NumInput() + 1,
N);
CUDA_CALL(Sum<<<div_ceil(N, 256), 256, 0, ws.stream()>>>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Likewise.

(out[0].mutable_data<int>(), scratch.ToGPU(ws.stream(), pointers),
ws.NumInput() + 1, N));
}


Expand Down
1 change: 1 addition & 0 deletions dali/pipeline/executor/executor2/exec_node_task.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
Expand Down
Loading