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

Ye Luo via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Tue Jul 7 06:13:49 PDT 2020


ye-luo marked an inline comment as done.
ye-luo added inline comments.


================
Comment at: openmp/libomptarget/plugins/cuda/src/rtl.cpp:420
+    unsigned int FormerPrimaryCtxFlags;
+    int FormerPrimaryCtxIsActive;
+    Err = cuDevicePrimaryCtxGetState(Device, &FormerPrimaryCtxFlags,
----------------
jdoerfert wrote:
> 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.
Initialized them with 0


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

https://reviews.llvm.org/D82718





More information about the Openmp-commits mailing list