Skip to content

CUF/ACC: Translate size(<array>[,<dim>]) and lbound(...) and ubound(...) #12

@domcharrier

Description

@domcharrier
  • In extracted kernels / device subroutines, we sometimes need to translate size(<array>[,<dim>]), lbound(<array>,<dim>)
    and ubound(<array>,<dim>) intrinsic calls,

Implementation status for different types of <array> and <dim>:

  • <array> is identifier and <dim> is integer literal:
    • size(<array>,<dim>) -> <array>_n<dim>
    • lbound(<array>,<dim>) -> <array>_lb<dim>
    • ubound(<array>,<dim>) -> <array>_lb<dim> + <array>_n<dim>

NOTE: Above, the <array>_lb<dim> and <array>_n<dim> are already arguments of
the extracted routines.

  • <array> is identifier and <dim> is identifier | arithmetic expression

    • In this case, we need to generate a query function that is parameterized by array rank.
  • Other cases where <array> is not an identifier and / or <dim> is identifier are not supported

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions