-
Notifications
You must be signed in to change notification settings - Fork 50
Draft: Add SW4CK kernels #317
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
Draft
artv3
wants to merge
9
commits into
develop
Choose a base branch
from
artv3/SW4CK-kernels
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
4d18c31
intial commit for sw4 kernels
artv3 49a9d50
intial commit for SW4CK kernels
artv3 e827387
add in kernels -- does not compile yet
artv3 9fe2d13
code builds, need to populate with realistic parameters
artv3 3046342
made macros for SW4CK kernel 5
artv3 fd5d702
get kernel building --need to check range values
artv3 ae779c1
Merge branch 'develop' into artv3/SW4CK-kernels
artv3 4f58cc9
Merge branch 'develop' into artv3/SW4CK-kernels
artv3 6ea2aaf
partial compilation fixes
artv3 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,145 @@ | ||
| //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// | ||
| // Copyright (c) 2017-23, 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 "SW4CK_KERNEL_2.hpp" | ||
|
|
||
| #include "RAJA/RAJA.hpp" | ||
|
|
||
| #include "AppsData.hpp" | ||
|
|
||
| #include <iostream> | ||
|
|
||
| namespace rajaperf | ||
| { | ||
| namespace apps | ||
| { | ||
|
|
||
|
|
||
| void SW4CK_KERNEL_2::runSeqVariant(VariantID vid, size_t RAJAPERF_UNUSED_ARG(tune_idx)) | ||
| { | ||
| const Index_type run_reps = getRunReps(); | ||
|
|
||
| //To be populated later with | ||
|
|
||
| char op = '='; | ||
|
|
||
| SW4CK_KERNEL_2_DATA_SETUP; | ||
|
|
||
|
|
||
| switch ( vid ) { | ||
|
|
||
| case Base_Seq : { | ||
|
|
||
| startTimer(); | ||
| for (RepIndex_type irep = 0; irep < run_reps; ++irep) { | ||
|
|
||
| //Reference impl | ||
| for(int k=kstart; k<kend+1; k++) { | ||
| for(int j=jstart; j<jend+1; j++) { | ||
| for(int i=istart; i<ilast - 1; i++) { | ||
|
|
||
| // 5 ops | ||
| SW4CK_KERNEL_2_BODY_1; | ||
|
|
||
| // pp derivative (u) | ||
| // 53 ops, tot=58 | ||
| SW4CK_KERNEL_2_BODY_2; | ||
|
|
||
| // qq derivative (u) | ||
| // 43 ops, tot=101 | ||
| SW4CK_KERNEL_2_BODY_3; | ||
|
|
||
| // rr derivative (u) | ||
| // 5*11+14+14=83 ops, tot=184 | ||
| SW4CK_KERNEL_2_BODY_4; | ||
|
|
||
| // rr derivative (v) | ||
| // 42 ops, tot=226 | ||
| SW4CK_KERNEL_2_BODY_5; | ||
|
|
||
| // rr derivative (w) | ||
| // 43 ops, tot=269 | ||
| SW4CK_KERNEL_2_BODY_6; | ||
|
|
||
| // pq-derivatives | ||
| // 38 ops, tot=307 | ||
| SW4CK_KERNEL_2_BODY_7; | ||
|
|
||
| // qp-derivatives | ||
| // 38 ops, tot=345 | ||
| SW4CK_KERNEL_2_BODY_8; | ||
|
|
||
| // pr-derivatives | ||
| // 130 ops., tot=475 | ||
| SW4CK_KERNEL_2_BODY_9; | ||
|
|
||
| // rp derivatives | ||
| // 130 ops, tot=605 | ||
| SW4CK_KERNEL_2_BODY_10; | ||
|
|
||
| // qr derivatives | ||
| // 82 ops, tot=687 | ||
| SW4CK_KERNEL_2_BODY_11; | ||
|
|
||
| // rq derivatives | ||
| // 82 ops, tot=769 | ||
| SW4CK_KERNEL_2_BODY_12; | ||
|
|
||
| // 4 ops, tot=773 | ||
| SW4CK_KERNEL_2_BODY_13; | ||
|
|
||
| } | ||
| } | ||
| } | ||
|
|
||
|
|
||
|
|
||
| } | ||
| stopTimer(); | ||
|
|
||
| break; | ||
| } | ||
|
|
||
| #if defined(RUN_RAJA_SEQ) | ||
| case Lambda_Seq : { | ||
|
|
||
| startTimer(); | ||
| for (RepIndex_type irep = 0; irep < run_reps; ++irep) { | ||
|
|
||
| //Lambda impl | ||
|
|
||
| } | ||
| stopTimer(); | ||
|
|
||
| break; | ||
| } | ||
|
|
||
| case RAJA_Seq : { | ||
|
|
||
| startTimer(); | ||
| for (RepIndex_type irep = 0; irep < run_reps; ++irep) { | ||
|
|
||
| //RAJA impl | ||
|
|
||
| } | ||
| stopTimer(); | ||
|
|
||
| break; | ||
| } | ||
| #endif // RUN_RAJA_SEQ | ||
|
|
||
| default : { | ||
| getCout() << "\n SW4CK_KERNEL_2 : Unknown variant id = " << vid << std::endl; | ||
| } | ||
|
|
||
| } | ||
|
|
||
| } | ||
|
|
||
| } // end namespace apps | ||
| } // end namespace rajaperf |
This file contains hidden or 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,95 @@ | ||
| //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// | ||
| // Copyright (c) 2017-23, 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 "SW4CK_KERNEL_2.hpp" | ||
|
|
||
| #include "RAJA/RAJA.hpp" | ||
|
|
||
| #include "AppsData.hpp" | ||
| #include "common/DataUtils.hpp" | ||
|
|
||
| #include <cmath> | ||
|
|
||
|
|
||
| namespace rajaperf | ||
| { | ||
| namespace apps | ||
| { | ||
|
|
||
|
|
||
| SW4CK_KERNEL_2::SW4CK_KERNEL_2(const RunParams& params) | ||
| : KernelBase(rajaperf::Apps_SW4CK_KERNEL_2, params) | ||
| { | ||
| setDefaultProblemSize(100*100*100); // See rzmax in ADomain struct | ||
| setDefaultReps(100); | ||
|
|
||
| Index_type rzmax = std::cbrt(getTargetProblemSize())+1; | ||
| //m_domain = new ADomain(rzmax, /* ndims = */ 3); | ||
|
|
||
| //m_array_length = m_domain->nnalls; | ||
|
|
||
| //setActualProblemSize( m_domain->lpz+1 - m_domain->fpz ); | ||
|
|
||
| //setItsPerRep( m_domain->lpz+1 - m_domain->fpz ); | ||
| setKernelsPerRep(1); | ||
| // touched data size, not actual number of stores and loads | ||
| // setBytesPerRep( (1*sizeof(Real_type) + 0*sizeof(Real_type)) * getItsPerRep() + | ||
| //(0*sizeof(Real_type) + 3*sizeof(Real_type)) * (getItsPerRep() + 1+m_domain->jp+m_domain->kp) ); | ||
|
|
||
| //setFLOPsPerRep(72 * (m_domain->lpz+1 - m_domain->fpz)); | ||
|
|
||
| checksum_scale_factor = 0.001 * | ||
| ( static_cast<Checksum_type>(getDefaultProblemSize()) / | ||
| getActualProblemSize() ); | ||
|
|
||
| setUsesFeature(Teams); | ||
|
|
||
| //Goal is to get the following three variants right first | ||
| setVariantDefined( Base_Seq ); | ||
| setVariantDefined( Lambda_Seq ); | ||
| setVariantDefined( RAJA_Seq ); | ||
|
|
||
| /* | ||
| setVariantDefined( Base_OpenMP ); | ||
| setVariantDefined( Lambda_OpenMP ); | ||
| setVariantDefined( RAJA_OpenMP ); | ||
|
|
||
| setVariantDefined( Base_OpenMPTarget ); | ||
| setVariantDefined( RAJA_OpenMPTarget ); | ||
|
|
||
| setVariantDefined( Base_CUDA ); | ||
| setVariantDefined( RAJA_CUDA ); | ||
|
|
||
| setVariantDefined( Base_HIP ); | ||
| setVariantDefined( RAJA_HIP ); | ||
| */ | ||
| } | ||
|
|
||
| SW4CK_KERNEL_2::~SW4CK_KERNEL_2() | ||
| { | ||
| // delete m_domain; | ||
| } | ||
|
|
||
| void SW4CK_KERNEL_2::setUp(VariantID vid, size_t RAJAPERF_UNUSED_ARG(tune_idx)) | ||
| { | ||
|
|
||
| } | ||
|
|
||
| void SW4CK_KERNEL_2::updateChecksum(VariantID vid, size_t tune_idx) | ||
| { | ||
| //checksum[vid][tune_idx] += calcChecksum(m_vol, m_array_length, checksum_scale_factor ); | ||
| } | ||
|
|
||
| void SW4CK_KERNEL_2::tearDown(VariantID vid, size_t RAJAPERF_UNUSED_ARG(tune_idx)) | ||
| { | ||
| (void) vid; | ||
|
|
||
| } | ||
|
|
||
| } // end namespace apps | ||
| } // end namespace rajaperf |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.