Enzyme main
Loading...
Searching...
No Matches
enzyme_markers Namespace Reference

Classes

struct  InterleaveSplit
 Where the primals stop and the shadows start. More...
 
struct  MarkerInfo
 

Enumerations

enum class  MarkerRole { Activity , Interleave , CallFlag , Modifier }
 What a marker does to the call it appears in. More...
 

Functions

std::optional< MarkerInfo > lookupEnzymeMarker (llvm::StringRef name)
 The one description of the __enzyme_* argument markers.
 
bool markerActivityTakesShadow (DIFFE_TYPE a)
 Whether an activity is one that a shadow goes with.
 
template<typename MarkerAtFn >
InterleaveSplit findEnzymeInterleave (unsigned first, unsigned count, MarkerAtFn markerAt)
 Find enzyme_interleave among the operands, which has to be done before walking them: it says where the shadows are, and the walk needs that from the first argument on.
 

Enumeration Type Documentation

◆ MarkerRole

enum class enzyme_markers::MarkerRole
strong

What a marker does to the call it appears in.

Enumerator
Activity 

Names the activity of the argument that follows it.

Interleave 

Says the shadows come after all of the primals rather than beside each one, in the same order.

CallFlag 

Configures the call rather than an argument: nothing follows it that is an argument.

Modifier 

Changes how the argument that follows is read without naming an activity.

Definition at line 34 of file EnzymeCallMarkers.h.

Function Documentation

◆ findEnzymeInterleave()

template<typename MarkerAtFn >
InterleaveSplit enzyme_markers::findEnzymeInterleave ( unsigned first,
unsigned count,
MarkerAtFn markerAt )

Find enzyme_interleave among the operands, which has to be done before walking them: it says where the shadows are, and the walk needs that from the first argument on.

markerAt(i) gives the marker name operand i reads, if it reads one.

Definition at line 147 of file EnzymeCallMarkers.h.

◆ lookupEnzymeMarker()

std::optional< MarkerInfo > enzyme_markers::lookupEnzymeMarker ( llvm::StringRef name)
inline

The one description of the __enzyme_* argument markers.

Returns nothing for a name this does not know – callers report that as the error it is rather than carrying on, since guessing at an unknown marker is how an argument gets read as a marker.

Definition at line 77 of file EnzymeCallMarkers.h.

References Activity, CallFlag, CONSTANT, DUP_ARG, DUP_NONEED, Interleave, Modifier, and OUT_DIFF.

◆ markerActivityTakesShadow()

bool enzyme_markers::markerActivityTakesShadow ( DIFFE_TYPE a)
inline

Whether an activity is one that a shadow goes with.

Definition at line 128 of file EnzymeCallMarkers.h.

References DUP_ARG, and DUP_NONEED.