9
9
from .base import Benchmark , Suite
10
10
from .result import Result
11
11
from utils .utils import run , create_build_path
12
- from . options import options
12
+ from options import options
13
13
from .oneapi import get_oneapi
14
14
import shutil
15
15
@@ -54,7 +54,6 @@ def __init__(self, name: str, bin_name: str, vb: VelocityBench, unit: str):
54
54
self .bench_name = name
55
55
self .bin_name = bin_name
56
56
self .unit = unit
57
- self .code_path = os .path .join (self .vb .repo_path , self .bench_name , 'SYCL' )
58
57
59
58
def download_deps (self ):
60
59
return
@@ -66,6 +65,7 @@ def ld_libraries(self) -> list[str]:
66
65
return []
67
66
68
67
def setup (self ):
68
+ self .code_path = os .path .join (self .vb .repo_path , self .bench_name , 'SYCL' )
69
69
self .download_deps ()
70
70
self .benchmark_bin = os .path .join (self .directory , self .bench_name , self .bin_name )
71
71
@@ -130,12 +130,13 @@ def parse_output(self, stdout: str) -> float:
130
130
class Bitcracker (VelocityBase ):
131
131
def __init__ (self , vb : VelocityBench ):
132
132
super ().__init__ ("bitcracker" , "bitcracker" , vb , "s" )
133
- self .data_path = os .path .join (vb .repo_path , "bitcracker" , "hash_pass" )
134
133
135
134
def name (self ):
136
135
return "Velocity-Bench Bitcracker"
137
136
138
137
def bin_args (self ) -> list [str ]:
138
+ self .data_path = os .path .join (self .vb .repo_path , "bitcracker" , "hash_pass" )
139
+
139
140
return ["-f" , f"{ self .data_path } /img_win8_user_hash.txt" ,
140
141
"-d" , f"{ self .data_path } /user_passwords_60000.txt" ,
141
142
"-b" , "60000" ]
@@ -175,7 +176,6 @@ def parse_output(self, stdout: str) -> float:
175
176
class QuickSilver (VelocityBase ):
176
177
def __init__ (self , vb : VelocityBench ):
177
178
super ().__init__ ("QuickSilver" , "qs" , vb , "MMS/CTT" )
178
- self .data_path = os .path .join (vb .repo_path , "QuickSilver" , "Examples" , "AllScattering" )
179
179
180
180
def run (self , env_vars ) -> list [Result ]:
181
181
# TODO: fix the crash in QuickSilver when UR_L0_USE_IMMEDIATE_COMMANDLISTS=0
@@ -191,6 +191,8 @@ def lower_is_better(self):
191
191
return False
192
192
193
193
def bin_args (self ) -> list [str ]:
194
+ self .data_path = os .path .join (self .vb .repo_path , "QuickSilver" , "Examples" , "AllScattering" )
195
+
194
196
return ["-i" , f"{ self .data_path } /scatteringOnly.inp" ]
195
197
196
198
def extra_env_vars (self ) -> dict :
@@ -266,20 +268,20 @@ def parse_output(self, stdout: str) -> float:
266
268
267
269
class DLCifar (VelocityBase ):
268
270
def __init__ (self , vb : VelocityBench ):
269
- self .oneapi = get_oneapi ()
270
271
super ().__init__ ("dl-cifar" , "dl-cifar_sycl" , vb , "s" )
271
272
272
273
def ld_libraries (self ):
273
- return self . oneapi .ld_libraries ()
274
+ return get_oneapi () .ld_libraries ()
274
275
275
276
def download_deps (self ):
276
277
# TODO: dl-cifar hardcodes the path to this dataset as "../../datasets/cifar-10-binary"...
277
278
self .download ("datasets" , "https://www.cs.toronto.edu/~kriz/cifar-10-binary.tar.gz" , "cifar-10-binary.tar.gz" , untar = True , skip_data_dir = True )
278
279
return
279
280
280
281
def extra_cmake_args (self ):
282
+ oneapi = get_oneapi ()
281
283
return [
282
- f"-DCMAKE_CXX_FLAGS=-O3 -fsycl -ffast-math -I{ self . oneapi .dnn_include ()} -I{ self . oneapi .mkl_include ()} -L{ self . oneapi .dnn_lib ()} -L{ self . oneapi .mkl_lib ()} "
284
+ f"-DCMAKE_CXX_FLAGS=-O3 -fsycl -ffast-math -I{ oneapi .dnn_include ()} -I{ oneapi .mkl_include ()} -L{ oneapi .dnn_lib ()} -L{ oneapi .mkl_lib ()} "
283
285
]
284
286
285
287
def name (self ):
@@ -294,11 +296,10 @@ def parse_output(self, stdout: str) -> float:
294
296
295
297
class DLMnist (VelocityBase ):
296
298
def __init__ (self , vb : VelocityBench ):
297
- self .oneapi = get_oneapi ()
298
299
super ().__init__ ("dl-mnist" , "dl-mnist-sycl" , vb , "s" )
299
300
300
301
def ld_libraries (self ):
301
- return self . oneapi .ld_libraries ()
302
+ return get_oneapi () .ld_libraries ()
302
303
303
304
def download_deps (self ):
304
305
# TODO: dl-mnist hardcodes the path to this dataset as "../../datasets/"...
@@ -308,8 +309,9 @@ def download_deps(self):
308
309
self .download ("datasets" , "https://raw.githubusercontent.com/fgnt/mnist/master/t10k-labels-idx1-ubyte.gz" , "t10k-labels.idx1-ubyte.gz" , unzip = True , skip_data_dir = True )
309
310
310
311
def extra_cmake_args (self ):
312
+ oneapi = get_oneapi ()
311
313
return [
312
- f"-DCMAKE_CXX_FLAGS=-O3 -fsycl -ffast-math -I{ self . oneapi .dnn_include ()} -I{ self . oneapi .mkl_include ()} -L{ self . oneapi .dnn_lib ()} -L{ self . oneapi .mkl_lib ()} "
314
+ f"-DCMAKE_CXX_FLAGS=-O3 -fsycl -ffast-math -I{ oneapi .dnn_include ()} -I{ oneapi .mkl_include ()} -L{ oneapi .dnn_lib ()} -L{ oneapi .mkl_lib ()} "
313
315
]
314
316
315
317
def name (self ):
@@ -337,15 +339,15 @@ def parse_output(self, stdout: str) -> float:
337
339
338
340
class SVM (VelocityBase ):
339
341
def __init__ (self , vb : VelocityBench ):
340
- self .oneapi = get_oneapi ()
341
342
super ().__init__ ("svm" , "svm_sycl" , vb , "s" )
342
343
343
344
def ld_libraries (self ):
344
- return self . oneapi .ld_libraries ()
345
+ return get_oneapi () .ld_libraries ()
345
346
346
347
def extra_cmake_args (self ):
348
+ oneapi = get_oneapi ()
347
349
return [
348
- f"-DCMAKE_CXX_FLAGS=-O3 -fsycl -ffast-math -I{ self . oneapi .dnn_include ()} -I{ self . oneapi .mkl_include ()} -L{ self . oneapi .dnn_lib ()} -L{ self . oneapi .mkl_lib ()} "
350
+ f"-DCMAKE_CXX_FLAGS=-O3 -fsycl -ffast-math -I{ oneapi .dnn_include ()} -I{ oneapi .mkl_include ()} -L{ oneapi .dnn_lib ()} -L{ oneapi .mkl_lib ()} "
349
351
]
350
352
351
353
def name (self ):
0 commit comments