Skip to content

Commit

Permalink
Drop Accessor
Browse files Browse the repository at this point in the history
Fixes: #1897
  • Loading branch information
bernhardmgruber committed Aug 3, 2023
1 parent 727f55b commit b6eb4b6
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 809 deletions.
2 changes: 0 additions & 2 deletions include/alpaka/alpaka.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,7 @@
#include "alpaka/mem/fence/MemFenceOmp2Threads.hpp"
#include "alpaka/mem/fence/MemFenceUniformCudaHipBuiltIn.hpp"
#include "alpaka/mem/fence/Traits.hpp"
#include "alpaka/mem/view/Accessor.hpp"
#include "alpaka/mem/view/Traits.hpp"
#include "alpaka/mem/view/ViewAccessor.hpp"
#include "alpaka/mem/view/ViewConst.hpp"
#include "alpaka/mem/view/ViewPlainPtr.hpp"
#include "alpaka/mem/view/ViewStdArray.hpp"
Expand Down
1 change: 0 additions & 1 deletion include/alpaka/mem/buf/BufGenericSycl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#include "alpaka/dim/Traits.hpp"
#include "alpaka/mem/buf/BufCpu.hpp"
#include "alpaka/mem/buf/Traits.hpp"
#include "alpaka/mem/view/Accessor.hpp"
#include "alpaka/mem/view/ViewAccessOps.hpp"
#include "alpaka/vec/Vec.hpp"

Expand Down
2 changes: 0 additions & 2 deletions include/alpaka/mem/buf/sycl/Accessor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
#pragma once

#include "alpaka/dim/DimIntegralConst.hpp"
#include "alpaka/mem/view/Accessor.hpp"
#include "alpaka/mem/view/ViewAccessor.hpp"

#include <cstddef>
#include <utility>
Expand Down
162 changes: 0 additions & 162 deletions include/alpaka/mem/view/Accessor.hpp

This file was deleted.

23 changes: 17 additions & 6 deletions include/alpaka/mem/view/ViewAccessOps.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,32 @@

#include "alpaka/dim/Traits.hpp"
#include "alpaka/extent/Traits.hpp"
#include "alpaka/mem/view/ViewAccessor.hpp"
#include "alpaka/mem/view/Traits.hpp"

#include <sstream>
#include <type_traits>

namespace alpaka::internal
{
template<typename T, typename SFINAE = void>
inline constexpr bool isView = false;

// TODO(bgruber): replace this by a concept in C++20
template<typename TView>
inline constexpr bool isView<
TView,
std::void_t<
Idx<TView>,
Dim<TView>,
decltype(getPtrNative(std::declval<TView>())),
decltype(getPitchBytes<0>(std::declval<TView>())),
decltype(getExtent<0>(std::declval<TView>()))>> = true;

template<typename TView>
struct ViewAccessOps
{
static_assert(isView<TView>);

private:
using value_type = Elem<TView>;
using pointer = value_type*;
Expand All @@ -25,11 +41,6 @@ namespace alpaka::internal
using Idx = alpaka::Idx<TView>;

public:
ViewAccessOps()
{
static_assert(experimental::trait::internal::IsView<TView>::value);
}

ALPAKA_FN_HOST auto data() -> pointer
{
return getPtrNative(*static_cast<TView*>(this));
Expand Down
Loading

0 comments on commit b6eb4b6

Please sign in to comment.