diff --git a/src/include/kokkos_types.h b/src/include/kokkos_types.h index 8a6f092..ff70bcf 100644 --- a/src/include/kokkos_types.h +++ b/src/include/kokkos_types.h @@ -6742,12 +6742,20 @@ class RaggedRightArrayKokkos { //setup start indices void data_setup(const std::string& tag_string); + //return pointer KOKKOS_INLINE_FUNCTION T* pointer(); //return the view KOKKOS_INLINE_FUNCTION TArray1D get_kokkos_view(); + + //print values + void print() const; + + //set values to input + KOKKOS_INLINE_FUNCTION + void set_values(T val); // Get the name of the view KOKKOS_INLINE_FUNCTION @@ -7072,6 +7080,15 @@ Kokkos::View RaggedRightArrayKokkos +KOKKOS_INLINE_FUNCTION +void RaggedRightArrayKokkos::set_values(T val) { + Kokkos::parallel_for("SetValues_RaggedRightArrayKokkos", length_, KOKKOS_CLASS_LAMBDA(const int i) { + array_(i) = val; + }); +} + // Get the name of the view template KOKKOS_INLINE_FUNCTION @@ -7079,7 +7096,6 @@ const std::string RaggedRightArrayKokkos KOKKOS_INLINE_FUNCTION @@ -7503,6 +7519,7 @@ class RaggedDownArrayKokkos { KOKKOS_INLINE_FUNCTION T& operator()(size_t i, size_t j) const; + //return pointer KOKKOS_INLINE_FUNCTION T* pointer(); @@ -7516,6 +7533,13 @@ class RaggedDownArrayKokkos { KOKKOS_INLINE_FUNCTION RaggedDownArrayKokkos& operator= (const RaggedDownArrayKokkos &temp); + + //print values + void print() const; + + //set values to input + KOKKOS_INLINE_FUNCTION + void set_values(T val); // Kokkos views of strides and start indices Strides1D mystrides_; @@ -7805,13 +7829,15 @@ Kokkos::View RaggedDownArrayKokkos KOKKOS_INLINE_FUNCTION void RaggedDownArrayKokkos::set_values(T val) { - Kokkos:parallel_for( Kokkos::RangePolicy<> ( 0, length_), KOKKOS_CLASS_LAMBDA(const int i){ + Kokkos::parallel_for("SetValues_RaggedDownArrayKokkos", length_, KOKKOS_CLASS_LAMBDA(const int i) { array_(i) = val; }); } + // Get the name of the view template KOKKOS_INLINE_FUNCTION @@ -7869,6 +7895,10 @@ class DynamicRaggedRightArrayKokkos { KOKKOS_INLINE_FUNCTION const std::string get_name() const; + // set values to input + KOKKOS_INLINE_FUNCTION + void set_values(T val); + // Overload operator() to access data as array(i,j), // where i=[0:N-1], j=[stride(i)] KOKKOS_INLINE_FUNCTION @@ -8006,10 +8036,11 @@ Kokkos::View DynamicRaggedRightArrayKokkos< return array_; } +//set values to input template KOKKOS_INLINE_FUNCTION void DynamicRaggedRightArrayKokkos::set_values(T val) { - Kokkos:parallel_for( Kokkos::RangePolicy<> ( 0, length_), KOKKOS_CLASS_LAMBDA(const int i){ + Kokkos::parallel_for("SetValues_DynamicRaggedRightArrayKokkos", length_, KOKKOS_CLASS_LAMBDA(const int i) { array_(i) = val; }); } @@ -8084,6 +8115,10 @@ class DynamicRaggedDownArrayKokkos { KOKKOS_INLINE_FUNCTION const std::string get_name() const; + //set values to input + KOKKOS_INLINE_FUNCTION + void set_values(T val); + // Overload operator() to access data as array(i,j), // where i=[stride(j)], j=[0:N-1] KOKKOS_INLINE_FUNCTION @@ -8221,10 +8256,11 @@ Kokkos::View DynamicRaggedDownArrayKokkos KOKKOS_INLINE_FUNCTION void DynamicRaggedDownArrayKokkos::set_values(T val) { - Kokkos:parallel_for( Kokkos::RangePolicy<> ( 0, length_), KOKKOS_CLASS_LAMBDA(const int i){ + Kokkos::parallel_for("SetValues_DynamicRaggedDownArrayKokkos", length_, KOKKOS_CLASS_LAMBDA(const int i) { array_(i) = val; }); }