Skip to content

[BUG] LibCuda and global objects don't have deterministic lifetimes #154

@lamarrr

Description

@lamarrr

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions