Description: Fix errors from bad git update
Author: Alastair McKinstry <mckinstry@debian.org>
Last-Updated: 2025-10-15
Bug-Origin: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1117981
Forwarded: not-needed

--- a/loki/transformations/array_indexing/tests/test_vector_notation.py
+++ b/loki/transformations/array_indexing/tests/test_vector_notation.py
@@ -52,15 +52,6 @@
 
     assert len(loops) == 4
     assert loops[0].variable == 'i_ret1_1'
-<<<<<<< HEAD
-    assert loops[0].bounds.children == (1, 'param1', 1) if frontend != OMNI else (1, 3, 1)
-    assert loops[1].variable == 'i_ret1_0'
-    assert loops[1].bounds.children == (1, 'param1', 1) if frontend != OMNI else (1, 3, 1)
-    assert loops[2].variable == 'i_ret2_1'
-    assert loops[2].bounds.children == (1, 'param2', 1) if frontend != OMNI else (1, 5, 1)
-    assert loops[3].variable == 'i_ret2_0'
-    assert loops[3].bounds.children == (1, 'param1', 1) if frontend != OMNI else (1, 3, 1)
-=======
     assert loops[0].bounds == '1:param1' if frontend != OMNI else '1:3:1'
     assert loops[1].variable == 'i_ret1_0'
     assert loops[1].bounds == '1:param1' if frontend != OMNI else '1:3:1'
@@ -68,7 +59,6 @@
     assert loops[2].bounds == '1:param2' if frontend != OMNI else '1:5:1'
     assert loops[3].variable == 'i_ret2_0'
     assert loops[3].bounds == '1:param1' if frontend != OMNI else '1:3:1'
->>>>>>> upstream/0.3.4
 
     assert len(arrays) == 2
     assert arrays[0].dimensions == ('i_ret1_0', 'i_ret1_1')
@@ -162,38 +152,6 @@
     loops = FindNodes(ir.Loop).visit(routine.body)
     arrays = [var for var in FindVariables(unique=False).visit(routine.body) if isinstance(var, sym.Array)]
     assert len(loops) == 21
-<<<<<<< HEAD
-    assert loops[0].variable == 'i_tmp_dummy_1' and loops[0].bounds.children == (0, 4, None)
-    assert loops[1].variable == 'jl' and loops[1].bounds.children == (1, 'n', 1)
-    assert loops[2].variable == 'jl' and loops[2].bounds.children == (1, 'n', 1)
-    assert loops[3].variable == 'jm' and loops[3].bounds.children == (1, 'm', 1)
-    assert loops[4].variable == 'jl' and loops[4].bounds.children == (1, 'n', 1)
-    assert loops[5].variable == 'jl' and loops[5].bounds.children == (1, 'n', 1)
-    assert loops[6].variable == 'jm' and loops[6].bounds.children == (1, 'm', 1)
-    assert loops[7].variable == 'jk' and loops[7].bounds.children == (1, 'l', 1)
-    assert loops[8].variable == 'jl' and loops[8].bounds.children == (1, 'n', 1)
-    assert loops[9].variable == 'jk' and loops[9].bounds.children == (1, 'l', 1)
-    assert loops[10].variable == 'jl'
-    if kidia_loop:
-        assert loops[10].bounds.children == ('kidia', 'kfdia', None)
-    else:
-        assert loops[10].bounds.children == (1, 'n', None)
-    assert loops[11].variable == 'jm' and loops[11].bounds.children == (1, 'm', None)
-    assert loops[12].variable == 'jm' and loops[12].bounds.children == (1, 'm', None)
-    assert loops[13].variable == 'jl' and loops[13].bounds.children == (1, 'n', None)
-    assert loops[14].variable == 'jk' and loops[14].bounds.children == (1, 'l', None)
-    assert loops[15].variable == 'jk' and loops[15].bounds.children == (1, 'l', None)
-    assert loops[16].variable == 'jl' and loops[16].bounds.children == (1, 'n', 1)
-    assert loops[17].variable == 'jm' and loops[17].bounds.children == (1, 'm', None)
-    assert loops[18].variable == 'jl' and loops[18].bounds.children == (1, 'n', None)
-    assert loops[19].variable == 'jl' and loops[19].bounds.children == (1, 'n', 1)
-    if kidia_loop:
-        assert loops[20].variable == 'jl'
-        assert loops[20].bounds.children == ('kidia', 'kfdia', None)
-    else:
-        assert loops[20].variable == 'i_vector_2_0'
-        assert loops[20].bounds.children == ('kidia', 'kfdia', None)
-=======
     assert loops[0].variable == 'i_tmp_dummy_1' and loops[0].bounds == '0:4'
     assert loops[1].variable == 'jl' and loops[1].bounds == '1:n'
     assert loops[2].variable == 'jl' and loops[2].bounds == '1:n'
