Skip to content

Commit a75f933

Browse files
authored
Merge pull request #11465 from edgargabriel/topic/rocm-silence-warnings
accelerator/rocm: silence warnings from header file
2 parents e0bf553 + d0743f9 commit a75f933

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

opal/mca/accelerator/rocm/accelerator_rocm.h

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2022 Advanced Micro Devices, Inc. All rights reserved.
2+
* Copyright (c) 2022-2023 Advanced Micro Devices, Inc. All rights reserved.
33
*
44
* $COPYRIGHT$
55
*
@@ -14,8 +14,24 @@
1414
#include "opal_config.h"
1515

1616
#include <stdio.h>
17+
18+
/* Not interested in warnings generated in hip_runtime_api.h */
19+
#pragma GCC diagnostic push
20+
/* Clang won't quietly accept "-pedantic", but GCC versions older than ~4.8
21+
* won't quietly accept "-Wpedanic". The whole "#pragma GCC diagnostic ..."
22+
* facility only was added to GCC as of version 4.6. */
23+
#if defined(__clang__) || (defined(__GNUC__) && __GNUC__ >= 6)
24+
# pragma GCC diagnostic ignored "-Wpedantic"
25+
# pragma GCC diagnostic ignored "-Wundef"
26+
# pragma GCC diagnostic ignored "-Wstrict-prototypes"
27+
#else
28+
# pragma GCC diagnostic ignored "-pedantic"
29+
#endif
1730
#include <hip/hip_runtime_api.h>
1831
#include <hip/hip_version.h>
32+
/* Restore warnings to original state */
33+
#pragma GCC diagnostic pop
34+
1935

2036
#include "opal/mca/accelerator/accelerator.h"
2137

0 commit comments

Comments
 (0)