Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[OpenMP][JIT] Cleanup JIT interface, caching, and races
The JIT interface was somewhat irregular as it used multiple global functions. It also did not cache the results of the JIT, hence multiple GPU systems would perform the work multiple times. Finally, there might have been races on the state if we have multi-threaded initialization of different embedded images, or one image initialized on multiple devices. This patch tries to rectify all of the above. The JITEngine is now a part of the GenericPluginTy and tied to one target triple. To support multiple "ComputeUnitKind"s (previously confusingly called Arch or [M]CPU) and to avoid re-jitting for the same ComputeUnitKind, we keep a map of JIT results per ComputeUnitKind. All interaction with the JIT happens through the JITEngine directly, two functions are exposed. Both use (shared) locks to avoid races and cache the result. All JIT-related environment variables are now defined together. Differential Revision: https://reviews.llvm.org/D141081
- Loading branch information
Showing
7 changed files
with
204 additions
and
174 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.