From 42d99a5753792dd6d0d15484a1cf8980e7fac545 Mon Sep 17 00:00:00 2001 From: Georgii Evtushenko Date: Thu, 4 Apr 2024 09:53:30 -0700 Subject: [PATCH] Fix MSVC (#158) * Fix MSVC * Revert change of source list name --- examples/CMakeLists.txt | 2 ++ examples/axes.cu | 2 +- examples/enums.cu | 2 +- nvbench/detail/statistics.cuh | 5 +++++ nvbench/stopping_criterion.cuh | 2 ++ 5 files changed, 11 insertions(+), 2 deletions(-) diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index d1a5e14..8a87267 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -33,9 +33,11 @@ endforeach() set(thrust_examples auto_throughput axes + custom_criterion exec_tag_sync exec_tag_timer skip + stream throughput ) foreach (example IN LISTS thrust_examples) diff --git a/examples/axes.cu b/examples/axes.cu index b8c2115..c1c0f2b 100644 --- a/examples/axes.cu +++ b/examples/axes.cu @@ -133,7 +133,7 @@ void copy_type_conversion_sweep(nvbench::state &state, nvbench::type_list) { // Optional: Skip narrowing conversions. - if (sizeof(InputType) > sizeof(OutputType)) + if constexpr(sizeof(InputType) > sizeof(OutputType)) { state.skip("Narrowing conversion: sizeof(InputType) > sizeof(OutputType)."); return; diff --git a/examples/enums.cu b/examples/enums.cu index c14c2d4..fa149ac 100644 --- a/examples/enums.cu +++ b/examples/enums.cu @@ -91,7 +91,7 @@ NVBENCH_BENCH(runtime_enum_sweep_string) // ``` void runtime_enum_sweep_int64(nvbench::state &state) { - const auto enum_value = static_cast(state.get_int64("MyEnum")); + [[maybe_unused]] const auto enum_value = static_cast(state.get_int64("MyEnum")); // Do stuff with enum_value. // Create inputs, etc, configure runtime kernel parameters, etc. diff --git a/nvbench/detail/statistics.cuh b/nvbench/detail/statistics.cuh index 311a20d..522b4f2 100644 --- a/nvbench/detail/statistics.cuh +++ b/nvbench/detail/statistics.cuh @@ -26,9 +26,14 @@ #include #include #include +#include #include +#ifndef M_PI + #define M_PI 3.14159265358979323846 +#endif + namespace nvbench::detail::statistics { diff --git a/nvbench/stopping_criterion.cuh b/nvbench/stopping_criterion.cuh index 36fb6eb..006a699 100644 --- a/nvbench/stopping_criterion.cuh +++ b/nvbench/stopping_criterion.cuh @@ -86,6 +86,8 @@ public: , m_params{std::move(params)} {} + virtual ~stopping_criterion_base() = default; + [[nodiscard]] const std::string &get_name() const { return m_name; } [[nodiscard]] const criterion_params &get_params() const { return m_params; }