-
Notifications
You must be signed in to change notification settings - Fork 3
/
Stream.h
90 lines (77 loc) · 2.46 KB
/
Stream.h
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
// Copyright (c) 2016-17 Karnajit Sen
// // IBM Deutschland R&D GmbH, University of Erlangen-Nürnberg
//
// For full license terms please see the LICENSE file distributed with this
// source code
#pragma once
#include <vector>
#include <string>
// Array values
#define startA (0.1)
#define startB (0.2)
#define startC (0.3)
#define startD (0.4)
#define startE (0.5)
#define startF (0.6)
#define startScalar (0.4)
template <class T>
class Stream
{
public:
virtual ~Stream(){}
// Kernels
// These must be blocking calls
virtual void read() = 0;
virtual void write() = 0;
virtual void copy() = 0;
virtual void mul() = 0;
virtual void add() = 0;
virtual void triad() = 0;
virtual void quadad() = 0;
virtual void pentad() = 0;
virtual void hexad() = 0;
virtual void num_read() = 0;
virtual void num_write() = 0;
virtual void num_copy() = 0;
virtual void num_mul() = 0;
virtual void num_add() = 0;
virtual void num_triad() = 0;
virtual void num_quadad() = 0;
virtual void num_pentad() = 0;
virtual void num_hexad() = 0;
virtual void cudaMemCopyPinned() = 0;
virtual void cudaMemCopyNonPinned() = 0;
virtual void h_read() = 0;
virtual void h_write() = 0;
virtual void h_copy() = 0;
virtual void h_mul() = 0;
virtual void h_add() = 0;
virtual void h_triad() = 0;
virtual void h_quadad() = 0;
virtual void h_pentad() = 0;
virtual void h_hexad() = 0;
// Copy memory between host and device
virtual void init_arrays_um() = 0;
virtual void init_arrays_num() = 0;
virtual void allocate_arrays_um(char) = 0;
virtual void allocate_arrays_nonum() = 0;
virtual void allocate_arrays_membw() = 0;
virtual void allocate_arrays_cudamem() = 0;
virtual void read_arrays_num() = 0;
virtual void setDeviceParameterUM(int bs,int thread) = 0 ;
virtual void setDeviceParameterNUM(int bs,int thread) = 0 ;
virtual void setApplictionClock() = 0;
virtual void lockMem() = 0;
virtual void freeMemNonUM() = 0;
virtual void freeMemUM() = 0;
virtual void freeCudaMem() = 0;
virtual void setOMPParams(int cputhreads) = 0;
virtual void distributeUMemory() = 0;
virtual void distributeNUMemory() = 0;
virtual void enablePeerAccess() = 0;
virtual void disablePeerAccess() = 0;
};
// Implementation specific device functions
void listDevices(void);
std::string getDeviceName(const int);
std::string getDeviceDriver(const int);