[SYCL] Fix mismatched-new-delete warning in compression.hpp#16483
Merged
againull merged 2 commits intointel:syclfrom Dec 27, 2024
Merged
[SYCL] Fix mismatched-new-delete warning in compression.hpp#16483againull merged 2 commits intointel:syclfrom
mismatched-new-delete warning in compression.hpp#16483againull merged 2 commits intointel:syclfrom
Conversation
Contributor
Author
|
@sarnex FYI |
sarnex
approved these changes
Dec 26, 2024
Contributor
sarnex
left a comment
There was a problem hiding this comment.
confirmed fixes the warning, thanks!
Contributor
|
@againull @intel/llvm-reviewers-runtime Does someone mind reviewing this? Thx :) |
againull
approved these changes
Dec 27, 2024
AlexeySachkov
pushed a commit
to AlexeySachkov/llvm
that referenced
this pull request
Mar 24, 2025
…16483) Fixed the following warning when DPC++ is built in Release mode with gcc 13: ``` In member function 'void std::default_delete<_Tp>::operator()(_Tp*) const [with _Tp = char]', inlined from 'std::unique_ptr<_Tp, _Dp>::~unique_ptr() [with _Tp = char; _Dp = std::default_delete<char>]' at /usr/include/c++/13/bits/unique_ptr.h:404:17, inlined from 'static std::unique_ptr<char> sycl::_V1::detail::ZSTDCompressor::DecompressBlob(const char*, size_t, size_t&)' at /tmp/llvm/sycl/source/detail/compression.hpp:139:3, inlined from 'void sycl::_V1::detail::CompressedRTDeviceBinaryImage::Decompress()' at /tmp/llvm/sycl/source/detail/device_binary_image.cpp:258:54: /usr/include/c++/13/bits/unique_ptr.h:99:9: error: 'void operator delete(void*, std::size_t)' called on pointer returned from a mismatched allocation function [-Werror=mismatched-new-delete] 99 | delete __ptr; | ^~~~~~~~~~~~ In file included from /tmp/llvm/sycl/source/detail/device_binary_image.cpp:13: In static member function 'static std::unique_ptr<char> sycl::_V1::detail::ZSTDCompressor::DecompressBlob(const char*, size_t, size_t&)', inlined from 'void sycl::_V1::detail::CompressedRTDeviceBinaryImage::Decompress()' at /tmp/llvm/sycl/source/detail/device_binary_image.cpp:258:54: /tmp/llvm/sycl/source/detail/compression.hpp:119:66: note: returned from 'void* operator new [](std::size_t)' 119 | auto dstBuffer = std::unique_ptr<char>(new char[dstBufferSize]); ``` Found in: intel#16463 (comment)
AlexeySachkov
added a commit
that referenced
this pull request
Mar 25, 2025
Fixed the following warning when DPC++ is built in Release mode with gcc
13:
```
In member function 'void std::default_delete<_Tp>::operator()(_Tp*) const [with _Tp = char]',
inlined from 'std::unique_ptr<_Tp, _Dp>::~unique_ptr() [with _Tp = char; _Dp = std::default_delete<char>]' at /usr/include/c++/13/bits/unique_ptr.h:404:17,
inlined from 'static std::unique_ptr<char> sycl::_V1::detail::ZSTDCompressor::DecompressBlob(const char*, size_t, size_t&)' at /tmp/llvm/sycl/source/detail/compression.hpp:139:3,
inlined from 'void sycl::_V1::detail::CompressedRTDeviceBinaryImage::Decompress()' at /tmp/llvm/sycl/source/detail/device_binary_image.cpp:258:54:
/usr/include/c++/13/bits/unique_ptr.h:99:9: error: 'void operator delete(void*, std::size_t)' called on pointer returned from a mismatched allocation function [-Werror=mismatched-new-delete]
99 | delete __ptr;
| ^~~~~~~~~~~~
In file included from /tmp/llvm/sycl/source/detail/device_binary_image.cpp:13:
In static member function 'static std::unique_ptr<char> sycl::_V1::detail::ZSTDCompressor::DecompressBlob(const char*, size_t, size_t&)',
inlined from 'void sycl::_V1::detail::CompressedRTDeviceBinaryImage::Decompress()' at /tmp/llvm/sycl/source/detail/device_binary_image.cpp:258:54:
/tmp/llvm/sycl/source/detail/compression.hpp:119:66: note: returned from 'void* operator new [](std::size_t)'
119 | auto dstBuffer = std::unique_ptr<char>(new char[dstBufferSize]);
```
Found in:
#16463 (comment)
This is a cherry-pick of #16483
Patch-by: Udit Kumar Agarwal <udit.agarwal@intel.com>
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.
Fixed the following warning when DPC++ is built in Release mode with gcc 13:
Found in: #16463 (comment)