Skip to content

Commit 279da47

Browse files
committed
Fix another oversight
1 parent b296bc3 commit 279da47

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

librapid/include/librapid/cuda/cudaStorage.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ namespace librapid {
378378
if (this != &other) {
379379
size_t oldSize = m_size;
380380
m_size = other.m_size;
381-
if (other.m_size != m_size) LIBRAPID_UNLIKELY {
381+
if (oldSize != m_size) LIBRAPID_UNLIKELY {
382382
if (m_ownsData) LIBRAPID_LIKELY {
383383
// Reallocate
384384
detail::cudaSafeDeallocate(m_begin);

librapid/include/librapid/opencl/openclStorage.hpp

+3-6
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,7 @@ namespace librapid {
175175

176176
LIBRAPID_ALWAYS_INLINE OpenCLStorage &operator=(const OpenCLStorage &other);
177177

178-
LIBRAPID_ALWAYS_INLINE OpenCLStorage &
179-
operator=(OpenCLStorage &&other) noexcept;
178+
LIBRAPID_ALWAYS_INLINE OpenCLStorage &operator=(OpenCLStorage &&other) noexcept;
180179

181180
void set(const OpenCLStorage &other);
182181

@@ -217,7 +216,6 @@ namespace librapid {
217216
LIBRAPID_NODISCARD LIBRAPID_ALWAYS_INLINE cl::Buffer &data();
218217

219218
private:
220-
221219
SizeType m_size;
222220
cl::Buffer m_buffer;
223221
bool m_ownsData = true;
@@ -290,7 +288,7 @@ namespace librapid {
290288
if (this != &other) {
291289
size_t oldSize = m_size;
292290
m_size = other.m_size;
293-
if (other.m_size != m_size) LIBRAPID_UNLIKELY {
291+
if (oldSize != m_size) LIBRAPID_UNLIKELY {
294292
if (m_ownsData) LIBRAPID_LIKELY {
295293
m_buffer = cl::Buffer(
296294
global::openCLContext, bufferFlags, m_size * sizeof(Scalar));
@@ -309,8 +307,7 @@ namespace librapid {
309307
}
310308

311309
template<typename Scalar>
312-
OpenCLStorage<Scalar> &
313-
OpenCLStorage<Scalar>::operator=(OpenCLStorage &&other) noexcept {
310+
OpenCLStorage<Scalar> &OpenCLStorage<Scalar>::operator=(OpenCLStorage &&other) noexcept {
314311
LIBRAPID_CHECK_OPENCL;
315312
if (this != &other) {
316313
m_size = std::move(other.m_size);

0 commit comments

Comments
 (0)