1 #ifndef VERTEX_LIST_HPP
2 #define VERTEX_LIST_HPP
11 using exspace =
typename Device::execution_space;
21 KOKKOS_INLINE_FUNCTION
int size()
const{
26 View<IntegerRange*,CLayout,Device>
ranges;
43 bool was_in_list =
false;
44 for(
int i=0; i<n+1; i++){
46 if(i<n) in_list = condition(i);
49 if(in_list && !was_in_list){
54 if(was_in_list && !in_list){
64 ranges = View<IntegerRange*,CLayout,Device>(
NoInit(
"ranges"), nranges);
65 singlets = View<int*,CLayout,Device>(
NoInit(
"singlets"), nsinglets);
72 for(
int i=0; i<n+1; i++){
74 if(i<n) in_list = condition(i);
77 if(in_list && !was_in_list){
82 if(was_in_list && !in_list){
87 ranges(nranges) = {istart, i};
95 VertexList(
const View<int*,CLayout,Device>& unordered_full_list,
bool one_indexed);
101 for (
int is=0; is<
ranges.size(); is++){
126 for (
int is=0; is<
ranges.size(); is++){
127 if(
ranges(is).is_in_range(i))
return true;
131 for(
int is=0; is<
singlets.size(); is++){
139 KOKKOS_INLINE_FUNCTION
int size(){
143 for (
int is=0; is<
ranges.size(); is++){
155 template<
typename DeviceExSpace,
typename F>
156 inline void for_all(
const std::string label, F lambda_func)
const {
158 for (
int is=0; is<
ranges.size(); is++){
165 lambda_func(singlets_c(i));
169 void pack_contiguous(
const View<double*, CLayout, HostType>& input,
const View<double*, CLayout, HostType>& contiguous)
const;
171 void unpack_contiguous(
const View<double*, CLayout, HostType>& contiguous,
const View<double*, CLayout, HostType>& output)
const;
void parallel_for(F func) const
Definition: vertex_list.hpp:99
VertexList intersection(const VertexList &list2) const
VertexList()
Definition: vertex_list.hpp:31
VertexList(int n, F condition)
Definition: vertex_list.hpp:39
void unpack_contiguous(const View< double *, CLayout, HostType > &contiguous, const View< double *, CLayout, HostType > &output) const
KOKKOS_INLINE_FUNCTION int size() const
Definition: vertex_list.hpp:21
KOKKOS_INLINE_FUNCTION int size()
Definition: vertex_list.hpp:139
KOKKOS_INLINE_FUNCTION bool is_in_range(int i) const
Definition: vertex_list.hpp:17
typename Device::execution_space exspace
Use execution space where views are allocated.
Definition: vertex_list.hpp:11
int start
Definition: vertex_list.hpp:14
Definition: vertex_list.hpp:13
int end
Definition: vertex_list.hpp:15
void pack_contiguous(const View< double *, CLayout, HostType > &input, const View< double *, CLayout, HostType > &contiguous) const
View< int *, CLayout, Device > singlets
Definition: vertex_list.hpp:27
void for_all(const std::string label, F lambda_func) const
Definition: vertex_list.hpp:156
View< IntegerRange *, CLayout, Device > ranges
Definition: vertex_list.hpp:26
Definition: vertex_list.hpp:9
KOKKOS_INLINE_FUNCTION bool is_in_list(int i) const
Definition: vertex_list.hpp:124
void parallel_for(const std::string name, int n_ptl, Function func, Option option, HostAoSoA aosoa_h, DeviceAoSoA aosoa_d)
Definition: streamed_parallel_for.hpp:252
bool is_contiguous() const
Kokkos::ViewAllocateWithoutInitializing NoInit
Definition: space_settings.hpp:68