@@ -224,7 +182,6 @@
     else:
         assert loops[20].variable == 'i_vector_2_0'
         assert loops[20].bounds == 'kidia:kfdia'
->>>>>>> upstream/0.3.4
 
     assert len(arrays) == 17
     assert arrays[0].name.lower() == 'tmp_dummy' and arrays[0].dimensions == ('jl', 'i_tmp_dummy_1')
@@ -359,8 +316,6 @@
     assert (b_test == b_ref).all()
 
     builder.clean()
-<<<<<<< HEAD
-=======
 
 
 @pytest.mark.parametrize('frontend', available_frontends())
@@ -523,4 +478,3 @@
     assert assigns[0] in loops[0].body
     assert assigns[1] in loops[1].body
     assert conds[0] in loops[2].body
->>>>>>> upstream/0.3.4
--- a/loki/transformations/array_indexing/vector_notation.py
+++ b/loki/transformations/array_indexing/vector_notation.py
@@ -111,63 +111,6 @@
     """
     Resolve implicit vector notation by inserting explicit loops
     """
-<<<<<<< HEAD
-    loop_map = {}
-    index_vars = set()
-    vmap = {}
-    # find available loops and create map {(lower, upper, step): loop_variable}
-    loops = FindNodes(Loop).visit(routine.body)
-    loop_map = {(loop.bounds.lower, loop.bounds.upper, loop.bounds.step or 1):
-                loop.variable for loop in loops}
-    for stmt in FindNodes(Assignment).visit(routine.body):
-        # Loop over all variables and replace them with loop indices
-        vdims = []
-        shape_index_map = {}
-        index_range_map = {}
-        for v in FindVariables(unique=False).visit(stmt):
-            if not isinstance(v, sym.Array):
-                continue
-
-            # Skip if the entire array is used implicitly
-            if not v.dimensions:
-                continue
-
-            ivar_basename = f'i_{stmt.lhs.basename}'
-            for i, dim, s in zip(count(), v.dimensions, as_tuple(v.shape)):
-                if isinstance(dim, sym.RangeIndex):
-                    # use the shape for e.g., `ARR(:)`, but use the dimension for e.g., `ARR(2:5)`
-                    _s = dim if dim.lower is not None else s
-                    # create tuple to test whether an appropriate loop is already available
-                    test_range = (sym.IntLiteral(1), _s, 1) if not isinstance(_s, sym.RangeIndex)\
-                            else (_s.lower, _s.upper, 1)
-                    # actually test for it
-                    if test_range in loop_map:
-                        # Use index variable of available matching loop
-                        ivar = loop_map[test_range]
-                    else:
-                        # Create new index variable
-                        vtype = SymbolAttributes(BasicType.INTEGER)
-                        ivar = sym.Variable(name=f'{ivar_basename}_{i}', type=vtype, scope=routine)
-                    shape_index_map[(i, s)] = ivar
-                    index_range_map[ivar] = _s
-
-                    if ivar not in vdims:
-                        vdims.append(ivar)
-
-            # Add index variable to range replacement
-            new_dims = as_tuple(shape_index_map.get((i, s), d)
-                                for i, d, s in zip(count(), v.dimensions, as_tuple(v.shape)))
-            vmap[v] = v.clone(dimensions=new_dims)
-
-        index_vars.update(list(vdims))
-
-        # Recursively build new loop nest over all implicit dims
-        if len(vdims) > 0:
-            loop = None
-            body = stmt
-            for ivar in vdims:
-                irange = index_range_map[ivar]
-=======
 
     # Find loops and map their range to the loop index variable
     loop_map = {
@@ -379,24 +322,10 @@
             loop = None
             body = stmt
             for ivar, irange in index_range_map.items():
->>>>>>> upstream/0.3.4
                 if isinstance(irange, sym.RangeIndex):
                     bounds = sym.LoopRange(irange.children)
                 else:
                     bounds = sym.LoopRange((sym.Literal(1), irange, sym.Literal(1)))
-<<<<<<< HEAD
-                loop = Loop(variable=ivar, body=as_tuple(body), bounds=bounds)
-                body = loop
-
-            loop_map[stmt] = loop
-
-    if len(loop_map) > 0:
-        routine.body = Transformer(loop_map).visit(routine.body)
-    routine.variables += tuple(set(index_vars))
-
-    # Apply variable substitution
-    routine.body = SubstituteExpressions(vmap).visit(routine.body)
-=======
                 loop = ir.Loop(variable=ivar, body=as_tuple(body), bounds=bounds)
                 body = loop
 
@@ -449,4 +378,3 @@
             return loop
 
         return masked
->>>>>>> upstream/0.3.4
--- a/loki/transformations/field_api.py
+++ b/loki/transformations/field_api.py
@@ -363,46 +363,15 @@
                             kwarguments=kwargs)
 
 
