Skip to content

Commit

Permalink
replace tree mapping in shared memory by SoA and fix CUDA build
Browse files Browse the repository at this point in the history
  • Loading branch information
bernhardmgruber committed Nov 13, 2020
1 parent 11df0fd commit 8c3d972
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions examples/alpaka/asyncblur/asyncblur.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,12 @@ struct BlurKernel
{
// Using SoA for the shared memory
constexpr auto sharedChunkSize = ElemsPerBlock + 2 * KernelSize;
const auto sharedMapping = llama::mapping::tree::Mapping(
const auto sharedMapping = llama::mapping::SoA(
typename View::ArrayDomain{sharedChunkSize, sharedChunkSize},
llama::Tuple{llama::mapping::tree::functor::LeafOnlyRT()},
typename View::DatumDomain{});
constexpr auto sharedMemSize = llama::sizeOf<PixelOnAcc> * sharedChunkSize * sharedChunkSize;
auto& sharedMem = alpaka::allocVar<std::byte[sharedMemSize], __COUNTER__>(acc);
return llama::View{sharedMapping, llama::Array{&sharedMem[0]}};
return llama::View(sharedMapping, llama::Array<std::byte*, 1>{&sharedMem[0]});
}
else
return int{}; // dummy
Expand Down

0 comments on commit 8c3d972

Please sign in to comment.