Skip to content

Device-specific type promotion rules #672

Closed
@oleksandr-pavlyk

Description

@oleksandr-pavlyk

For devices that have different capabilities (support for float64/float16 may or may not be present),
the type promotion graph adopted by array-API must be different.

Functions xp.can_cast (ref) and xp.result_type (ref) allow for signatures where all inputs are data types.

For such inputs the device information is not available, but xp.can_cast(xp.float32, xp.float64) is True for devices that support float64, but should be False to devices that do not.

The only variability in data type support across devices, per SYCL spec, exists for 'float64' and 'float16'. In SYCL these capabilities are queries via device aspects. This is only relevant since standardization in SYCL gives us confidence that every other data-type is going to be supported.

So I would like to open for discussion the following proposal

  • xp.can_cast and xp_result_type need to acquire device keyword support with default value of None to mean that device capabilities are determined from argument arrays, if present, and or from capabilities of the default device otherwise.

Alternative name for the keyword is acceptable too, as long it can used to convey device capabilities.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Stage 1

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions