Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up defines #70

Open
Angelyr opened this issue Dec 4, 2024 · 0 comments
Open

Clean up defines #70

Angelyr opened this issue Dec 4, 2024 · 0 comments

Comments

@Angelyr
Copy link

Angelyr commented Dec 4, 2024

For example, do we need kkVec3dViewHostU (like kkVec2dViewHostU)

Here:

#pragma once
#include "pmpo_utils.hpp"
#define MP_ACTIVE 1
#define MP_DELETE -1
typedef void* MPMesh_ptr;
//Function that receives void* and returns an int
typedef int (*IntVoidFunc)(void*);
using space_t = Kokkos::DefaultExecutionSpace::memory_space;
/**
* Attention: this typedef is LayoutLeft, meaning that the first
* index is the contiguous one. This matches the Fortran and GPU conventions for
* allocations.
*/
//TODO: order of these typedefs to be done later
template<typename DataT>
using kkViewHostU = Kokkos::View<
DataT,
Kokkos::LayoutLeft,
Kokkos::DefaultHostExecutionSpace,
Kokkos::MemoryTraits<Kokkos::Unmanaged>>;
typedef kkViewHostU<double*> kkDblViewHostU;//TODO:put it to mesh.hpp
typedef kkViewHostU<polyMPO::vec2d_t*> kkVec2dViewHostU;//TODO:put it to mesh.hpp
typedef kkViewHostU<double**> kkDbl2dViewHostU;//TODO:put it somewhere else (maybe)
typedef kkViewHostU<int**> kkInt2dViewHostU;//TODO:put it somewhere else (maybe)
typedef kkViewHostU<int*> kkIntViewHostU;//TODO:put it somewhere else (maybe)
template <typename DataT>
auto create_mirror_view_and_copy(DataT array, const int size){
kkViewHostU<DataT> temp_host(array, size);
return Kokkos::create_mirror_view_and_copy(space_t(), temp_host);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant