mirror of
https://github.com/NVIDIA/nvbench.git
synced 2026-04-28 10:41:14 +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:
@@ -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