// Copyright (c) 2015-16 Tom Deakin, Simon McIntosh-Smith, // University of Bristol HPC // // For full license terms please see the LICENSE file distributed with this // source code #pragma once #include #include #include #include #include #include "Stream.h" #define IMPLEMENTATION_STRING "KOKKOS" #ifdef KOKKOS_TARGET_CPU #define DEVICE Kokkos::OpenMP #else #define DEVICE Kokkos::Cuda #endif template class KOKKOSStream : public Stream { protected: // Size of arrays unsigned int array_size; // Device side pointers to arrays Kokkos::View* d_a; Kokkos::View* d_b; Kokkos::View* d_c; Kokkos::View::HostMirror* hm_a; Kokkos::View::HostMirror* hm_b; Kokkos::View::HostMirror* hm_c; public: KOKKOSStream(const unsigned int, const int); ~KOKKOSStream(); virtual void copy() override; virtual void add() override; virtual void mul() override; virtual void triad() override; virtual void init_arrays(T initA, T initB, T initC) override; virtual void read_arrays( std::vector& a, std::vector& b, std::vector& c) override; };