diff --git a/include/benchmark/benchmark.h b/include/benchmark/benchmark.h index f0152e5a..0eddc540 100644 --- a/include/benchmark/benchmark.h +++ b/include/benchmark/benchmark.h @@ -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 \ diff --git a/src/benchmark.cc b/src/benchmark.cc index e43b28d0..f18c3081 100644 --- a/src/benchmark.cc +++ b/src/benchmark.cc @@ -182,7 +182,7 @@ State::State(IterationCount max_iters, const std::vector& 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& ranges, #elif defined(__GNUC__) #pragma GCC diagnostic pop #endif -#if defined(__CUDACC__) +#if defined(__NVCC__) #pragma nv_diagnostic pop #endif }