text: //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
  // Copyright (c) 2017-19, Lawrence Livermore National Security, LLC
  // and RAJA Performance Suite project contributors.
  // See the RAJAPerf/COPYRIGHT file for details.
  //
  // SPDX-License-Identifier: (BSD-3-Clause)
  //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
  
  #include "DOT.hpp"
  
  #include "RAJA/RAJA.hpp"
  
  #include <iostream>
  
  namespace rajaperf 
  {
  namespace stream
  {
  
  
  void DOT::runSeqVariant(VariantID vid)
  {
    const Index_type run_reps = getRunReps();
    const Index_type ibegin = 0;
    const Index_type iend = getRunSize();
  
    DOT_DATA_SETUP;
  
    auto dot_base_lam = [=](Index_type i) -> Real_type {
                          return a[i] * b[i];
                        };
  
    switch ( vid ) {
  
      case Base_Seq : {
  
        startTimer();
        for (RepIndex_type irep = 0; irep < run_reps; ++irep) {
  
          Real_type dot = m_dot_init;
  
          for (Index_type i = ibegin; i < iend; ++i ) {
            DOT_BODY;
          }
  
           m_dot += dot;
  
        }
        stopTimer();
  
        break;
      }
  
  #if defined(RUN_RAJA_SEQ)
      case Lambda_Seq : {
  
        startTimer();
        for (RepIndex_type irep = 0; irep < run_reps; ++irep) {
  
          Real_type dot = m_dot_init;
  
          for (Index_type i = ibegin; i < iend; ++i ) {
            dot += dot_base_lam(i);
          }
  
          m_dot += dot;
  
        }
        stopTimer();
  
        break;
      }
  
      case RAJA_Seq : {
  
        startTimer();
        for (RepIndex_type irep = 0; irep < run_reps; ++irep) {
  
          RAJA::ReduceSum<RAJA::seq_reduce, Real_type> dot(m_dot_init);
  
          RAJA::forall<RAJA::loop_exec>(
            RAJA::RangeSegment(ibegin, iend), [=](Index_type i) {
            DOT_BODY;
          });
  
          m_dot += static_cast<Real_type>(dot.get());
  
        }
        stopTimer();
  
        break;
      }
  #endif // RUN_RAJA_SEQ
  
      default : {
        std::cout << "\n  DOT : Unknown variant id = " << vid << std::endl;
      }
  
    }
  
  }
  
  } // end namespace stream
  } // end namespace rajaperf
  