99from .base import Benchmark , Suite
1010from .result import Result
1111from utils .utils import run , create_build_path
12- from . options import options
12+ from options import options
1313from .oneapi import get_oneapi
1414import shutil
1515
@@ -54,7 +54,6 @@ def __init__(self, name: str, bin_name: str, vb: VelocityBench, unit: str):
5454 self .bench_name = name
5555 self .bin_name = bin_name
5656 self .unit = unit
57- self .code_path = os .path .join (self .vb .repo_path , self .bench_name , 'SYCL' )
5857
5958 def download_deps (self ):
6059 return
@@ -66,6 +65,7 @@ def ld_libraries(self) -> list[str]:
6665 return []
6766
6867 def setup (self ):
68+ self .code_path = os .path .join (self .vb .repo_path , self .bench_name , 'SYCL' )
6969 self .download_deps ()
7070 self .benchmark_bin = os .path .join (self .directory , self .bench_name , self .bin_name )
7171
@@ -130,12 +130,13 @@ def parse_output(self, stdout: str) -> float:
130130class Bitcracker (VelocityBase ):
131131 def __init__ (self , vb : VelocityBench ):
132132 super ().__init__ ("bitcracker" , "bitcracker" , vb , "s" )
133- self .data_path = os .path .join (vb .repo_path , "bitcracker" , "hash_pass" )
134133
135134 def name (self ):
136135 return "Velocity-Bench Bitcracker"
137136
138137 def bin_args (self ) -> list [str ]:
138+ self .data_path = os .path .join (self .vb .repo_path , "bitcracker" , "hash_pass" )
139+
139140 return ["-f" , f"{ self .data_path } /img_win8_user_hash.txt" ,
140141 "-d" , f"{ self .data_path } /user_passwords_60000.txt" ,
141142 "-b" , "60000" ]
@@ -175,7 +176,6 @@ def parse_output(self, stdout: str) -> float:
175176class QuickSilver (VelocityBase ):
176177 def __init__ (self , vb : VelocityBench ):
177178 super ().__init__ ("QuickSilver" , "qs" , vb , "MMS/CTT" )
178- self .data_path = os .path .join (vb .repo_path , "QuickSilver" , "Examples" , "AllScattering" )
179179
180180 def run (self , env_vars ) -> list [Result ]:
181181 # TODO: fix the crash in QuickSilver when UR_L0_USE_IMMEDIATE_COMMANDLISTS=0
@@ -191,6 +191,8 @@ def lower_is_better(self):
191191 return False
192192
193193 def bin_args (self ) -> list [str ]:
194+ self .data_path = os .path .join (self .vb .repo_path , "QuickSilver" , "Examples" , "AllScattering" )
195+
194196 return ["-i" , f"{ self .data_path } /scatteringOnly.inp" ]
195197
196198 def extra_env_vars (self ) -> dict :
@@ -266,20 +268,20 @@ def parse_output(self, stdout: str) -> float:
266268
267269class DLCifar (VelocityBase ):
268270 def __init__ (self , vb : VelocityBench ):
269- self .oneapi = get_oneapi ()
270271 super ().__init__ ("dl-cifar" , "dl-cifar_sycl" , vb , "s" )
271272
272273 def ld_libraries (self ):
273- return self . oneapi .ld_libraries ()
274+ return get_oneapi () .ld_libraries ()
274275
275276 def download_deps (self ):
276277 # TODO: dl-cifar hardcodes the path to this dataset as "../../datasets/cifar-10-binary"...
277278 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 )
278279 return
279280
280281 def extra_cmake_args (self ):
282+ oneapi = get_oneapi ()
281283 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 ()} "
283285 ]
284286
285287 def name (self ):
@@ -294,11 +296,10 @@ def parse_output(self, stdout: str) -> float:
294296
295297class DLMnist (VelocityBase ):
296298 def __init__ (self , vb : VelocityBench ):
297- self .oneapi = get_oneapi ()
298299 super ().__init__ ("dl-mnist" , "dl-mnist-sycl" , vb , "s" )
299300
300301 def ld_libraries (self ):
301- return self . oneapi .ld_libraries ()
302+ return get_oneapi () .ld_libraries ()
302303
303304 def download_deps (self ):
304305 # TODO: dl-mnist hardcodes the path to this dataset as "../../datasets/"...
@@ -308,8 +309,9 @@ def download_deps(self):
308309 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 )
309310
310311 def extra_cmake_args (self ):
312+ oneapi = get_oneapi ()
311313 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 ()} "
313315 ]
314316
315317 def name (self ):
@@ -337,15 +339,15 @@ def parse_output(self, stdout: str) -> float:
337339
338340class SVM (VelocityBase ):
339341 def __init__ (self , vb : VelocityBench ):
340- self .oneapi = get_oneapi ()
341342 super ().__init__ ("svm" , "svm_sycl" , vb , "s" )
342343
343344 def ld_libraries (self ):
344- return self . oneapi .ld_libraries ()
345+ return get_oneapi () .ld_libraries ()
345346
346347 def extra_cmake_args (self ):
348+ oneapi = get_oneapi ()
347349 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 ()} "
349351 ]
350352
351353 def name (self ):
0 commit comments