Currently we set ccontext everywhere accordingly, but that causes many
unnecessary function calls. For example, in the resource pool, if we need to
resize the pool, we need to get from allocator. Each call to allocate sets the
current context once, which is unnecessary. In this patch, we set the context
only in the entry interface functions, if needed. Actually in the best way this
should be implemented via RAII, but since cuCtxSetCurrent could return error,
and we don't use exception, we can't stop the execution if RAII fails.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
Nice, see my comment. LG
openmp/libomptarget/plugins/cuda/src/rtl.cpp | ||
---|---|---|
1725 | If we don't need setContext for an entry point, add a comment stating that please. |
If we don't need setContext for an entry point, add a comment stating that please.