-
Notifications
You must be signed in to change notification settings - Fork 145
Description
We need a plan for automatically handling global variables without explicitly giving annotations. Can we summarize the challenges involved in handling globals here?
Here are a few preliminary thoughts that come to mind:
There are a few categories of global use (unsure if list is complete):
(a) globals that are constant for entire duration of program.
(b) globals that are precomputed during the program and constant for subsequent uses.
(c) globals acting as a scratch-space --- e.g. a static array of floats.
(d) globals for caching: e.g. a static lookup table.
(a),(b) can probably be identified via analysis; (c) can either be disallowed or handled by duplicating static storage; (d) is tricky because the data structure may be manipulated/initialized prior to the enzyme_autodiff call.