I’m implementing AD in a code that makes use of types built upon
SArray, and am trying to understand the best way toward converting things so that the code plays well with Enzyme.
From my understanding, to work with Enzyme, 1) all arrays and custom data types must be mutable, and 2) functions must mutate the arrays in-place and not return them. Is this correct?
If so, then my my naive strategy would be to replace
MArray and to replace
LArray. Does this seem like a good route?
If this thinking is correct, then I have some general questions. Is there an unavoidable performance trade-off between using
MArray in order to use Enzyme? Also, I noticed in LabelledArrays.jl that
SLArray is based on
SArray but that
LArray is not based on
MArray as I might expect. Is this the intended end state, or is it just because no one has implemented it yet? Maybe I’m misunderstanding this.