CUF/ACC: Translate `size(<array>[,<dim>])` and `lbound(...)` and `ubound(...)`
domcharrier opened this issue · comments
Dominic Charrier commented
- In extracted kernels / device subroutines, we sometimes need to translate
size(<array>[,<dim>])
,lbound(<array>,<dim>)
andubound(<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