Avoid arithmetic on void pointer in multilevelProposeROIPlugin.cpp#1028
Closed
theHamsta wants to merge 1 commit intoNVIDIA:masterfrom
Closed
Avoid arithmetic on void pointer in multilevelProposeROIPlugin.cpp#1028theHamsta wants to merge 1 commit intoNVIDIA:masterfrom
theHamsta wants to merge 1 commit intoNVIDIA:masterfrom
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>
rajeevsrao
reviewed
Mar 19, 2021
| 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, |
Collaborator
There was a problem hiding this comment.
Please update to static_cast to go from void * to T *:
https://github.com/NVIDIA/TensorRT/blob/master/CODING-GUIDELINES.md#casts
| 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, |
Collaborator
There was a problem hiding this comment.
Same as above - please use static_cast
rajeevsrao
added a commit
to rajeevsrao/TensorRT
that referenced
this pull request
Apr 12, 2021
…IDIA#1028 Signed-off-by: Rajeev Rao <rajeevrao@nvidia.com>
rajeevsrao
reviewed
Apr 13, 2021
Collaborator
rajeevsrao
left a comment
There was a problem hiding this comment.
Thanks for your contribution. Fix is merged in 21.04 release. Changes no longer required here - closing.
Contributor
Author
|
Thanks! Sorry forgot about this PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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