-
Notifications
You must be signed in to change notification settings - Fork 3
/
Ptrchase.h
52 lines (40 loc) · 1.2 KB
/
Ptrchase.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
// 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 startScalar (0.4)
template <class T>
class Ptrchase
{
public:
virtual ~Ptrchase(){}
// Kernels
// These must be blocking calls
virtual double latency() = 0;
// Copy memory between host and device
virtual void init_arrays_um() = 0;
virtual void init_arrays_num() = 0;
virtual void allocate_arrays_um() = 0;
virtual void allocate_arrays_nonum() = 0;
virtual void allocate_arrays_device_lat() = 0;
virtual void write_arrays() = 0;
virtual void freeMemNonUM() = 0;
virtual void freeMemUM() = 0;
virtual void freeCudaMem() = 0;
virtual void distributeUMemory() = 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);