Enable more warning flags.

- /W4 on MSVC
- -Wall -Wextra + others on gcc/clang
- New NVBench_ENABLE_WERROR option to toggle "warnings as errors"
- Mark the nlohmann_json library as IMPORTED to switch to system includes
- Rename nvbench_main -> nvbench.main to follow target name conventions
- Explicitly suppress some cudafe warnings when compiling templates in
  nlohmann_json headers.
- Explicitly suppress some warnings from Thrust headers.
- Various fixes for warnings exposed by new flags.
- Disable CUPTI on CTK < 11.3 (See #52).
This commit is contained in:
Allison Vacanti
2021-12-18 12:28:58 -05:00
parent 15edfe2eee
commit 5d70492714
18 changed files with 265 additions and 134 deletions

View File

@@ -138,7 +138,7 @@ void test_type_configs()
lots_of_types_bench bench;
bench.set_type_axes_names({"Integer", "Float", "Other"});
ASSERT(bench.num_type_configs == 16);
static_assert(bench.num_type_configs == 16);
std::size_t idx = 0;
fmt::memory_buffer buffer;

View File

@@ -64,11 +64,12 @@ void test_fp_tolerance()
// Make sure that the range is padded a bit for floats to prevent rounding
// errors from skipping `end`. This test will trigger failures without
// the padding.
const nvbench::float32_t start = 0.1;
const nvbench::float32_t stride = 1e-4;
const nvbench::float32_t start = 0.1f;
const nvbench::float32_t stride = 1e-4f;
for (std::size_t size = 1; size < 1024; ++size)
{
const nvbench::float32_t end = start + stride * (size - 1);
const nvbench::float32_t end =
start + stride * static_cast<nvbench::float32_t>(size - 1);
ASSERT_MSG(nvbench::range(start, end, stride).size() == size,
"size={}", size);
}