Skip to content

Commit 4bb06e6

Browse files
authored
Merge pull request #109 from lanl/Danielquickadds
Merging in DualRaggedRight and locks on simple Dual types.
2 parents 2d7b591 + 7fe1530 commit 4bb06e6

File tree

4 files changed

+594
-11
lines changed

4 files changed

+594
-11
lines changed

examples/CMakeLists.txt

+3
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,9 @@ if (KOKKOS)
113113
add_executable(annkokkos_compare ann_kokkos_compare.cpp)
114114
target_link_libraries(annkokkos_compare ${LINKING_LIBRARIES})
115115

116+
#add_executable(ompperftest ompperftest.cpp)
117+
#target_link_libraries(ompperftest ${LINKING_LIBRARIES})
118+
116119
if (Matar_ENABLE_TRILINOS)
117120
add_executable(anndistributed ann_distributed.cpp)
118121
target_link_libraries(anndistributed ${LINKING_LIBRARIES})

examples/main_kokkos.cpp

+41
Original file line numberDiff line numberDiff line change
@@ -755,6 +755,47 @@ int main(int argc, char* argv[])
755755

756756
RaggedRightArrayKokkos<int> lower_tri(some_strides);
757757

758+
// -----------------------
759+
// DRaggedRightArray
760+
// -----------------------
761+
printf("\nRagged Right Array\n");
762+
// testing ragged initialized with CArrayKokkos for strides
763+
CArrayKokkos<size_t> some_strides_d(4);
764+
765+
// create a lower-triangular array
766+
RUN({
767+
some_strides_d(0) = 1;
768+
some_strides_d(1) = 2;
769+
some_strides_d(2) = 3;
770+
some_strides_d(3) = 4;
771+
});
772+
773+
DRaggedRightArrayKokkos<int> lower_tri_d(some_strides_d);
774+
FOR1D(j, 0, 1, {
775+
lower_tri_d(0, j) = 0 + j;
776+
});
777+
FOR1D(j, 0, 2, {
778+
lower_tri_d(1, j) = 1 + j;
779+
});
780+
FOR1D(j, 0, 3, {
781+
lower_tri_d(2, j) = 3 + j;
782+
});
783+
FOR1D(j, 0, 4, {
784+
lower_tri_d(3, j) = 6 + j;
785+
});
786+
Kokkos::fence();
787+
lower_tri_d.update_host();
788+
Kokkos::fence();
789+
790+
printf("DanielRagged\n");
791+
int cccount = 0;
792+
for (int i = 0; i < 4; i++) {
793+
for (int j = 0; j < i+1; j++) {
794+
printf("%d ", lower_tri_d.get_kokkos_dual_view().h_view(cccount++));
795+
}
796+
printf("\n");
797+
}
798+
758799
// -----------------------
759800
// CArray view
760801
// -----------------------

lib/.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Trilinos
1+
Trilinos

0 commit comments

Comments
 (0)