-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlaunch_test.py
49 lines (36 loc) · 1.49 KB
/
launch_test.py
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
import re #regex
import os #operating system
import sys
#default all
versions_to_test = []
for i in range(1, len(sys.argv)) :
versions_to_test.append(sys.argv[i])
files = os.listdir('main')
cuda_files = [ file for file in files if re.match("floyd_warshall_device_v_.*\.cu", file) and (not re.match("floyd_warshall_device_v_.*_ERROR\.cu", file)) ]
file_i = 1
num_files = len(cuda_files)
for file in cuda_files :
# obtain cuda file version
version = re.sub("^floyd_warshall_device_v_", "", file)
version = re.sub("\.cu$", "", version)
if (versions_to_test == []) or (version in versions_to_test) :
# define floyd warshall bin file
fw_bin = 'bin/fwb_dev_v_' + version + '.out'
# print version, cuda file name, bin file name
print(f"file: {file_i} of {num_files}")
print(f"version: {version}")
print(f"cuda file: {file}")
print(f"bin file: {fw_bin}\n")
# define and print command for compiling cuda file to bin file
make_algorithm_cmd = "make fwb_dev VERSION=" + version
print(make_algorithm_cmd)
# compile test dimension cpp file to bin file
os.system(make_algorithm_cmd)
print()
exec_option='test'
launch_cmd = fw_bin + " " + exec_option
print(launch_cmd, "\n")
os.system(launch_cmd)
print("-----------------------------------------------------------------")
print()
file_i += 1