Skip to content

Commit

Permalink
Merge pull request oneapi-src#1510 from kbenzie/benie/cuda-fix-wrappe…
Browse files Browse the repository at this point in the history
…r-escape

Fix Coverity wrapper escape issue
  • Loading branch information
kbenzie authored Apr 16, 2024
2 parents fe9a05e + 6027c6b commit 3f5f568
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions source/adapters/cuda/memory.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ struct BufferMem {
MapMem(nullptr) {}

BufferMap(size_t MapSize, size_t MapOffset, ur_map_flags_t MapFlags,
std::unique_ptr<unsigned char[]> &MapMem)
std::unique_ptr<unsigned char[]> &&MapMem)
: MapSize(MapSize), MapOffset(MapOffset), MapFlags(MapFlags),
MapMem(std::move(MapMem)) {}

Expand Down Expand Up @@ -105,7 +105,7 @@ struct BufferMem {
auto MapMem = std::make_unique<unsigned char[]>(MapSize);
MapPtr = MapMem.get();
PtrToBufferMap.insert(
{MapPtr, BufferMap(MapSize, MapOffset, MapFlags, MapMem)});
{MapPtr, BufferMap(MapSize, MapOffset, MapFlags, std::move(MapMem))});
} else {
/// However, if HostPtr already has valid memory (e.g. pinned allocation),
/// we can just use that memory for the mapping.
Expand Down

0 comments on commit 3f5f568

Please sign in to comment.