Skip to content

Commit

Permalink
fix error in Buffer constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
AuroraPerego authored and fwyzard committed Sep 2, 2024
1 parent a3e562b commit 71cbff3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 1 addition & 3 deletions test/unit/math/src/Buffer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,10 @@ namespace mathtest
using PlatformAcc = alpaka::Platform<DevAcc>;
using BufAcc = alpaka::Buf<DevAcc, TData, Dim, Idx>;

PlatformHost platformHost;
DevHost devHost;

BufHost hostBuffer;
BufAcc devBuffer;
PlatformAcc platformAcc;

// Native pointer to access buffer.
TData* const pHostBuffer;
Expand All @@ -54,7 +52,7 @@ namespace mathtest
Buffer() = delete;

// Constructor needs to initialize all Buffer.
Buffer(DevAcc const& devAcc)
Buffer(DevAcc const& devAcc, PlatformHost const& platformHost, PlatformAcc const& platformAcc)
: devHost{alpaka::getDevByIdx(platformHost, 0)}
, hostBuffer{alpaka::allocMappedBufIfSupported<TData, Idx>(devHost, platformAcc, Tcapacity)}
, devBuffer{alpaka::allocBuf<TData, Idx>(devAcc, Tcapacity)}
Expand Down
4 changes: 2 additions & 2 deletions test/unit/math/src/TestTemplate.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ namespace mathtest

TestKernel<capacity> kernel;
TFunctor functor;
Args args{devAcc};
Results results{devAcc};
Args args{devAcc, platformHost, platformAcc};
Results results{devAcc, platformHost, platformAcc};

// Let alpaka calculate good block and grid sizes given our full problem extent
alpaka::KernelCfg<TAcc> const kernelCfg
Expand Down

0 comments on commit 71cbff3

Please sign in to comment.