[Mlir-commits] [mlir] b6ac26f - [mlir] Silence -Wglobal-constructors error in CudaRuntimeWrapper.cpp

Christian Sigg llvmlistbot at llvm.org
Wed Mar 3 04:49:11 PST 2021


Author: Christian Sigg
Date: 2021-03-03T13:48:03+01:00
New Revision: b6ac26fce5972f24f280d0780d5b713d900829ff

URL: https://github.com/llvm/llvm-project/commit/b6ac26fce5972f24f280d0780d5b713d900829ff
DIFF: https://github.com/llvm/llvm-project/commit/b6ac26fce5972f24f280d0780d5b713d900829ff.diff

LOG: [mlir] Silence -Wglobal-constructors error in CudaRuntimeWrapper.cpp

Until I have a better solution with dynamic initialization, to get
the nvidia build bot green again.

Added: 
    

Modified: 
    mlir/lib/ExecutionEngine/CudaRuntimeWrappers.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/ExecutionEngine/CudaRuntimeWrappers.cpp b/mlir/lib/ExecutionEngine/CudaRuntimeWrappers.cpp
index 09df52f2aae2..8afb80e92e23 100644
--- a/mlir/lib/ExecutionEngine/CudaRuntimeWrappers.cpp
+++ b/mlir/lib/ExecutionEngine/CudaRuntimeWrappers.cpp
@@ -37,6 +37,8 @@
     fprintf(stderr, "'%s' failed with '%s'\n", #expr, name);                   \
   }(expr)
 
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wglobal-constructors"
 // Static reference to CUDA primary context for device ordinal 0.
 static CUcontext Context = [] {
   CUDA_REPORT_IF_ERROR(cuInit(/*flags=*/0));
@@ -46,6 +48,7 @@ static CUcontext Context = [] {
   CUDA_REPORT_IF_ERROR(cuDevicePrimaryCtxRetain(&context, device));
   return context;
 }();
+#pragma clang diagnostic pop
 
 // Sets the `Context` for the duration of the instance and restores the previous
 // context on destruction.


        


More information about the Mlir-commits mailing list