Skip to content

[SYCL][ROCm] Fix rocm_piPlatformsGet when there are no devices #4314

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 1 commit into from
Aug 12, 2021

Conversation

al42and
Copy link
Contributor

@al42and al42and commented Aug 11, 2021

hipGetDeviceCount returns the hipErrorNoDevice error when there are no
available devices. Instead of treating it as a PI error, we now properly
report that the platform is not available.

Before:

$ sycl-ls

PI HIP ERROR:
        Value:           100
        Name:            hipErrorNoDevice
        Description:     hipErrorNoDevice
        Function:        operator()
        Source Location: /nethome/aland/intel-sycl/llvm/sycl/plugins/rocm/pi_rocm.cpp:699

[opencl:0] GPU : Intel(R) OpenCL HD Graphics 3.0 [1.0.0]
[opencl:1] GPU : Intel(R) OpenCL HD Graphics 3.0 [1.0.0]
[level_zero:0] GPU : Intel(R) Level-Zero 1.1 [1.1.0]
[level_zero:1] GPU : Intel(R) Level-Zero 1.1 [1.1.0]
[host:0] HOST: SYCL host platform 1.2 [1.2]

After:

$ sycl-ls
[opencl:0] GPU : Intel(R) OpenCL HD Graphics 3.0 [1.0.0]
[opencl:1] GPU : Intel(R) OpenCL HD Graphics 3.0 [1.0.0]
[level_zero:0] GPU : Intel(R) Level-Zero 1.1 [1.1.0]
[level_zero:1] GPU : Intel(R) Level-Zero 1.1 [1.1.0]
[host:0] HOST: SYCL host platform 1.2 [1.2]

hipGetDeviceCount returns the hipErrorNoDevice error when there are no
available devices. Instead of treating it as a PI error, we now properly
report that the platform is not available.
@al42and al42and requested a review from smaslov-intel as a code owner August 11, 2021 09:37
@bader bader added the hip Issues related to execution on HIP backend. label Aug 11, 2021
Copy link
Contributor

@smaslov-intel smaslov-intel left a comment

Choose a reason for hiding this comment

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

LGTM

@AerialMantis
Copy link
Contributor

LGTM

@bader bader merged commit da138cc into intel:sycl Aug 12, 2021
@al42and al42and deleted the sycl-rocm-no-devices branch August 12, 2021 19:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hip Issues related to execution on HIP backend.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants