Skip to content

Commit 5a8d4e4

Browse files
committed
Remove triple selection logic
1 parent 22b7583 commit 5a8d4e4

File tree

1 file changed

+7
-57
lines changed

1 file changed

+7
-57
lines changed

sycl/test-e2e/format.py

Lines changed: 7 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -98,55 +98,6 @@ def getMatchedFromList(self, features, alist):
9898
except ValueError as e:
9999
raise ValueError("Error in UNSUPPORTED list:\n%s" % str(e))
100100

101-
def make_default_features_list(self, expr, triple, add_default=True):
102-
# Dictionaries of features which we know are always/never present for a
103-
# given triple (or the system in general).
104-
always_has_feature = {
105-
"spir64": set(),
106-
"system": {"linux"},
107-
}
108-
never_has_feature = {
109-
"spir64": {
110-
"cuda", "hip", "hip_amd", "hip_nvidia", "native_cpu"
111-
},
112-
"system": {
113-
"windows", "system-windows", "run-mode", "TEMPORARY_DISABLED",
114-
},
115-
}
116-
features_queried_by_test = []
117-
for f in expr:
118-
features_queried_by_test = features_queried_by_test + re.findall(
119-
"[-+=._a-zA-Z0-9]+", f
120-
)
121-
features = set()
122-
exceptions = {}
123-
if add_default:
124-
exceptions = never_has_feature[triple].union(never_has_feature["system"])
125-
else:
126-
exceptions = always_has_feature[triple].union(always_has_feature["system"])
127-
for f in features_queried_by_test:
128-
if (not add_default if f in exceptions else add_default):
129-
features.add(f)
130-
return features
131-
132-
def select_triples_for_test(self, test):
133-
# Check Triples
134-
triples = set()
135-
possible_triples = ["spir64"]
136-
for triple in possible_triples:
137-
unsupported = self.make_default_features_list(
138-
test.unsupported, triple, False
139-
)
140-
required = self.make_default_features_list(test.requires, triple)
141-
features = unsupported.union(required)
142-
if test.getMissingRequiredFeaturesFromList(features):
143-
continue
144-
if self.getMatchedFromList(features, test.unsupported):
145-
continue
146-
triples.add(triple)
147-
148-
return triples
149-
150101
def select_devices_for_test(self, test):
151102
devices = []
152103
for d in test.config.sycl_devices:
@@ -206,12 +157,16 @@ def execute(self, test, litConfig):
206157
devices_for_test = []
207158
triples = set()
208159
unsplit_test = False
160+
for l in test.requires:
161+
if "run-mode" in re.findall("[-+=._a-zA-Z0-9]+", l):
162+
unsplit_test = True
163+
break
209164
if "run-mode" not in test.config.available_features:
210-
triples = self.select_triples_for_test(test)
211-
if not triples:
165+
if unsplit_test:
212166
return lit.Test.Result(
213-
lit.Test.UNSUPPORTED, "No supported backend to build for"
167+
lit.Test.UNSUPPORTED, "Tests unsupported on split build"
214168
)
169+
triples = {"spir64"}
215170
else:
216171
devices_for_test = self.select_devices_for_test(test)
217172
if not devices_for_test:
@@ -222,11 +177,6 @@ def execute(self, test, litConfig):
222177
for sycl_device in devices_for_test:
223178
(backend, _) = sycl_device.split(":")
224179
triples.add(get_triple(test, backend))
225-
for l in test.config.requires:
226-
if "run-mode" in re.findall("[-+=._a-zA-Z0-9]+", l):
227-
unsplit_test = True
228-
break
229-
230180

231181
substitutions = lit.TestRunner.getDefaultSubstitutions(test, tmpDir, tmpBase)
232182
substitutions.append(("%{sycl_triple}", format(",".join(triples))))

0 commit comments

Comments
 (0)