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

[SYCL] Remove host from supported device types and backends #1224

Merged
Merged
Show file tree
Hide file tree
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
5 changes: 0 additions & 5 deletions SYCL/Basic/subdevice.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out
// RUN: %HOST_RUN_PLACEHOLDER %t.out
// RUN: %CPU_RUN_PLACEHOLDER %t.out
// RUN: %GPU_RUN_PLACEHOLDER %t.out
// RUN: %ACC_RUN_PLACEHOLDER %t.out
Expand All @@ -25,10 +24,6 @@ int main() {
try {
auto devices = device::get_devices();
for (const auto &dev : devices) {
// TODO: implement subdevices creation for host device
if (dev.is_host())
continue;

assert(dev.get_info<info::device::partition_type_property>() ==
info::partition_property::no_partition);

Expand Down
5 changes: 0 additions & 5 deletions SYCL/Basic/subsubdevice.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out
// RUN: %HOST_RUN_PLACEHOLDER %t.out
// RUN: %CPU_RUN_PLACEHOLDER %t.out
// RUN: %GPU_RUN_PLACEHOLDER %t.out
// RUN: %ACC_RUN_PLACEHOLDER %t.out
Expand All @@ -25,10 +24,6 @@ int main() {
try {
auto devices = device::get_devices();
for (const auto &dev : devices) {
// TODO: implement subdevices creation for host device
if (dev.is_host())
continue;

assert(dev.get_info<info::device::partition_type_property>() ==
info::partition_property::no_partition);

Expand Down
38 changes: 9 additions & 29 deletions SYCL/lit.cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,7 @@
if config.dump_ir_supported:
config.available_features.add('dump_ir')

supported_sycl_be = ['host',
'opencl',
supported_sycl_be = ['opencl',
'ext_oneapi_cuda',
'ext_oneapi_hip',
'ext_oneapi_level_zero',
Expand Down Expand Up @@ -299,35 +298,16 @@

found_at_least_one_device = False

host_run_substitute = "true"
host_run_on_linux_substitute = "true "
host_check_substitute = ""
host_check_on_linux_substitute = ""
supported_device_types=['cpu', 'gpu', 'acc', 'host']
supported_device_types=['cpu', 'gpu', 'acc']

for target_device in config.target_devices.split(','):
if ( target_device not in supported_device_types ):
if target_device == 'host':
lit_config.warning("Host device type is no longer supported.")
elif ( target_device not in supported_device_types ):
lit_config.error("Unknown SYCL target device type specified '" +
target_device +
"' supported devices are " + ', '.join(supported_device_types))

if 'host' in config.target_devices.split(','):
found_at_least_one_device = True
lit_config.note("Test HOST device")
host_run_substitute = "env SYCL_DEVICE_FILTER=host "
host_check_substitute = "| FileCheck %s"
config.available_features.add('host')
if platform.system() == "Linux":
host_run_on_linux_substitute = "env SYCL_DEVICE_FILTER=host "
host_check_on_linux_substitute = "| FileCheck %s"
else:
lit_config.warning("HOST device not used")

config.substitutions.append( ('%HOST_RUN_PLACEHOLDER', host_run_substitute) )
config.substitutions.append( ('%HOST_RUN_ON_LINUX_PLACEHOLDER', host_run_on_linux_substitute) )
config.substitutions.append( ('%HOST_CHECK_PLACEHOLDER', host_check_substitute) )
config.substitutions.append( ('%HOST_CHECK_ON_LINUX_PLACEHOLDER', host_check_on_linux_substitute) )

cpu_run_substitute = "true"
cpu_run_on_linux_substitute = "true "
cpu_check_substitute = ""
Expand All @@ -336,7 +316,7 @@
if 'cpu' in config.target_devices.split(','):
found_at_least_one_device = True
lit_config.note("Test CPU device")
cpu_run_substitute = "env SYCL_DEVICE_FILTER={SYCL_PLUGIN}:cpu,host ".format(SYCL_PLUGIN=config.sycl_be)
cpu_run_substitute = "env SYCL_DEVICE_FILTER={SYCL_PLUGIN}:cpu ".format(SYCL_PLUGIN=config.sycl_be)
Copy link

@AlexeySachkov AlexeySachkov Sep 5, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should outline those small ,host changes into a separate PR: I'm concerned that in some cases tests might be launched on host while it is still there. In combination with removal of code pieces like:

if (Queue.get_device().is_host()) {
    std::cout << "Skipping test\n";
    return 0;
  }

That could introduce new failures while we removing tests.

UPD: for example, in #1210 a test simply crashed under environment "SYCL_DEVICE_FILTER=ext_oneapi_level_zero:gpu,host". Note: I'm not entirely sure that it is because it attempted to launch the test on host

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest we move the tests that depend on this to be part of this PR to avoid further inter-dependencies.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest we move the tests that depend on this to be part of this PR to avoid further inter-dependencies.

It is hard to grep for such. Actually, I think that the situation I described won't occur in our CI, but it is theoretically possible

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most cases should work as long as the host device isn't the only device. Even if that happens, it should only happen between those tests being merged and this being merged.

cpu_check_substitute = "| FileCheck %s"
config.available_features.add('cpu')
if platform.system() == "Linux":
Expand All @@ -359,18 +339,18 @@
if 'gpu' in config.target_devices.split(','):
found_at_least_one_device = True
lit_config.note("Test GPU device")
gpu_run_substitute = " env SYCL_DEVICE_FILTER={SYCL_PLUGIN}:gpu,host ".format(SYCL_PLUGIN=config.sycl_be)
gpu_run_substitute = " env SYCL_DEVICE_FILTER={SYCL_PLUGIN}:gpu ".format(SYCL_PLUGIN=config.sycl_be)
gpu_check_substitute = "| FileCheck %s"
config.available_features.add('gpu')

if config.sycl_be == "ext_oneapi_level_zero":
gpu_l0_check_substitute = "| FileCheck %s"
if lit_config.params.get('ze_debug'):
gpu_run_substitute = " env ZE_DEBUG={ZE_DEBUG} SYCL_DEVICE_FILTER=level_zero:gpu,host ".format(ZE_DEBUG=config.ze_debug)
gpu_run_substitute = " env ZE_DEBUG={ZE_DEBUG} SYCL_DEVICE_FILTER=level_zero:gpu ".format(ZE_DEBUG=config.ze_debug)
config.available_features.add('ze_debug'+config.ze_debug)

if platform.system() == "Linux":
gpu_run_on_linux_substitute = "env SYCL_DEVICE_FILTER={SYCL_PLUGIN}:gpu,host ".format(SYCL_PLUGIN=config.sycl_be)
gpu_run_on_linux_substitute = "env SYCL_DEVICE_FILTER={SYCL_PLUGIN}:gpu ".format(SYCL_PLUGIN=config.sycl_be)
gpu_check_on_linux_substitute = "| FileCheck %s"

if config.sycl_be == "ext_oneapi_cuda":
Expand Down