Skip to content

Add total_elements to dace.data descriptors, next to total_size (including Scalar) #2592

Description

@ThrudPrimrose

Data descriptors expose total_size, but there is no total_elements. Array.total_size is the allocated span, which can exceed the logical element count when strides or padding are given, so callers that need the number of elements recompute prod(shape) themselves.

Proposal: add a total_elements property to dace.data (at least Data, Array, Scalar, Stream), with Scalar returning 1, so that total_elements and total_size are both valid on every descriptor, scalars included.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions