Skip to content

[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

Merged
merged 7 commits into from
Aug 4, 2020
Merged

Conversation

kbobrovs
Copy link
Contributor

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

@kbobrovs kbobrovs requested a review from a team as a code owner July 30, 2020 14:37
@kbobrovs kbobrovs requested review from againull and vladimirlaz July 30, 2020 14:37
@kbobrovs kbobrovs added the esimd Explicit SIMD feature label Jul 30, 2020
@kbobrovs
Copy link
Contributor Author

@cmc-rep, @kychendev, @pratikashar - FYI

@kbobrovs kbobrovs force-pushed the kbobrovs-sycl branch 2 times, most recently from 3a2b3c2 to 6d564ac Compare July 31, 2020 05:02
@kbobrovs kbobrovs requested a review from bader as a code owner July 31, 2020 05:02
@@ -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.
Copy link
Contributor

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

Copy link
Contributor Author

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

Comment on lines 14 to 39
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;
Copy link
Contributor

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

Copy link
Contributor Author

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>
@kbobrovs kbobrovs force-pushed the kbobrovs-sycl branch 2 times, most recently from e9af482 to a5e2ac3 Compare August 1, 2020 05:08
kbobrovs added 4 commits July 31, 2020 22:16
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>
@kbobrovs kbobrovs requested a review from vladimirlaz August 1, 2020 15:36
Signed-off-by: Konstantin S Bobrovsky <konstantin.s.bobrovsky@intel.com>
@kbobrovs kbobrovs requested a review from vladimirlaz August 3, 2020 12:59
@kbobrovs
Copy link
Contributor Author

kbobrovs commented Aug 4, 2020

@bader - can you please take a look and merge if you are OK.

@bader bader merged commit 32bf607 into intel:sycl Aug 4, 2020
Chenyang-L pushed a commit that referenced this pull request Feb 18, 2025
Enable -flto and -fsanitize=cfi in clang
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
esimd Explicit SIMD feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants