Skip to content

Commit 2add39f

Browse files
[CI] Introduce SPIR-V Backend support in LIT config (#16600)
We introduce here SPIR-V Backend support in LIT config by adding a new LIT feature 'spirv-backend', and in a way that substitutions in end-to-end tests are aware about the new LIT feature. --------- Co-authored-by: aelovikov-intel <andrei.elovikov@intel.com>
1 parent 41ec74c commit 2add39f

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

sycl/test-e2e/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,11 @@ place. No new tests should use these features:
250250
* **gpu-intel-pvc** - Intel GPU PVC availability;
251251
* **gpu-intel-pvc-vg** - Intel GPU PVC-VG availability;
252252
253+
### Use the LLVM SPIR-V Backend to generate SPIR-V code
254+
It's possible to use the LLVM SPIR-V Backend instead of the `llvm-spirv` tool
255+
to convert LLVM IR to SPIR-V. This feature must be set manually by passing the
256+
`spirv-backend` parameter to `llvm-lit`.
257+
253258
### llvm-lit parameters
254259
255260
Following options can be passed to llvm-lit tool through --param option to

sycl/test-e2e/format.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,11 @@ def execute(self, test, litConfig):
183183
)
184184
sycl_target_opts += hip_arch_opts
185185
substitutions.append(("%{hip_arch_opts}", hip_arch_opts))
186+
if (
187+
get_triple("spir64") in triples
188+
and "spirv-backend" in test.config.available_features
189+
):
190+
sycl_target_opts += " -fsycl-use-spirv-backend-for-spirv-gen"
186191
substitutions.append(("%{sycl_target_opts}", sycl_target_opts))
187192

188193
substitutions.append(

sycl/test-e2e/lit.cfg.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,8 @@ def check_igc_tag_and_add_feature():
225225
if lit_config.params.get("enable-perf-tests", False):
226226
config.available_features.add("enable-perf-tests")
227227

228+
if lit_config.params.get("spirv-backend", False):
229+
config.available_features.add("spirv-backend")
228230

229231
# Use this to make sure that any dynamic checks below are done in the build
230232
# directory and not where the sources are located. This is important for the

0 commit comments

Comments
 (0)