-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add DAXPY_ATOMIC, formatting, in REDUCE3, Kokkos::min, Kokkos::max
- Loading branch information
1 parent
0d8b139
commit 1320300
Showing
6 changed files
with
112 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// | ||
// Copyright (c) 2017-21, Lawrence Livermore National Security, LLC | ||
// and RAJA Performance Suite project contributors. | ||
// See the RAJAPerf/LICENSE file for details. | ||
// | ||
// SPDX-License-Identifier: (BSD-3-Clause) | ||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// | ||
|
||
#include "DAXPY_ATOMIC.hpp" | ||
#include "common/KokkosViewUtils.hpp" | ||
#include <iostream> | ||
|
||
// Delete me | ||
// For de-bugging: | ||
#include "RAJA/RAJA.hpp" | ||
|
||
namespace rajaperf { | ||
namespace basic { | ||
|
||
void DAXPY_ATOMIC::runKokkosVariant(VariantID vid) { | ||
|
||
const Index_type run_reps = getRunReps(); | ||
const Index_type ibegin = 0; | ||
const Index_type iend = getActualProblemSize(); | ||
|
||
DAXPY_ATOMIC_DATA_SETUP; | ||
// | ||
// Kokkos Views to wrap pointers declared in DAXPY_ATOMIC.hpp | ||
// | ||
|
||
auto x_view = getViewFromPointer(x, iend); | ||
auto y_view = getViewFromPointer(y, iend); | ||
|
||
switch (vid) { | ||
|
||
case Kokkos_Lambda: { | ||
|
||
Kokkos::fence(); | ||
startTimer(); | ||
|
||
for (RepIndex_type irep = 0; irep < run_reps; ++irep) { | ||
|
||
Kokkos::parallel_for( | ||
"DAXPY_ATOMIC_Kokkos Kokkos_Lambda", | ||
Kokkos::RangePolicy<Kokkos::DefaultExecutionSpace>(ibegin, iend), | ||
KOKKOS_LAMBDA(Index_type i) { | ||
Kokkos::atomic_add(&y_view[i], a * x_view[i]); | ||
}); | ||
} | ||
|
||
Kokkos::fence(); | ||
stopTimer(); | ||
|
||
break; | ||
} | ||
|
||
default: { | ||
getCout() << "\n DAXPY_ATOMIC : Unknown variant id = " << vid << std::endl; | ||
} | ||
} | ||
|
||
moveDataToHostFromKokkosView(x, x_view, iend); | ||
moveDataToHostFromKokkosView(y, y_view, iend); | ||
} | ||
|
||
} // end namespace basic | ||
} // end namespace rajaperf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters