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

BUG: Fix matrix matrix multiply in examples #82

Merged
merged 2 commits into from
May 7, 2024
Merged
Changes from all 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
11 changes: 6 additions & 5 deletions examples/mtr-kokkos-simple.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ int main(int argc, char *argv[]) {
matrix3D = FMatrixDevice <real_t> (10,10,10); // allocate dimensions and sizes

// Array example following the Fortran index convention,
// indicies go from 0 to less than N, last index varies the fastest
// indicies go from 0 to less than N, first index varies the fastest
FArrayDevice <int> arr3D(10,10,10);


Expand Down Expand Up @@ -236,11 +236,12 @@ int main(int argc, char *argv[]) {
// Multiply two arrays together
// D = A*B
FOR_ALL (i, 0, N,
j, 0, N,
k, 0, N,{

D(i,j) = A(i,k)*B(k,j);
j, 0, N,{

D(i,j) = 0.0;
for(int k=0; k<N; k++){
D(i,j) += A(i,k)*B(k,j);
}
}); // end parallel for

// backwards substitution
Expand Down
Loading