-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Avoid arithmetic on void pointer in multilevelProposeROIPlugin.cpp #1028
Avoid arithmetic on void pointer in multilevelProposeROIPlugin.cpp #1028
Conversation
Clang disallows non-standard pointer arithmetic on void pointers. This causes the build of multilevelProposeROIPlugin.cpp to fail using clang 12. Signed-off-by: Stephan Seitz <stephan.seitz@fau.de>
@@ -405,7 +405,7 @@ int MultilevelProposeROI::enqueue( | |||
static_cast<float>(mImageSize.d[1]), // Input Height | |||
static_cast<float>(mImageSize.d[2]), | |||
DataType::kFLOAT, // mType, | |||
mParam, proposal_ws, workspace + kernel_workspace_offset, | |||
mParam, proposal_ws, reinterpret_cast<uint8_t*>(workspace) + kernel_workspace_offset, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please update to static_cast
to go from void *
to T *
:
https://github.com/NVIDIA/TensorRT/blob/master/CODING-GUIDELINES.md#casts
@@ -418,8 +418,8 @@ int MultilevelProposeROI::enqueue( | |||
|
|||
ConcatTopKWorkSpace ctopk_ws(batch_size, mFeatureCnt, mKeepTopK, mType); | |||
status = ConcatTopK(stream, batch_size, mFeatureCnt, mKeepTopK, DataType::kFLOAT, | |||
workspace + kernel_workspace_offset, ctopk_ws, reinterpret_cast<void**>(mDeviceScores), | |||
reinterpret_cast<void**>(mDeviceBboxes), final_proposals); | |||
reinterpret_cast<uint8_t*>(workspace) + kernel_workspace_offset, ctopk_ws, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above - please use static_cast
…IDIA#1028 Signed-off-by: Rajeev Rao <rajeevrao@nvidia.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution. Fix is merged in 21.04 release. Changes no longer required here - closing.
Thanks! Sorry forgot about this PR. |
Clang disallows non-standard pointer arithmetic on void pointers.
This causes the build of multilevelProposeROIPlugin.cpp to fail
using clang 12 when the void pointers are not casted to bytes.
Signed-off-by: Stephan Seitz stephan.seitz@fau.de