Skip to content

Commit

Permalink
Don't include non-public header.
Browse files Browse the repository at this point in the history
  • Loading branch information
pkestene committed Oct 31, 2022
1 parent f8b82ce commit e202c83
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions src/flcl-cxx.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
#include <iostream>
#include <type_traits>
#include <Kokkos_Core.hpp>
#include <Kokkos_View.hpp>
#include <Kokkos_DualView.hpp>
#include "flcl-types-cxx.hpp"

Expand Down Expand Up @@ -73,7 +72,7 @@ using HostMemorySpace = Kokkos::HostSpace;
// an optimization, one could switch to using dualview types and manage the
// necessary memory transfer explicitly over larger compute regions.
namespace flcl {

#ifdef KOKKOS_ENABLE_CUDA
using HostMemorySpace = Kokkos::CudaUVMSpace;
#else
Expand Down Expand Up @@ -114,7 +113,7 @@ namespace flcl {
typedef Kokkos::View<flcl_view_i64_c_t*****,Kokkos::LayoutLeft,flcl::HostMemorySpace> view_i64_5d_t;
typedef Kokkos::View<flcl_view_r32_c_t*****,Kokkos::LayoutLeft,flcl::HostMemorySpace> view_r32_5d_t;
typedef Kokkos::View<flcl_view_r64_c_t*****,Kokkos::LayoutLeft,flcl::HostMemorySpace> view_r64_5d_t;

// 6D fortran-compatible view types
typedef Kokkos::View<flcl_view_l_c_t******,Kokkos::LayoutLeft,flcl::HostMemorySpace> view_l_6d_t;
typedef Kokkos::View<flcl_view_i32_c_t******,Kokkos::LayoutLeft,flcl::HostMemorySpace> view_i32_6d_t;
Expand All @@ -128,7 +127,7 @@ namespace flcl {
typedef Kokkos::View<flcl_view_i64_c_t*******,Kokkos::LayoutLeft,flcl::HostMemorySpace> view_i64_7d_t;
typedef Kokkos::View<flcl_view_r32_c_t*******,Kokkos::LayoutLeft,flcl::HostMemorySpace> view_r32_7d_t;
typedef Kokkos::View<flcl_view_r64_c_t*******,Kokkos::LayoutLeft,flcl::HostMemorySpace> view_r64_7d_t;

// 1D fortran-compatible dualview types
typedef Kokkos::DualView<flcl_dualview_l_c_t*,Kokkos::LayoutLeft> dualview_l_1d_t;
typedef Kokkos::DualView<flcl_dualview_i32_c_t*,Kokkos::LayoutLeft> dualview_i32_1d_t;
Expand Down Expand Up @@ -183,7 +182,7 @@ namespace flcl {
view_from_ndarray(flcl_ndarray_t const &ndarray) {
size_t dimensions[Kokkos::ARRAY_LAYOUT_MAX_RANK] = {};
size_t strides[Kokkos::ARRAY_LAYOUT_MAX_RANK] = {};

using traits = Kokkos::ViewTraits<DataType>;
using value_type = typename traits::value_type;
constexpr auto rank = Kokkos::ViewTraits<DataType>::rank;
Expand All @@ -193,7 +192,7 @@ namespace flcl {
<< ndarray.rank << "." << std::endl;
std::exit(EXIT_FAILURE);
}

std::copy(ndarray.dims, ndarray.dims + ndarray.rank, dimensions);
std::copy(ndarray.strides, ndarray.strides + ndarray.rank, strides);

Expand All @@ -209,7 +208,7 @@ namespace flcl {
dimensions[7], strides[7]
};
// clang-format on

return Kokkos::View<DataType, Kokkos::LayoutStride, flcl::HostMemorySpace, Kokkos::MemoryUnmanaged>(
reinterpret_cast<value_type *>(ndarray.data), layout);
}
Expand All @@ -232,7 +231,7 @@ namespace flcl {

return ndarray;
}

} // namespace flcl

#endif // FLCL_CXX_HPP
#endif // FLCL_CXX_HPP

0 comments on commit e202c83

Please sign in to comment.