33# See LICENSE.TXT
44# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
55
6- from enum import Enum
7-
6+ from typing import List , Type
87
98class Preset :
10- def description (self ):
11- pass
9+ def description (self ) -> str :
10+ raise NotImplementedError
1211
13- def suites (self ) -> list [ str ] :
14- return []
12+ def name (self ) -> str :
13+ return self . __class__ . __name__
1514
15+ def suites (self ) -> List [str ]:
16+ raise NotImplementedError
1617
1718class Full (Preset ):
18- def description (self ):
19+ def description (self ) -> str :
1920 return "All available benchmarks."
2021
21- def suites (self ) -> list [str ]:
22+ def suites (self ) -> List [str ]:
2223 return [
2324 "Compute Benchmarks" ,
2425 "llama.cpp bench" ,
@@ -27,42 +28,38 @@ def suites(self) -> list[str]:
2728 "UMF" ,
2829 ]
2930
30-
3131class SYCL (Preset ):
32- def description (self ):
32+ def description (self ) -> str :
3333 return "All available benchmarks related to SYCL."
3434
35- def suites (self ) -> list [str ]:
35+ def suites (self ) -> List [str ]:
3636 return ["Compute Benchmarks" , "llama.cpp bench" , "SYCL-Bench" , "Velocity Bench" ]
3737
38-
3938class Minimal (Preset ):
40- def description (self ):
39+ def description (self ) -> str :
4140 return "Short microbenchmarks."
4241
43- def suites (self ) -> list [str ]:
42+ def suites (self ) -> List [str ]:
4443 return ["Compute Benchmarks" ]
4544
46-
4745class Normal (Preset ):
48- def description (self ):
46+ def description (self ) -> str :
4947 return "Comprehensive mix of microbenchmarks and real applications."
5048
51- def suites (self ) -> list [str ]:
52- return ["Compute Benchmarks" ]
53-
49+ def suites (self ) -> List [str ]:
50+ return ["Compute Benchmarks" , "llama.cpp bench" , "Velocity Bench" ]
5451
5552class Test (Preset ):
56- def description (self ):
53+ def description (self ) -> str :
5754 return "Noop benchmarks for framework testing."
5855
59- def suites (self ) -> list [str ]:
56+ def suites (self ) -> List [str ]:
6057 return ["Test Suite" ]
6158
59+ presets = [Full (), SYCL (), Minimal (), Normal (), Test ()]
6260
63- class Presets (Enum ):
64- FULL = Full
65- SYCL = SYCL # Nightly
66- NORMAL = Normal # PR
67- MINIMAL = Minimal # Quick smoke tests
68- TEST = Test
61+ def preset_get_by_name (name : str ) -> Preset :
62+ for p in presets :
63+ if p .name ().upper () == name .upper ():
64+ return p
65+ raise ValueError (f"Preset '{ name } ' not found." )
0 commit comments