@@ -57,15 +57,18 @@ def check_get_max_compute_units(device):
57
57
max_compute_units = device .get_max_compute_units ()
58
58
assert max_compute_units > 0
59
59
60
+
60
61
def check_get_max_work_item_dims (device ):
61
62
max_work_item_dims = device .get_max_work_item_dims ()
62
63
assert max_work_item_dims > 0
63
64
65
+
64
66
def check_get_max_work_item_sizes (device ):
65
67
max_work_item_sizes = device .get_max_work_item_sizes ()
66
68
for size in max_work_item_sizes :
67
69
assert size is not None
68
70
71
+
69
72
def check_get_max_work_group_size (device ):
70
73
max_work_group_size = device .get_max_work_group_size ()
71
74
# Special case for FPGA simulator
@@ -74,6 +77,7 @@ def check_get_max_work_group_size(device):
74
77
else :
75
78
assert max_work_group_size > 0
76
79
80
+
77
81
def check_get_max_num_sub_groups (device ):
78
82
max_num_sub_groups = device .get_max_num_sub_groups ()
79
83
# Special case for FPGA simulator
@@ -82,56 +86,64 @@ def check_get_max_num_sub_groups(device):
82
86
else :
83
87
assert max_num_sub_groups > 0
84
88
89
+
85
90
def check_has_int64_base_atomics (device ):
86
91
try :
87
92
device .has_int64_base_atomics ()
88
93
except Exception :
89
94
pytest .fail ("has_int64_base_atomics call failed" )
90
95
96
+
91
97
def check_has_int64_extended_atomics (device ):
92
98
try :
93
99
device .has_int64_extended_atomics ()
94
100
except Exception :
95
101
pytest .fail ("has_int64_extended_atomics call failed" )
96
102
103
+
97
104
def check_is_accelerator (device ):
98
105
try :
99
106
device .is_accelerator ()
100
107
except Exception :
101
108
pytest .fail ("is_accelerator call failed" )
102
109
110
+
103
111
def check_is_cpu (device ):
104
112
try :
105
113
device .is_cpu ()
106
114
except Exception :
107
115
pytest .fail ("is_cpu call failed" )
108
116
117
+
109
118
def check_is_gpu (device ):
110
119
try :
111
120
device .is_gpu ()
112
121
except Exception :
113
122
pytest .fail ("is_gpu call failed" )
114
123
124
+
115
125
def check_is_host (device ):
116
126
try :
117
127
device .is_host ()
118
128
except Exception :
119
129
pytest .fail ("is_hostcall failed" )
120
130
131
+
121
132
list_of_checks = [
122
- check_get_max_compute_units ,
123
- check_get_max_work_item_dims ,
124
- check_get_max_work_item_sizes ,
125
- check_get_max_work_group_size ,
126
- check_get_max_num_sub_groups ,
127
- check_has_int64_base_atomics ,
128
- check_has_int64_extended_atomics ,
129
- check_is_accelerator ,
130
- check_is_cpu ,
131
- check_is_gpu ,
132
- check_is_host ,
133
+ check_get_max_compute_units ,
134
+ check_get_max_work_item_dims ,
135
+ check_get_max_work_item_sizes ,
136
+ check_get_max_work_group_size ,
137
+ check_get_max_num_sub_groups ,
138
+ check_has_int64_base_atomics ,
139
+ check_has_int64_extended_atomics ,
140
+ check_is_accelerator ,
141
+ check_is_cpu ,
142
+ check_is_gpu ,
143
+ check_is_host ,
133
144
]
134
145
146
+
135
147
@pytest .fixture (params = list_of_valid_filter_selectors )
136
148
def valid_filter (request ):
137
149
return request .param
@@ -146,6 +158,7 @@ def invalid_filter(request):
146
158
def device_selector (request ):
147
159
return request .param
148
160
161
+
149
162
@pytest .fixture (params = list_of_checks )
150
163
def check (request ):
151
164
return request .param
0 commit comments