Skip to content

Commit 3ad2fc4

Browse files
fix warning
warning: `error: not eliding copy on return [-Werror,-Wnrvo]`
1 parent d97c2b5 commit 3ad2fc4

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

include/alpaka/core/DemangleTypeNames.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ namespace alpaka::core
8080
std::copy(embeddedType.data() + start, embeddedType.data() + end, storage.data());
8181
storage[length] = '\0';
8282

83-
return storage;
83+
return std::move(storage);
8484
}
8585

8686
// Store the demangled type name as a null-terminated array of bytes.

include/alpaka/mem/view/Traits.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ namespace alpaka
9797
if constexpr(dim > 1)
9898
for(TIdx i = TDim::value - 1; i > 0; i--)
9999
pitchBytes[i - 1] = extent[i] * pitchBytes[i];
100-
return pitchBytes;
100+
return std::move(pitchBytes);
101101
}
102102

103103
//! Calculate the pitches from the extents and the one-dimensional pitch.
@@ -121,7 +121,7 @@ namespace alpaka
121121
if constexpr(dim > 2)
122122
for(TIdx i = TDim::value - 2; i > 0; i--)
123123
pitchBytes[i - 1] = extent[i] * pitchBytes[i];
124-
return pitchBytes;
124+
return std::move(pitchBytes);
125125
}
126126

127127
} // namespace detail

include/alpaka/workdiv/WorkDivHelpers.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ namespace alpaka
7979
}
8080
}
8181

82-
return divisorSet;
82+
return std::move(divisorSet);
8383
}
8484
} // namespace detail
8585

@@ -160,7 +160,7 @@ namespace alpaka
160160
Vec r;
161161
for(DimLoopInd i(0u); i < TDim::value; ++i)
162162
r[i] = core::divCeil(gridElemExtent[i], clippedThreadElemExtent[i]);
163-
return r;
163+
return std::move(r);
164164
}();
165165

166166
///////////////////////////////////////////////////////////////////
@@ -278,7 +278,7 @@ namespace alpaka
278278
Vec r;
279279
for(DimLoopInd i = 0; i < TDim::value; ++i)
280280
r[i] = core::divCeil(gridThreadExtent[i], blockThreadExtent[i]);
281-
return r;
281+
return std::move(r);
282282
}();
283283

284284

0 commit comments

Comments
 (0)