Skip to content
Draft
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
4 changes: 3 additions & 1 deletion src/apps/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,9 @@ blt_add_library(
PRESSURE-Hip.cpp
PRESSURE-Cuda.cpp
PRESSURE-OMP.cpp
PRESSURE-OMPTarget.cpp
PRESSURE-OMPTarget.cpp
SW4CK_KERNEL_2.cpp
SW4CK_KERNEL_2-Seq.cpp
VOL3D.cpp
VOL3D-Seq.cpp
VOL3D-Hip.cpp
Expand Down
81 changes: 81 additions & 0 deletions src/apps/SW4CK_KERNEL_2-Seq.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
// 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();

SW4CK_KERNEL_2_DATA_SETUP;

switch ( vid ) {

case Base_Seq : {

startTimer();
for (RepIndex_type irep = 0; irep < run_reps; ++irep) {

//Reference impl

}
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
95 changes: 95 additions & 0 deletions src/apps/SW4CK_KERNEL_2.cpp
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
Loading