Skip to content

__array_namespace_info__ returns complex128 dtype when no fp64 #1977

Closed
@antonwolfy

Description

@antonwolfy

It seems dpctl only checks if float64 is supported based on device capabilities when building a dictionary of all Array API data types:

import dpctl, dpctl.tensor as dpt

dpctl.__version__
# Out: '0.19.0dev0+480.g360ce45dc6'

info = dpnp.__array_namespace_info__()
info.dtypes()
# Out:
# {'bool': dtype('bool'),
#  'float32': dtype('float32'),
#  'complex64': dtype('complex64'),
#  'complex128': dtype('complex128'),
#  'int8': dtype('int8'),
#  'int16': dtype('int16'),
#  'int32': dtype('int32'),
#  'int64': dtype('int64'),
#  'uint8': dtype('uint8'),
#  'uint16': dtype('uint16'),
#  'uint32': dtype('uint32'),
#  'uint64': dtype('uint64')}

# no fp64 support by default device:
dpctl.select_default_device().has_aspect_fp64
# Out: False

As a result float64 is filtered out but complex128 is present in the output dictionary, which looks faulty.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions