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

[SYCL] Remove host run and dependencies from SYCL/ESIMD tests #1206

Merged
merged 1 commit into from
Sep 12, 2022
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
3 changes: 1 addition & 2 deletions SYCL/ESIMD/api/functional/ctors/ctor_vector_core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ int main(int, char **) {
sycl::device device = queue.get_device();
// verify aspect::fp16 due to using sycl::half data type
// verify aspect::fp64 due to using double data type
if (!device.is_host() && !device.has(sycl::aspect::fp16) &&
!device.has(sycl::aspect::fp64)) {
if (!device.has(sycl::aspect::fp16) && !device.has(sycl::aspect::fp64)) {

Choose a reason for hiding this comment

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

The fix is correct.
But the underlying code (that is being fixed here) is totally incorrect IMO.

  1. The test ctor_vector_core.cpp tests "core" types, i.e. all types except specific. "core" does not include double/half.
    So, this check must be not in this file, but in ctor_vector_fp_extra.cpp.
  2. The check must be 'if (!has_fp16 || !has_fp64)' instead of '(!has_fp16 && !has_fp64).

There are several other tests like that.
This can be fixed in a separate PR (I can do that).

std::cout << "Test skipped\n";
return 0;
}
Expand Down
7 changes: 2 additions & 5 deletions SYCL/ESIMD/esimd_test_utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,14 @@ namespace esimd_test {
// was returned for all devices, then the selection process will cause an
// exception.
class ESIMDSelector : public device_selector {
// Require GPU device unless HOST is requested in SYCL_DEVICE_FILTER env
// Require GPU device
virtual int operator()(const device &device) const {
if (const char *dev_filter = getenv("SYCL_DEVICE_FILTER")) {
std::string filter_string(dev_filter);
if (filter_string.find("gpu") != std::string::npos)
return device.is_gpu() ? 1000 : -1;
if (filter_string.find("host") != std::string::npos)
return device.is_host() ? 1000 : -1;
std::cerr
<< "Supported 'SYCL_DEVICE_FILTER' env var values are 'gpu' and "
"'host', '"
<< "Supported 'SYCL_DEVICE_FILTER' env var values is 'gpu' and '"
<< filter_string << "' does not contain such substrings.\n";
return -1;
}
Expand Down