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

[PI][OpenCL] Test support for exposing compute slices #1530

Open
wants to merge 2 commits into
base: intel
Choose a base branch
from

Conversation

asudarsa
Copy link

@asudarsa asudarsa commented Jan 20, 2023

This test tries to identify devices at three levels - root, sub, and sub-sub. For a device at a given level, checks are provided to see if there is more than 1 device at its sub-level. This test is expected to run without crashing for all backends, though it is specifically added to test changes in OpenCL plugin.

Impl: intel/llvm#7963

Signed-off-by: Arvind Sudarsanam [email protected]

This test tries to identify devices at three levels - root, sub, and sub-sub. For a device at a given level, checks are provided to see if there is more than 1 device at its sub-level. This test is expected to run without crashing for all backends, though it is specifically added to test changes in OpenCL plugin.

Signed-off-by: Arvind Sudarsanam <[email protected]>
@asudarsa asudarsa requested a review from a team as a code owner January 20, 2023 02:45
@asudarsa
Copy link
Author

/verify with intel/llvm#7963

Signed-off-by: Arvind Sudarsanam <[email protected]>
Comment on lines +32 to +40
#if __clang_major__ > 15
#include <sycl/sycl.hpp>
#else
#include <CL/sycl.hpp>
inline namespace cl {
using namespace sycl;
}
namespace sycl = ::cl::sycl;
#endif

Choose a reason for hiding this comment

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

We don't do that - the test-suite is tied with the compiler.

Comment on lines +53 to +54
std::cout << "Exception: " << e.what() << std::endl;
std::fflush(stdout);

Choose a reason for hiding this comment

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

https://en.cppreference.com/w/cpp/io/manip/endl

Inserts a newline character into the output sequence os and flushes it as if by calling os.put(os.widen('\n')) followed by os.flush().

#include <cstring>
namespace {
void readEnvStringWithDefault(const char *name, char *value, const char *def) {
char *tmp = std::getenv(name);

Choose a reason for hiding this comment

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

We don't set any env variable in RUN lines, so I don't see how it is applicable to this test.

Comment on lines +125 to +127
if (subdevice_partition_properties[i] ==
sycl::info::partition_property::
ext_intel_partition_by_cslice) {

Choose a reason for hiding this comment

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

I don't see how the test fails without the OpenCL plugin implementation.

Comment on lines +140 to +152
}
}
}
}
break;
} else {
devices.push_back(device);
}
}
}
}
}
}

Choose a reason for hiding this comment

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

Can we somehow restructure the code to avoid this?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants