mirror of
https://github.com/NVIDIA/nvbench.git
synced 2026-03-14 20:27:24 +00:00
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:
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user