[Openmp-commits] [PATCH] D95155: [libomptarget] Build cuda plugin without cuda installed locally

Johannes Doerfert via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Thu Jan 21 21:36:40 PST 2021


jdoerfert added inline comments.


================
Comment at: openmp/libomptarget/plugins/cuda/dynamic_cuda/cuda.cpp:90
+  return dlwrap_cuInit(arg);
+}
----------------
I would feel better if we 
1) use some mechanism to avoid racing on the `checkForCUDA` call, e.g., call once and a boolean global as in D95104.
2) Don't overload cuInit but instead call it from the plugin constructor, or make it a constructor. 
If 2) has inherent benefits we cannot get any other way, I guess we can keep it. I'm worried it might clash with a cuda otherwise linked into the application or confuse people, or something else bad.


================
Comment at: openmp/libomptarget/plugins/cuda/dynamic_cuda/cuda.h:102
+CUresult cuMemcpyPeerAsync(CUdeviceptr, CUcontext, CUdeviceptr, CUcontext,
+                           size_t, CUstream);
+
----------------
@tra suggested to name the declarations as they are actually named, e.g., _v2. I don't have strong feelings either way, this is kinda messy and weird no matter how we name them.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D95155



More information about the Openmp-commits mailing list