From 0ded1806a5d264c9c6cd52ac622c98e7ec4e444f Mon Sep 17 00:00:00 2001 From: Koichi Imai Date: Fri, 5 Jul 2024 18:17:50 +0900 Subject: [PATCH 1/4] fix(tensorrt_yolox): fix cstyleCast to reinterpret_cast Signed-off-by: Koichi Imai --- perception/tensorrt_yolox/src/tensorrt_yolox.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/perception/tensorrt_yolox/src/tensorrt_yolox.cpp b/perception/tensorrt_yolox/src/tensorrt_yolox.cpp index 94c795cfc2403..b509e9b0bdf36 100644 --- a/perception/tensorrt_yolox/src/tensorrt_yolox.cpp +++ b/perception/tensorrt_yolox/src/tensorrt_yolox.cpp @@ -1205,7 +1205,7 @@ cv::Mat TrtYoloX::getMaskImageGpu(float * d_prob, nvinfer1::Dims dims, int out_w cv::Mat mask = cv::Mat::zeros(out_h, out_w, CV_8UC1); int index = b * out_w * out_h; argmax_gpu( - (unsigned char *)argmax_buf_d_.get() + index, d_prob, out_w, out_h, width, height, classes, 1, + reinterpret_castargmax_buf_d_.get() + index, d_prob, out_w, out_h, width, height, classes, 1, *stream_); CHECK_CUDA_ERROR(cudaMemcpyAsync( argmax_buf_h_.get(), argmax_buf_d_.get(), sizeof(unsigned char) * 1 * out_w * out_h, From b5df719c1161cc6d52c5ee1315051fe1f588ffca Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 5 Jul 2024 09:25:25 +0000 Subject: [PATCH 2/4] style(pre-commit): autofix --- perception/tensorrt_yolox/src/tensorrt_yolox.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/perception/tensorrt_yolox/src/tensorrt_yolox.cpp b/perception/tensorrt_yolox/src/tensorrt_yolox.cpp index b509e9b0bdf36..651a41fd74d8a 100644 --- a/perception/tensorrt_yolox/src/tensorrt_yolox.cpp +++ b/perception/tensorrt_yolox/src/tensorrt_yolox.cpp @@ -1205,8 +1205,8 @@ cv::Mat TrtYoloX::getMaskImageGpu(float * d_prob, nvinfer1::Dims dims, int out_w cv::Mat mask = cv::Mat::zeros(out_h, out_w, CV_8UC1); int index = b * out_w * out_h; argmax_gpu( - reinterpret_castargmax_buf_d_.get() + index, d_prob, out_w, out_h, width, height, classes, 1, - *stream_); + reinterpret_cast argmax_buf_d_.get() + index, d_prob, out_w, out_h, width, + height, classes, 1, *stream_); CHECK_CUDA_ERROR(cudaMemcpyAsync( argmax_buf_h_.get(), argmax_buf_d_.get(), sizeof(unsigned char) * 1 * out_w * out_h, cudaMemcpyDeviceToHost, *stream_)); From 51d601823fd5b2b60f9d925633b137953da4e7c2 Mon Sep 17 00:00:00 2001 From: Koichi Imai Date: Mon, 8 Jul 2024 11:02:40 +0900 Subject: [PATCH 3/4] fix(tensorrt_yolox): fix cstyleCast to reinterpret_cast Signed-off-by: Koichi Imai --- perception/tensorrt_yolox/src/tensorrt_yolox.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/perception/tensorrt_yolox/src/tensorrt_yolox.cpp b/perception/tensorrt_yolox/src/tensorrt_yolox.cpp index 651a41fd74d8a..a5fbe14b7f470 100644 --- a/perception/tensorrt_yolox/src/tensorrt_yolox.cpp +++ b/perception/tensorrt_yolox/src/tensorrt_yolox.cpp @@ -1205,8 +1205,8 @@ cv::Mat TrtYoloX::getMaskImageGpu(float * d_prob, nvinfer1::Dims dims, int out_w cv::Mat mask = cv::Mat::zeros(out_h, out_w, CV_8UC1); int index = b * out_w * out_h; argmax_gpu( - reinterpret_cast argmax_buf_d_.get() + index, d_prob, out_w, out_h, width, - height, classes, 1, *stream_); + reinterpret_cast(argmax_buf_d_.get()) + index, d_prob, out_w, out_h, width, height, classes, 1, + *stream_); CHECK_CUDA_ERROR(cudaMemcpyAsync( argmax_buf_h_.get(), argmax_buf_d_.get(), sizeof(unsigned char) * 1 * out_w * out_h, cudaMemcpyDeviceToHost, *stream_)); From 96720033942ad8a5b0d3dcc9a5c2249e83edf025 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 8 Jul 2024 02:12:11 +0000 Subject: [PATCH 4/4] style(pre-commit): autofix --- perception/tensorrt_yolox/src/tensorrt_yolox.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/perception/tensorrt_yolox/src/tensorrt_yolox.cpp b/perception/tensorrt_yolox/src/tensorrt_yolox.cpp index a5fbe14b7f470..150aaa1159001 100644 --- a/perception/tensorrt_yolox/src/tensorrt_yolox.cpp +++ b/perception/tensorrt_yolox/src/tensorrt_yolox.cpp @@ -1205,8 +1205,8 @@ cv::Mat TrtYoloX::getMaskImageGpu(float * d_prob, nvinfer1::Dims dims, int out_w cv::Mat mask = cv::Mat::zeros(out_h, out_w, CV_8UC1); int index = b * out_w * out_h; argmax_gpu( - reinterpret_cast(argmax_buf_d_.get()) + index, d_prob, out_w, out_h, width, height, classes, 1, - *stream_); + reinterpret_cast(argmax_buf_d_.get()) + index, d_prob, out_w, out_h, width, + height, classes, 1, *stream_); CHECK_CUDA_ERROR(cudaMemcpyAsync( argmax_buf_h_.get(), argmax_buf_d_.get(), sizeof(unsigned char) * 1 * out_w * out_h, cudaMemcpyDeviceToHost, *stream_));