JITIFY has a static of type LibCuda which it interacts with on calls to JITIFY's APIs.
Programs that have statics that depend on this object have to ensure they forcefully shutdown before the static is destroyed because the initialization/deinitialization order of statics are not guaranteed, especially across different translation units.
We'd like to have a means of depending on / controlling the initialization order
Possible Solutions
- Wrap the JITIFY statics in a reference-counted context object that users can get access to and hold on to (type-erased)
- Alternatively: provide
inc_ref and dec_ref functions that reference-count the lifetime of the statics