-<<<<<<< HEAD
-def field_get_host_data(field_ptr, host_ptr, transfer_type: FieldAPITransferType, scope: Scope):
-    """
-    Utility function to generate a :any:`CallStatement` corresponding to a Field API
-    ``GET_HOST_DATA`` call.
-=======
 def field_sync_device(field_ptr, transfer_type: FieldAPITransferType, scope: Scope,
                       queue=None, blk_bounds=None, offset=None):
     """
     Utility function to generate a :any:`CallStatement` corresponding to a Field API
     ``SYNC_DEVICE`` call.
->>>>>>> upstream/0.3.4
 
     Parameters
     ----------
     field_ptr: pointer to field object
-<<<<<<< HEAD
-        Pointer to the field to call ``GET_HOST_DATA`` from.
-    host_ptr: :any:`Array`
-        Host pointer array
-    transfer_type: :any:`FieldAPITransferType`
-        Field API transfer type to determine which ``GET_HOST_DATA`` method to call.
-    scope: :any:`Scope`
-        Scope of the created :any:`CallStatement`
-    """
-    if not isinstance(transfer_type, FieldAPITransferType):
-        raise TypeError(f"transfer_type must be of type FieldAPITransferType, but is of type {type(transfer_type)}")
-    if transfer_type == FieldAPITransferType.READ_ONLY:
-        suffix = 'RDONLY'
-    elif transfer_type == FieldAPITransferType.READ_WRITE:
-        suffix = 'RDWR'
-    else:
-        suffix = ''
-    procedure_name = 'GET_HOST_DATA_' + suffix
-    return ir.CallStatement(name=sym.ProcedureSymbol(procedure_name, parent=field_ptr, scope=scope),
-                            arguments=(host_ptr.clone(dimensions=None),), )
-
-
-def field_sync_host(field_ptr, scope):
-=======
         Pointer to the field to call ``SYNC_HOST`` from.
     transfer_type: :any:`FieldAPITransferType`
         Field API transfer type to determine which ``SYNC_DEVICE`` method to call.
@@ -422,7 +391,6 @@
 
 def field_sync_host(field_ptr, transfer_type: FieldAPITransferType, scope: Scope,
                     queue=None, blk_bounds=None, offset=None):
->>>>>>> upstream/0.3.4
     """
     Utility function to generate a :any:`CallStatement` corresponding to a Field API
     ``SYNC_HOST`` call.
@@ -483,24 +451,6 @@
     return ir.CallStatement(name=sym.ProcedureSymbol(procedure_name, parent=field_ptr, scope=scope), arguments=())
 
 
-<<<<<<< HEAD
-def field_delete_device_data(field_ptr, scope):
-    """
-    Utility unction to generate a :any:`CallStatement` corresponding to a Field API
-    `DELETE_DEVICE_DATA` call.
-
-    Parameters
-    ----------
-    field_ptr: pointer to field object
-        Pointer to the field to call ``DELETE_DEVICE_DATA`` from.
-    scope: :any:`Scope`
-        Scope of the created :any:`CallStatement`
-    """
-
-    procedure_name = 'DELETE_DEVICE_DATA'
-    return ir.CallStatement(name=sym.ProcedureSymbol(procedure_name, parent=field_ptr, scope=scope), arguments=())
-=======
 def field_wait_for_async_queue(queue, scope: Scope):
     return ir.CallStatement(name=sym.ProcedureSymbol('WAIT_FOR_ASYNC_QUEUE', scope=scope),
                             arguments=(queue,))
->>>>>>> upstream/0.3.4
