// Copyright Advanced Micro Devices, Inc., or its affiliates. // SPDX-License-Identifier: MIT #include #include #include using namespace rocRoller; namespace CommandTest { TEST_CASE("Command equality", "[command]") { SECTION("GEMM/TileAdd") { auto example1 = *rocRollerTest::Graphs::GEMM(DataType::Float).getCommand(); auto example2 = *rocRollerTest::Graphs::GEMM(DataType::Float).getCommand(); auto example3 = *rocRollerTest::Graphs::GEMM(DataType::Half).getCommand(); auto example4 = *rocRollerTest::Graphs::TileDoubleAdd().getCommand(); CHECK(example1 == example2); CHECK(example1 != example3); CHECK(example1 != example4); CHECK(example2 != example3); CHECK(example2 != example4); CHECK(example3 != example4); } } TEST_CASE("Command serialization", "[command]") { SECTION("GEMM") { auto example = rocRollerTest::Graphs::GEMM(DataType::Float); auto command0 = example.getCommand(); auto yaml = Command::toYAML(*command0); auto command1 = Command::fromYAML(yaml); CHECK((*command0) == command1); } SECTION("TileDoubleAdd") { auto example = rocRollerTest::Graphs::TileDoubleAdd(); auto command0 = example.getCommand(); auto yaml = Command::toYAML(*command0); auto command1 = Command::fromYAML(yaml); CHECK((*command0) == command1); } } }