Skip to content
This repository was archived by the owner on Mar 28, 2023. It is now read-only.

[SYCL] Simplifying type conversion from SYCL_BE to SYCL_DEVICE_FILTER #502

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 13 additions & 9 deletions SYCL/lit.cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,13 +154,11 @@
if not config.sycl_be:
lit_config.error("SYCL backend is not specified")

# Mapping from SYCL_BE backend definition style to SYCL_DEVICE_FILTER used
# for backward compatibility
try:
config.sycl_be = { 'PI_OPENCL': 'opencl', 'PI_CUDA': 'cuda', 'PI_HIP': 'hip', 'PI_LEVEL_ZERO': 'level_zero'}[config.sycl_be]
except:
# do nothing a we expect that new format of plugin values are used
pass
# Transforming from SYCL_BE backend definition style to SYCL_DEVICE_FILTER used
# for backward compatibility : e.g. 'PI_ABC_XYZ' -> 'abc_xyz'
if config.sycl_be.startswith("PI_"):
config.sycl_be = config.sycl_be[3:]
config.sycl_be = config.sycl_be.lower()

lit_config.note("Backend: {BACKEND}".format(BACKEND=config.sycl_be))

Expand All @@ -171,10 +169,16 @@
if config.dump_ir_supported:
config.available_features.add('dump_ir')

if config.sycl_be not in ['host', 'opencl', 'cuda', 'hip', 'level_zero']:
supported_sycl_be = ['host',
'opencl',
'cuda',
'hip',
'level_zero']

if config.sycl_be not in supported_sycl_be:
lit_config.error("Unknown SYCL BE specified '" +
config.sycl_be +
"' supported values are opencl, cuda, hip, level_zero")
"'. Supported values are {}".format(', '.join(supported_sycl_be)))

# If HIP_PLATFORM flag is not set, default to AMD, and check if HIP platform is supported
supported_hip_platforms=["AMD", "NVIDIA"]
Expand Down