Avoid deprecation warning in NVHPC (#1459)

* Avoid deprecation warning in NVHPC

* Use more general NVCC identification macro
This commit is contained in:
Cezary Skrzyński 2022-08-08 16:57:48 +02:00 committed by GitHub
parent 974cd5a5c5
commit a476d0fd8e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -231,7 +231,7 @@ BENCHMARK(BM_test)->Unit(benchmark::kMillisecond);
#define BENCHMARK_INTERNAL_TOSTRING(x) BENCHMARK_INTERNAL_TOSTRING2(x)
// clang-format off
#if defined(__GNUC__) || defined(__clang__)
#if defined(__GNUC__) && !defined(__NVCC__) || defined(__clang__)
#define BENCHMARK_BUILTIN_EXPECT(x, y) __builtin_expect(x, y)
#define BENCHMARK_DEPRECATED_MSG(msg) __attribute__((deprecated(msg)))
#define BENCHMARK_DISABLE_DEPRECATED_WARNING \

View File

@ -182,7 +182,7 @@ State::State(IterationCount max_iters, const std::vector<int64_t>& ranges,
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Winvalid-offsetof"
#endif
#if defined(__CUDACC__)
#if defined(__NVCC__)
#pragma nv_diagnostic push
#pragma nv_diag_suppress 1427
#endif
@ -196,7 +196,7 @@ State::State(IterationCount max_iters, const std::vector<int64_t>& ranges,
#elif defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
#if defined(__CUDACC__)
#if defined(__NVCC__)
#pragma nv_diagnostic pop
#endif
}