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

Avoid arithmetic on void pointer in multilevelProposeROIPlugin.cpp #1028

Conversation

theHamsta
Copy link
Contributor

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 [email protected]

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 <[email protected]>
@theHamsta theHamsta changed the title Avoid arithmetic of void pointer in multilevelProposeROIPlugin.cpp Avoid arithmetic on void pointer in multilevelProposeROIPlugin.cpp Jan 25, 2021
@@ -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,
Copy link
Collaborator

Choose a reason for hiding this comment

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

@@ -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,
Copy link
Collaborator

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

rajeevsrao added a commit to rajeevsrao/TensorRT that referenced this pull request Apr 12, 2021
rajeevsrao added a commit that referenced this pull request Apr 12, 2021
Copy link
Collaborator

@rajeevsrao rajeevsrao left a 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.

@rajeevsrao rajeevsrao closed this Apr 13, 2021
@theHamsta
Copy link
Contributor Author

Thanks! Sorry forgot about this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants