[Openmp-commits] [PATCH] D82718: [OpenMP] Use primary context in CUDA plugin

Johannes Doerfert via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Tue Jul 7 05:10:18 PDT 2020


jdoerfert added inline comments.


================
Comment at: openmp/libomptarget/plugins/cuda/src/rtl.cpp:420
+    unsigned int FormerPrimaryCtxFlags;
+    int FormerPrimaryCtxIsActive;
+    Err = cuDevicePrimaryCtxGetState(Device, &FormerPrimaryCtxFlags,
----------------
ye-luo wrote:
> jdoerfert wrote:
> > We should initialize these, I never trust runtime calls to do that for some reason.
> Apart from trusting the runtime calls, I don't see any fallback/default value makes sense. There are no "unknown" flags mentioned in the documentation. We do check returned status of these runtime calls. It should be safe.
Anything that is not an undefined value, which easily results in non-deterministic UB, is fine with me. Pick 0 for both.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D82718/new/

https://reviews.llvm.org/D82718





More information about the Openmp-commits mailing list