Skip to content

Commit

Permalink
Remove std::move to allow copy ellision; Moved header to source/detail
Browse files Browse the repository at this point in the history
  • Loading branch information
uditagarwal97 committed Sep 9, 2024
1 parent 7fdbd5e commit 312bd38
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class ZSTDCompressor {
instance.m_lastError = 0;

// Pass ownership of the buffer to the caller.
return std::move(dstBuffer);
return dstBuffer;
}

static std::unique_ptr<unsigned char>
Expand Down Expand Up @@ -120,7 +120,7 @@ class ZSTDCompressor {
}

// Pass ownership of the buffer to the caller.
return std::move(dstBuffer);
return dstBuffer;
}

// Data fields
Expand Down
6 changes: 3 additions & 3 deletions sycl/source/detail/device_binary_image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include <sycl/detail/ur.hpp>

// For device image compression.
#include <sycl/detail/compression.hpp>
#include <detail/compression.hpp>

#include <algorithm>
#include <cstring>
Expand Down Expand Up @@ -239,9 +239,9 @@ CompressedRTDeviceBinaryImage::CompressedRTDeviceBinaryImage(
CompressedBin->BinaryStart);

size_t DecompressedSize = 0;
m_DecompressedData = std::move(ZSTDCompressor::DecompressBlob(
m_DecompressedData = ZSTDCompressor::DecompressBlob(
reinterpret_cast<const char *>(CompressedBin->BinaryStart),
compressedDataSize, DecompressedSize));
compressedDataSize, DecompressedSize);

if (!m_DecompressedData) {
throw sycl::exception(
Expand Down
4 changes: 2 additions & 2 deletions sycl/source/detail/program_manager/program_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1653,9 +1653,9 @@ void ProgramManager::addImages(sycl_device_binaries DeviceBinary) {

std::unique_ptr<RTDeviceBinaryImage> Img;
if (isDeviceImageCompressed(RawImg))
Img = std::move(std::make_unique<CompressedRTDeviceBinaryImage>(RawImg));
Img = std::make_unique<CompressedRTDeviceBinaryImage>(RawImg);
else
Img = std::move(std::make_unique<RTDeviceBinaryImage>(RawImg));
Img = std::make_unique<RTDeviceBinaryImage>(RawImg);

static uint32_t SequenceID = 0;

Expand Down
2 changes: 1 addition & 1 deletion sycl/unittests/compression/CompressionTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//

#include <sycl/detail/compression.hpp>
#include <detail/compression.hpp>

#include <string>

Expand Down

0 comments on commit 312bd38

Please sign in to comment.