loki.transformations.tests.test_array_indexing

Functions

fixture_builder(tmp_path)

test_lower_constant_array_indices(tmp_path, ...)

Test lowering constant array indices

test_lower_constant_array_indices_academic(...)

Test lowering constant array indices for a valid but somewhat academic example ...

test_shift_to_zero_indexing(frontend, ignore)

Test shifting array dimensions to zero (or rather shift dimension dim to dim - 1).

test_transform_demote_dimension_arguments(...)

Apply variable demotion to array arguments defined with DIMENSION keywords.

test_transform_demote_variables(tmp_path, ...)

Apply variable demotion to a range of array variables.

test_transform_explicit_dimensions(tmp_path, ...)

Test making dimensions of arrays explicit and undoing this, thus removing colon notation from array dimensions either for all or for arrays within (inline) calls only.

test_transform_flatten_arrays(tmp_path, ...)

Test flattening or arrays, meaning converting multi-dimensional arrays to one-dimensional arrays including corresponding index arithmetic.

test_transform_flatten_arrays_call(tmp_path, ...)

Test flattening or arrays, meaning converting multi-dimensional arrays to one-dimensional arrays including corresponding index arithmetic (for calls).

test_transform_normalize_array_shape_and_access(...)

Test normalization of array shape and access, thus changing arrays with start index different than "1" to have start index "1".

test_transform_promote_resolve_vector_notation(...)

Apply and test resolve vector notation utility.

test_transform_promote_variable_scalar(...)

Apply variable promotion for a single scalar variable.

test_transform_promote_variables(tmp_path, ...)

Apply variable promotion for scalar and array variables.

test_transform_resolve_vector_notation_common_loops(...)

Apply and test resolve vector notation utility with already available/appropriate loops.

fixture_builder(tmp_path)
test_transform_promote_variable_scalar(tmp_path, frontend)

Apply variable promotion for a single scalar variable.

test_transform_promote_variables(tmp_path, frontend)

Apply variable promotion for scalar and array variables.

test_transform_demote_variables(tmp_path, frontend)

Apply variable demotion to a range of array variables.

test_transform_demote_dimension_arguments(tmp_path, frontend)

Apply variable demotion to array arguments defined with DIMENSION keywords.

test_transform_normalize_array_shape_and_access(tmp_path, frontend, start_index)

Test normalization of array shape and access, thus changing arrays with start index different than “1” to have start index “1”.

E.g., x1(5:len) -> `x1(1:len-4)

test_transform_flatten_arrays(tmp_path, frontend, builder, start_index)

Test flattening or arrays, meaning converting multi-dimensional arrays to one-dimensional arrays including corresponding index arithmetic.

test_shift_to_zero_indexing(frontend, ignore)

Test shifting array dimensions to zero (or rather shift dimension dim to dim - 1). This does not produce valid Fortran, but is part of the F2C transpilation logic.

test_transform_flatten_arrays_call(tmp_path, frontend, builder, explicit_dimensions)

Test flattening or arrays, meaning converting multi-dimensional arrays to one-dimensional arrays including corresponding index arithmetic (for calls).

test_lower_constant_array_indices(tmp_path, frontend, recurse_to_kernels, inline_external_only, pass_as_kwarg)

Test lowering constant array indices

test_lower_constant_array_indices_academic(tmp_path, frontend, recurse_to_kernels, inline_external_only)

Test lowering constant array indices for a valid but somewhat academic example …

The transformation is capable to handle that, but let’s just hope we’ll never see something like that out there in the wild …

test_transform_promote_resolve_vector_notation(tmp_path, frontend)

Apply and test resolve vector notation utility.

test_transform_resolve_vector_notation_common_loops(tmp_path, frontend, kidia_loop)

Apply and test resolve vector notation utility with already available/appropriate loops.

test_transform_explicit_dimensions(tmp_path, frontend, builder, calls_only)

Test making dimensions of arrays explicit and undoing this, thus removing colon notation from array dimensions either for all or for arrays within (inline) calls only.