aboutsummaryrefslogtreecommitdiff
path: root/llvm/unittests/Support/CommandLineTest.cpp
diff options
context:
space:
mode:
authorShilei Tian <i@tianshilei.me>2022-03-09 16:32:40 -0500
committerShilei Tian <i@tianshilei.me>2022-03-09 16:32:47 -0500
commit39d3283a08ba0d687eba3f74ecb85d60b7c71355 (patch)
treef83a94bed33394697a2a9b8d3d5659c489c2e1fc /llvm/unittests/Support/CommandLineTest.cpp
parent3e104fbe1117c917c10a368089ba08aca2e06012 (diff)
downloadllvm-39d3283a08ba0d687eba3f74ecb85d60b7c71355.zip
llvm-39d3283a08ba0d687eba3f74ecb85d60b7c71355.tar.gz
llvm-39d3283a08ba0d687eba3f74ecb85d60b7c71355.tar.bz2
[OpenMP][CUDA] Avoid calling `cuCtxSetCurrent` redundantly
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. Reviewed By: jdoerfert Differential Revision: https://reviews.llvm.org/D121322
Diffstat (limited to 'llvm/unittests/Support/CommandLineTest.cpp')
0 files changed, 0 insertions, 0 deletions