Skip to content

Commit

Permalink
Rename extentBuf, extentView and offsetView
Browse files Browse the repository at this point in the history
  • Loading branch information
j-stephan committed Sep 6, 2023
1 parent 19e2cfa commit 3208419
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 23 deletions.
10 changes: 5 additions & 5 deletions test/unit/mem/view/src/ViewPlainPtrTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,18 @@ namespace alpaka::test
auto const platform = alpaka::Platform<TAcc>{};
auto const dev = alpaka::getDevByIdx(platform, 0);

auto const extentBuf = alpaka::test::extentBuf<Dim, Idx>;
auto buf = alpaka::allocBuf<TElem, Idx>(dev, extentBuf);
auto const bufExtent = alpaka::test::extentBuf<Dim, Idx>;
auto buf = alpaka::allocBuf<TElem, Idx>(dev, bufExtent);

auto const extentView = extentBuf;
auto const offsetView = alpaka::Vec<Dim, Idx>::all(static_cast<Idx>(0));
auto const viewExtent = bufExtent;
auto const viewOffset = alpaka::Vec<Dim, Idx>::all(static_cast<Idx>(0));
View view(
alpaka::getPtrNative(buf),
alpaka::getDev(buf),
alpaka::getExtents(buf),
alpaka::getPitchesInBytes(buf));

alpaka::test::testViewImmutable<TElem>(std::as_const(view), dev, extentView, offsetView);
alpaka::test::testViewImmutable<TElem>(std::as_const(view), dev, viewExtent, viewOffset);
if constexpr(!Const)
{
using Queue = alpaka::test::DefaultQueue<Dev>;
Expand Down
36 changes: 18 additions & 18 deletions test/unit/mem/view/src/ViewSubViewTest.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright 2022 Axel Huebl, Benjamin Worpitz, Erik Zenker, Bernhard Manfred Gruber, Jan Stephan
/* Copyright 2023 Axel Hübl, Benjamin Worpitz, Erik Zenker, Bernhard Manfred Gruber, Jan Stephan
* SPDX-License-Identifier: MPL-2.0
*/

Expand Down Expand Up @@ -78,14 +78,14 @@ namespace alpaka::test
auto const platform = alpaka::Platform<TAcc>{};
auto const dev = alpaka::getDevByIdx(platform, 0);

auto const extentBuf = alpaka::test::extentBuf<Dim, Idx>;
auto buf = alpaka::allocBuf<TElem, Idx>(dev, extentBuf);
auto const bufExtent = alpaka::test::extentBuf<Dim, Idx>;
auto buf = alpaka::allocBuf<TElem, Idx>(dev, bufExtent);

auto const extentView = extentBuf;
auto const offsetView = alpaka::Vec<Dim, Idx>::zeros();
auto const viewExtent = bufExtent;
auto const viewOffset = alpaka::Vec<Dim, Idx>::zeros();
View view(buf);

alpaka::test::testViewSubViewMutable<TAcc>(view, buf, dev, extentView, offsetView);
alpaka::test::testViewSubViewMutable<TAcc>(view, buf, dev, viewExtent, viewOffset);
}

template<typename TAcc, typename TElem>
Expand All @@ -99,14 +99,14 @@ namespace alpaka::test
auto const platform = alpaka::Platform<TAcc>{};
auto const dev = alpaka::getDevByIdx(platform, 0);

auto const extentBuf = alpaka::test::extentBuf<Dim, Idx>;
auto buf = alpaka::allocBuf<TElem, Idx>(dev, extentBuf);
auto const bufExtent = alpaka::test::extentBuf<Dim, Idx>;
auto buf = alpaka::allocBuf<TElem, Idx>(dev, bufExtent);

auto const extentView = alpaka::test::extentSubView<Dim, Idx>;
auto const offsetView = alpaka::test::offset<Dim, Idx>;
View view(buf, extentView, offsetView);
auto const viewExtent = alpaka::test::extentSubView<Dim, Idx>;
auto const viewOffset = alpaka::test::offset<Dim, Idx>;
View view(buf, viewExtent, viewOffset);

alpaka::test::testViewSubViewMutable<TAcc>(view, buf, dev, extentView, offsetView);
alpaka::test::testViewSubViewMutable<TAcc>(view, buf, dev, viewExtent, viewOffset);
}

template<typename TAcc, typename TElem>
Expand All @@ -120,14 +120,14 @@ namespace alpaka::test
auto const platform = alpaka::Platform<TAcc>{};
auto const dev = alpaka::getDevByIdx(platform, 0);

auto const extentBuf = alpaka::test::extentBuf<Dim, Idx>;
auto buf = alpaka::allocBuf<TElem, Idx>(dev, extentBuf);
auto const bufExtent = alpaka::test::extentBuf<Dim, Idx>;
auto buf = alpaka::allocBuf<TElem, Idx>(dev, bufExtent);

auto const extentView = alpaka::test::extentSubView<Dim, Idx>;
auto const offsetView = alpaka::test::offset<Dim, Idx>;
View const view(buf, extentView, offsetView);
auto const viewExtent = alpaka::test::extentSubView<Dim, Idx>;
auto const viewOffset = alpaka::test::offset<Dim, Idx>;
View const view(buf, viewExtent, viewOffset);

alpaka::test::testViewSubViewImmutable<TAcc>(view, buf, dev, extentView, offsetView);
alpaka::test::testViewSubViewImmutable<TAcc>(view, buf, dev, viewExtent, viewOffset);
}
} // namespace alpaka::test
#if BOOST_COMP_GNUC
Expand Down

0 comments on commit 3208419

Please sign in to comment.