Skip to content

Commit b6ac26f

Browse files
committed
[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.
1 parent 820a846 commit b6ac26f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

mlir/lib/ExecutionEngine/CudaRuntimeWrappers.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@
3737
fprintf(stderr, "'%s' failed with '%s'\n", #expr, name); \
3838
}(expr)
3939

40+
#pragma clang diagnostic push
41+
#pragma clang diagnostic ignored "-Wglobal-constructors"
4042
// Static reference to CUDA primary context for device ordinal 0.
4143
static CUcontext Context = [] {
4244
CUDA_REPORT_IF_ERROR(cuInit(/*flags=*/0));
@@ -46,6 +48,7 @@ static CUcontext Context = [] {
4648
CUDA_REPORT_IF_ERROR(cuDevicePrimaryCtxRetain(&context, device));
4749
return context;
4850
}();
51+
#pragma clang diagnostic pop
4952

5053
// Sets the `Context` for the duration of the instance and restores the previous
5154
// context on destruction.

0 commit comments

Comments
 (0)