Skip to content

Commit

Permalink
Merge pull request #82 from lanl/Fix_multiply
Browse files Browse the repository at this point in the history
BUG: Fix matrix matrix multiply in examples
  • Loading branch information
jacob-moore22 authored May 7, 2024
2 parents 6fa0611 + b01a5b5 commit 6c8abc3
Showing 1 changed file with 6 additions and 5 deletions.
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

0 comments on commit 6c8abc3

Please sign in to comment.