Skip to content

Conversation

@oleksandr-pavlyk
Copy link
Contributor

Closes gh-1038.

Added checks to dpctl.tensor.empty and dpctl.tensor.zeros to disallow creation of arrays with data-types not natively supported by the requested device.

Also added check to dpctl.tensor.usm_ndarray constructor to raise the error if an attempt to create an instance requests data type not natively supported by the device.

  • Have you provided a meaningful PR description?
  • Have you tested your changes locally for CPU and GPU devices?
  • Have you made sure that new changes do not introduce compiler warnings?

Both functions will now raise ValueError is data type
not natively supported by device is requested.
Where dtype is irrelavant use data types mandated by SYCL standard,
otherwise check if dtype can be used before making the call.
@github-actions
Copy link

@coveralls
Copy link
Collaborator

coveralls commented Jan 22, 2023

Coverage Status

Coverage: 82.076% (-0.1%) from 82.19% when pulling d62ab9e on fix-gh-1038-empty-zero-check-device-aspects into 1916370 on master.

@github-actions
Copy link

Array API standard conformance tests for dpctl=0.14.1dev1=py310h76be34b_31 ran successfully.
Passed: 33
Failed: 801
Skipped: 280

@github-actions
Copy link

Array API standard conformance tests for dpctl=0.14.1dev1=py310h76be34b_35 ran successfully.
Passed: 33
Failed: 801
Skipped: 280

@oleksandr-pavlyk oleksandr-pavlyk merged commit 6ca4bbb into master Jan 26, 2023
@oleksandr-pavlyk oleksandr-pavlyk deleted the fix-gh-1038-empty-zero-check-device-aspects branch January 26, 2023 14:58
@github-actions
Copy link

Deleted rendered PR docs from intelpython.github.com/dpctl, latest should be updated shortly. 🤞

@github-actions
Copy link

Array API standard conformance tests for dpctl=0.14.1dev1=py310h76be34b_43 ran successfully.
Passed: 33
Failed: 801
Skipped: 280

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Functions zeros() and empty() do not raise RuntimeError for float16 dtype.

3 participants