-
Notifications
You must be signed in to change notification settings - Fork 787
[SYCL][ESIMD] Add on-device tests. #2222
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@cmc-rep, @kychendev, @pratikashar - FYI |
3a2b3c2
to
6d564ac
Compare
@@ -166,6 +166,10 @@ def getDeviceCount(device_type): | |||
if platform.system() == "Linux": | |||
gpu_run_on_linux_substitute = "env SYCL_DEVICE_TYPE=GPU SYCL_BE={SYCL_BE} ".format(SYCL_BE=backend) | |||
gpu_check_on_linux_substitute = "| FileCheck %s" | |||
# ESIMD-specific setup. Requires OpenCL for now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is better to check that opencl feature is present as it is requirement
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For now I want the tests to fail when OpenCL feature is not present on GPU, and be able to SYCL_BE=PI_OPENCL
class ESIMDSelector : public device_selector { | ||
// Require GPU device unless HOST is requested in SYCL_DEVICE_TYPE env | ||
virtual int operator()(const device &device) const { | ||
if (const char *dev_type = getenv("SYCL_DEVICE_TYPE")) { | ||
if (!strcmp(dev_type, "GPU")) | ||
return device.is_gpu() ? 1000 : -1; | ||
if (!strcmp(dev_type, "HOST")) | ||
return device.is_host() ? 1000 : -1; | ||
std::cerr << "Supported 'SYCL_DEVICE_TYPE' env var values are 'GPU' and " | ||
"'HOST', '" | ||
<< dev_type << "' is not.\n"; | ||
return -1; | ||
} | ||
// If "SYCL_DEVICE_TYPE" not defined, only allow gpu device | ||
return device.is_gpu() ? 1000 : -1; | ||
} | ||
}; | ||
|
||
auto exception_handler = [](exception_list l) { | ||
for (auto ep : l) { | ||
try { | ||
std::rethrow_exception(ep); | ||
} catch (cl::sycl::exception &e0) { | ||
std::cout << "sycl::exception: " << e0.what() << std::endl; | ||
} catch (std::exception &e) { | ||
std::cout << "std::exception: " << e.what() << std::endl; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Common part can be moved to single header to avoid code duplication
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
Add ESIMD tests which can run on Intel GPU devices. Authors: Gang Chen <gang.y.chen@intel.com> Kaiyu Chen <kai.yu.chen@intel.com> Pratik Ashar <pratik.j.ashar@intel.com> Konstantin S Bobrovsky <konstantin.s.bobrovsky@intel.com> Signed-off-by: Konstantin S Bobrovsky <konstantin.s.bobrovsky@intel.com>
e9af482
to
a5e2ac3
Compare
Signed-off-by: Konstantin S Bobrovsky <konstantin.s.bobrovsky@intel.com>
Signed-off-by: Konstantin S Bobrovsky <konstantin.s.bobrovsky@intel.com>
Signed-off-by: Konstantin S Bobrovsky <konstantin.s.bobrovsky@intel.com>
Signed-off-by: Konstantin S Bobrovsky <konstantin.s.bobrovsky@intel.com>
Signed-off-by: Konstantin S Bobrovsky <konstantin.s.bobrovsky@intel.com>
Signed-off-by: Konstantin S Bobrovsky <konstantin.s.bobrovsky@intel.com>
@bader - can you please take a look and merge if you are OK. |
This fixes #1728 Original commit: KhronosGroup/SPIRV-LLVM-Translator@dd1f598
Enable -flto and -fsanitize=cfi in clang
Add ESIMD tests which can run on Intel GPU devices.
Authors:
Gang Chen gang.y.chen@intel.com
Kaiyu Chen kai.yu.chen@intel.com
Pratik Ashar pratik.j.ashar@intel.com
Konstantin S Bobrovsky konstantin.s.bobrovsky@intel.com
Signed-off-by: Konstantin S Bobrovsky konstantin.s.bobrovsky@intel.com