Skip to content
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

dpctl.tensor.abs() does not work on Iris Xe on Windows #1279

Closed
npolina4 opened this issue Jul 13, 2023 · 1 comment · Fixed by #1343
Closed

dpctl.tensor.abs() does not work on Iris Xe on Windows #1279

npolina4 opened this issue Jul 13, 2023 · 1 comment · Fixed by #1343
Assignees
Labels
bug Something isn't working

Comments

@npolina4
Copy link
Collaborator

import dpctl.tensor as dpt
a = dpt.ones(10, dtype='c8')
dpt.abs(a)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\npolina\devel\miniconda3\envs\dpnp_new\envs\dpnp1\lib\site-packages\dpctl\tensor\_elementwise_common.py", line 101, in __call__
    ht, _ = self.unary_fn_(x, out, sycl_queue=exec_q)
RuntimeError: Required aspect fp64 is not supported on the device
@npolina4 npolina4 self-assigned this Jul 13, 2023
@oleksandr-pavlyk
Copy link
Collaborator

This problem is Windows specific, and can not be reproduced on Linux.

@oleksandr-pavlyk oleksandr-pavlyk changed the title dpctl.tensor.abs() does not work on Iris Xe dpctl.tensor.abs() does not work on Iris Xe on Windows Jul 25, 2023
oleksandr-pavlyk added a commit that referenced this issue Aug 15, 2023
Provide cabs private method implementating abs for complex types, paying
attention to array-API mandated special values.

To work-around gh-1279, use std::hypot to compute value for finite inputs.
Compile with -DUSE_STD_ABS_FOR_COMPLEX_TYPES to use std::abs(z) instead of
std::hypot(std::real(z), std::imag(z)).
oleksandr-pavlyk added a commit that referenced this issue Aug 15, 2023
This change provides private method csqrt to evaluate square-root
for complex types. It handles special values as mandated by array API.

The finite input, it provides its own implementation based on std::hypot
and std::sqrt for real types instead of calling std::sqrt on finite
input of complex type.

Compile with -DUSE_STD_SQRT_FOR_COMPLEX_TYPES to use std::sqrt instead
of custom implementation.

Cursory performance study suggests that custom implementation is at least
not worse than std::sqrt one.
oleksandr-pavlyk added a commit that referenced this issue Aug 15, 2023
Provide cabs private method implementating abs for complex types, paying
attention to array-API mandated special values.

To work-around gh-1279, use std::hypot to compute value for finite inputs.
Compile with -DUSE_STD_ABS_FOR_COMPLEX_TYPES to use std::abs(z) instead of
std::hypot(std::real(z), std::imag(z)).
oleksandr-pavlyk added a commit that referenced this issue Aug 15, 2023
This change provides private method csqrt to evaluate square-root
for complex types. It handles special values as mandated by array API.

The finite input, it provides its own implementation based on std::hypot
and std::sqrt for real types instead of calling std::sqrt on finite
input of complex type.

Compile with -DUSE_STD_SQRT_FOR_COMPLEX_TYPES to use std::sqrt instead
of custom implementation.

Cursory performance study suggests that custom implementation is at least
not worse than std::sqrt one.
@oleksandr-pavlyk oleksandr-pavlyk added the bug Something isn't working label Aug 15, 2023
oleksandr-pavlyk added a commit that referenced this issue Aug 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants