transformations.utility_routines

Utility transformations to update or remove calls to DR_HOOK and other utility routines

Classes

DrHookTransformation([remove, mode])

Re-write or remove the DrHook label markers in transformed kernel routines

RemoveCallsTransformation(routines[, ...])

Removes specified CallStatement objects from any Subroutine.

class DrHookTransformation(remove=False, mode=None, **kwargs)

Bases: Transformation

Re-write or remove the DrHook label markers in transformed kernel routines

Parameters:
  • remove (bool) – Remove calls to DR_HOOK

  • mode (str) – Transformation mode to insert into DrHook labels

transform_subroutine(routine, **kwargs)

Apply transformation to subroutine object

class RemoveCallsTransformation(routines, include_intrinsics=False, **kwargs)

Bases: Transformation

Removes specified CallStatement objects from any Subroutine.

In addition, this transformation will also remove inline conditionals that guard the respective utility calls, in order to preserve consistent code.

Parameters:
  • routines (list of str) – List of subroutine names to remove

  • include_intrinsics (bool) – Option to extend searches to Intrinsic nodes to capture print/write statements

transform_subroutine(routine, **kwargs)

Apply transformation to subroutine object