forked from UoB-HPC/BabelStream
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSTD20Stream.hpp
43 lines (32 loc) · 923 Bytes
/
STD20Stream.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// Copyright (c) 2020 Tom Deakin
// University of Bristol HPC
//
// For full license terms please see the LICENSE file distributed with this
// source code
#pragma once
#include <iostream>
#include <vector>
#include "Stream.h"
#define IMPLEMENTATION_STRING "C++20"
template <class T>
class STD20Stream : public Stream<T>
{
protected:
// Size of arrays
int array_size;
// Device side pointers
std::vector<T> a;
std::vector<T> b;
std::vector<T> c;
public:
STD20Stream(const int, int);
~STD20Stream() = default;
virtual void copy() override;
virtual void add() override;
virtual void mul() override;
virtual void triad() override;
virtual void nstream() override;
virtual T dot() override;
virtual void init_arrays(T initA, T initB, T initC) override;
virtual void read_arrays(std::vector<T>& a, std::vector<T>& b, std::vector<T>& c) override;
};