-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathenv.py
More file actions
56 lines (49 loc) · 2.09 KB
/
env.py
File metadata and controls
56 lines (49 loc) · 2.09 KB
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
import os
from pathlib import Path
class myEnv:
def __init__(self, target="cuda"):
self._target = target
# Common Directories
self.root_dir = Path("/fast_data/jaewon/GPU_SCA/power_patch")
# self.root_dir = Path("/home/jaewon/hertzpatch/")
self.result_dir = self.root_dir / "GPU_Power_Sidechannel_Attack/results"
self.figure_dir = self.result_dir / "../figures"
if target == "cuda":
# CUDA
self.platform_name = "NVIDIA GPU"
# self.device_name = "RTX2080"
self.device_name = "GTX 1660"
# self.device_name = "Titan Xp"
self.suite_name = "rodinia_cuda"
# self.benchmark_name = "tango_cuda"
self.tango_dir = self.root_dir / "Tango/GPU"
self.rodinia_cuda_dir = self.root_dir / "rodinia_3.1/cuda"
self.nvbit_dir = self.root_dir / "NVBit_Power/tools/power/"
self.nvbit_so = self.nvbit_dir / "power.so"
elif target == "ocl":
# OpenCL
self.platform_name = "Intel GPU"
self.device_name = "UHD770"
self.suite_name = "rodinia_ocl"
self.rodinia_ocl_dir = self.root_dir / "rodinia_3.1/opencl"
self.rapl_dir = self.rodinia_ocl_dir / "lib"
self.print_all()
def print_all(self):
# Common Information
print("Platform_name =", self.platform_name)
print("device_name =", self.device_name)
print("benchmark_name =", self.suite_name)
# Common Directories
print("root_dir =", self.root_dir)
print("result_dir=", self.result_dir)
print("figure_dir=", self.figure_dir)
if self._target == "cuda":
# cuda benchmarks
print("tango_dir=", self.tango_dir)
print("rodinia_cuda_dir =", self.rodinia_cuda_dir)
print("nvbit_dir=", self.nvbit_dir)
print("nvbit_so=", self.nvbit_so)
elif self._target == "ocl":
# opencl benchmarks
print("rodinia_ocl_dir =", self.rodinia_ocl_dir)
print("rapl_dir=", self.rapl_dir)