Fixes for multidevice/gcc.

- Allow devices to be cleared during benchmark definition.
- Fix various demangling bugs.
This commit is contained in:
Allison Vacanti
2021-02-15 21:26:21 -05:00
parent 8897490a6d
commit bb871094c3
7 changed files with 41 additions and 16 deletions

View File

@@ -222,6 +222,7 @@ void test_run()
// More exhaustive testing is in runner.cu. This just tests that the
// runner is called.
no_types_bench bench;
bench.set_devices(std::vector<int>{});
ASSERT(bench.get_states().empty());
bench.run();
ASSERT(bench.get_states().size() == 1);
@@ -230,6 +231,7 @@ void test_run()
void test_clone()
{
lots_of_types_bench bench;
bench.set_devices(std::vector<int>{});
bench.set_type_axes_names({"Integer", "Float", "Other"});
bench.add_string_axis("Strings", {"string a", "string b", "string c"});
bench.add_int64_power_of_two_axis("I64 POT Axis", {10, 20});

View File

@@ -10,7 +10,7 @@
//==============================================================================
// Declare a couple benchmarks for testing:
void DummyBench(nvbench::state &state) { state.skip("Skipping for testing."); }
NVBENCH_CREATE(DummyBench);
NVBENCH_CREATE(DummyBench).clear_devices();
using Ts = nvbench::type_list<void, nvbench::int8_t, nvbench::uint8_t>;
using Us = nvbench::type_list<bool, nvbench::float32_t, nvbench::float64_t>;
@@ -25,7 +25,8 @@ NVBENCH_CREATE_TEMPLATE(TestBench, NVBENCH_TYPE_AXES(Ts, Us))
.add_int64_axis("Ints", {42})
.add_int64_power_of_two_axis("PO2s", {3})
.add_float64_axis("Floats", {3.14})
.add_string_axis("Strings", {"S1"});
.add_string_axis("Strings", {"S1"})
.clear_devices();
//==============================================================================
namespace

View File

@@ -69,6 +69,7 @@ void test_empty()
using runner_type = nvbench::runner<benchmark_type>;
benchmark_type bench;
bench.set_devices(std::vector<int>{});
runner_type runner{bench};
runner.generate_states();
@@ -85,6 +86,7 @@ void test_non_types()
using runner_type = nvbench::runner<benchmark_type>;
benchmark_type bench;
bench.set_devices(std::vector<int>{});
bench.add_int64_axis("Int", {1, 2, 3});
bench.add_float64_axis("Float", {11.0, 12.0, 13.0});
bench.add_string_axis("String", {"One", "Two", "Three"});