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

Danielquickadds #109

Merged
merged 4 commits into from
Feb 10, 2025
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,9 @@ if (KOKKOS)
add_executable(annkokkos_compare ann_kokkos_compare.cpp)
target_link_libraries(annkokkos_compare ${LINKING_LIBRARIES})

add_executable(ompperftest ompperftest.cpp)
target_link_libraries(ompperftest ${LINKING_LIBRARIES})

if (Matar_ENABLE_TRILINOS)
add_executable(anndistributed ann_distributed.cpp)
target_link_libraries(anndistributed ${LINKING_LIBRARIES})
Expand Down
41 changes: 41 additions & 0 deletions examples/main_kokkos.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -755,6 +755,47 @@ int main(int argc, char* argv[])

RaggedRightArrayKokkos<int> lower_tri(some_strides);

// -----------------------
// DRaggedRightArray
// -----------------------
printf("\nRagged Right Array\n");
// testing ragged initialized with CArrayKokkos for strides
CArrayKokkos<size_t> some_strides_d(4);

// create a lower-triangular array
RUN({
some_strides_d(0) = 1;
some_strides_d(1) = 2;
some_strides_d(2) = 3;
some_strides_d(3) = 4;
});

DRaggedRightArrayKokkos<int> lower_tri_d(some_strides_d);
FOR1D(j, 0, 1, {
lower_tri_d(0, j) = 0 + j;
});
FOR1D(j, 0, 2, {
lower_tri_d(1, j) = 1 + j;
});
FOR1D(j, 0, 3, {
lower_tri_d(2, j) = 3 + j;
});
FOR1D(j, 0, 4, {
lower_tri_d(3, j) = 6 + j;
});
Kokkos::fence();
lower_tri_d.update_host();
Kokkos::fence();

printf("DanielRagged\n");
int cccount = 0;
for (int i = 0; i < 4; i++) {
for (int j = 0; j < i+1; j++) {
printf("%d ", lower_tri_d.get_kokkos_dual_view().h_view(cccount++));
}
printf("\n");
}

// -----------------------
// CArray view
// -----------------------
Expand Down
Loading
Loading