Skip to content

Commit

Permalink
workaround g++ < 11 failing to handle lambda force inline and trailin…
Browse files Browse the repository at this point in the history
…g return type
  • Loading branch information
bernhardmgruber committed May 30, 2021
1 parent c38e311 commit 534f806
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/viewcopy/viewcopy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,12 +199,12 @@ void aosoa_copy_internal(const SrcView& srcView, DstView& dstView, std::size_t n
return offset;
};
// the same as SoA::blobNrAndOffset but takes a flat array index
auto mapSoA = [&](std::size_t flatArrayIndex, auto coord, bool mb) LLAMA_LAMBDA_INLINE -> llama::NrAndOffset
auto mapSoA = [&](std::size_t flatArrayIndex, auto coord, bool mb) LLAMA_LAMBDA_INLINE
{
const auto blob = mb * llama::flatRecordCoord<RecordDim, decltype(coord)>;
const auto offset = !mb * llama::offsetOf<RecordDim, decltype(coord)> * flatSize
+ sizeof(llama::GetType<RecordDim, decltype(coord)>) * flatArrayIndex;
return {blob, offset};
return llama::NrAndOffset{blob, offset};
};

auto mapSrc = [&srcView, &mapAoSoA, &mapSoA](std::size_t flatArrayIndex, auto coord) LLAMA_LAMBDA_INLINE
Expand Down

0 comments on commit 534f806

Please sign in to comment.