17#ifndef KOKKOS_CORE_EXP_INTEROP_HPP
18#define KOKKOS_CORE_EXP_INTEROP_HPP
19#ifndef KOKKOS_IMPL_PUBLIC_INCLUDE
20#define KOKKOS_IMPL_PUBLIC_INCLUDE
21#define KOKKOS_IMPL_PUBLIC_INCLUDE_NOTDEFINED_INTEROP
24#include <Kokkos_Core_fwd.hpp>
26#include <Kokkos_MemoryTraits.hpp>
27#include <Kokkos_View.hpp>
28#include <impl/Kokkos_Utilities.hpp>
39struct device_memory_space {
43template <
typename ExecT,
typename MemT>
44struct device_memory_space<Kokkos::Device<ExecT, MemT>> {
49using device_memory_space_t =
typename device_memory_space<Tp>::type;
55template <
typename,
typename...>
56struct python_view_type_impl;
58template <
template <
typename...>
class ViewT,
typename ValueT,
60struct python_view_type_impl<ViewT<ValueT>, type_list<Types...>> {
61 using type = ViewT<ValueT, device_memory_space_t<Types>...>;
64template <
template <
typename...>
class ViewT,
typename ValueT,
66struct python_view_type_impl<ViewT<ValueT, Types...>>
67 : python_view_type_impl<ViewT<ValueT>,
68 filter_type_list_t<is_default_memory_trait,
69 type_list<Types...>, false>> {};
71template <
typename... T>
72using python_view_type_impl_t =
typename python_view_type_impl<T...>::type;
83template <
typename ViewT>
84struct python_view_type {
88 Kokkos::Impl::python_view_type_impl_t<typename ViewT::array_type>;
91template <
typename ViewT>
92using python_view_type_t =
typename python_view_type<ViewT>::type;
95auto as_python_type(Tp&& _v) {
96 using cast_type = python_view_type_t<Tp>;
97 return static_cast<cast_type
>(std::forward<Tp>(_v));
102#ifdef KOKKOS_IMPL_PUBLIC_INCLUDE_NOTDEFINED_INTEROP
103#undef KOKKOS_IMPL_PUBLIC_INCLUDE
104#undef KOKKOS_IMPL_PUBLIC_INCLUDE_NOTDEFINED_INTEROP
Declaration of various MemoryLayout options.
A thread safe view to a bitset.