Commit b8461f3f authored by Robert Kimball's avatar Robert Kimball

basic concept of generated backend test working

parent 4ab74ea4
......@@ -26,7 +26,6 @@ set (SRC
build_graph.cpp
eigen.cpp
element_type.cpp
execute.cpp
input_output_assign.cpp
main.cpp
op.cpp
......@@ -42,6 +41,12 @@ set (SRC
uuid.cpp
)
set(BACKEND_NAME "NGVM")
configure_file(backend_test.in.cpp backend_test_NGVM.cpp)
set(SRC ${SRC} ${CMAKE_CURRENT_BINARY_DIR}/backend_test_NGVM.cpp)
message(STATUS "SRC set to '${SRC}'")
if(MKLDNN_INCLUDE_DIR)
include_directories(SYSTEM ${MKLDNN_INCLUDE_DIR})
link_directories(${MKLDNN_LIB_DIR})
......@@ -50,7 +55,9 @@ endif()
if(LLVM_INCLUDE_DIR)
include_directories(SYSTEM ${LLVM_INCLUDE_DIR})
set(SRC ${SRC} codegen.cpp cpu.cpp)
set(BACKEND_NAME "CPU")
configure_file(backend_test.in.cpp backend_test_CPU.cpp)
set(SRC ${SRC} ${CMAKE_CURRENT_BINARY_DIR}/backend_test_CPU.cpp)
endif()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
......
......@@ -21,7 +21,7 @@
using namespace std;
using namespace ngraph;
TEST(cpu, ab)
TEST(${BACKEND_NAME}, ab)
{
auto shape = Shape{2, 2};
auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape);
......@@ -29,7 +29,7 @@ TEST(cpu, ab)
auto rt = make_shared<TensorViewType>(element::Float32::element_type(), shape);
auto f = make_shared<Function>(A + B, rt, op::Parameters{A, B});
auto manager = runtime::Manager::get("CPU");
auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f);
auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external);
......@@ -48,7 +48,7 @@ TEST(cpu, ab)
ASSERT_EQ((vector<float>{6, 8, 10, 12}), result->get_vector());
}
TEST(cpu, abc)
TEST(${BACKEND_NAME}, abc)
{
auto shape = Shape{2, 2};
auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape);
......@@ -57,7 +57,7 @@ TEST(cpu, abc)
auto rt = make_shared<TensorViewType>(element::Float32::element_type(), shape);
auto f = make_shared<Function>((A + B) * C, rt, op::Parameters{A, B, C});
auto manager = runtime::Manager::get("CPU");
auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f);
auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external);
......@@ -81,7 +81,7 @@ TEST(cpu, abc)
ASSERT_EQ((vector<float>{50, 72, 98, 128}), result->get_vector());
}
TEST(cpu, abc_int64)
TEST(${BACKEND_NAME}, abc_int64)
{
auto shape = Shape{2, 2};
auto A = make_shared<op::Parameter>(element::Int64::element_type(), shape);
......@@ -90,7 +90,7 @@ TEST(cpu, abc_int64)
auto rt = make_shared<TensorViewType>(element::Int64::element_type(), shape);
auto f = make_shared<Function>((A + B) * C, rt, op::Parameters{A, B, C});
auto manager = runtime::Manager::get("CPU");
auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f);
auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external);
......@@ -115,7 +115,7 @@ TEST(cpu, abc_int64)
}
// Same as abc, but using tuples for input and output
TEST(cpu, abc_tuple)
TEST(${BACKEND_NAME}, abc_tuple)
{
auto shape = Shape{2, 2};
......@@ -130,7 +130,7 @@ TEST(cpu, abc_tuple)
auto f = make_shared<Function>(
make_shared<op::Tuple>(Nodes{(A + B) * C}), tensor_view_type, op::Parameters{ABC});
auto manager = runtime::Manager::get("CPU");
auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f);
auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external);
......@@ -159,7 +159,7 @@ TEST(cpu, abc_tuple)
}
// Same as abc, but using tuples for input and output
TEST(cpu, abc_tuple_int64)
TEST(${BACKEND_NAME}, abc_tuple_int64)
{
auto shape = Shape{2, 2};
......@@ -174,7 +174,7 @@ TEST(cpu, abc_tuple_int64)
auto f = make_shared<Function>(
make_shared<op::Tuple>(Nodes{(A + B) * C}), tensor_view_type, op::Parameters{ABC});
auto manager = runtime::Manager::get("CPU");
auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f);
auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external);
......@@ -203,7 +203,7 @@ TEST(cpu, abc_tuple_int64)
}
// Multiple retrive values
TEST(cpu, tuple_result)
TEST(${BACKEND_NAME}, tuple_result)
{
auto shape = Shape{2, 2};
auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape);
......@@ -218,7 +218,7 @@ TEST(cpu, tuple_result)
auto f = make_shared<Function>(
make_shared<op::Tuple>(Nodes{A_add_B, A_add_B_mul_C}), rt, op::Parameters{A, B, C});
auto manager = runtime::Manager::get("CPU");
auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f);
auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external);
......@@ -240,14 +240,14 @@ TEST(cpu, tuple_result)
ASSERT_EQ((vector<float>{54, 80, 110, 144}), r1->get_vector());
}
TEST(cpu, abs)
TEST(${BACKEND_NAME}, abs)
{
auto shape = Shape{2, 2};
auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape);
auto result_type = make_shared<TensorViewType>(element::Float32::element_type(), shape);
auto f = make_shared<Function>(make_shared<op::Abs>(A), result_type, op::Parameters{A});
auto manager = runtime::Manager::get("CPU");
auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f);
auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external);
......@@ -261,7 +261,7 @@ TEST(cpu, abs)
ASSERT_EQ((vector<float>{1, 2, 0, 4.8f}), result->get_vector());
}
TEST(cpu, concat_matrix_colwise)
TEST(${BACKEND_NAME}, concat_matrix_colwise)
{
auto shape_a = Shape{2, 2};
auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape_a);
......@@ -274,7 +274,7 @@ TEST(cpu, concat_matrix_colwise)
auto f = make_shared<Function>(
make_shared<op::Concat>(Nodes{A, B, C}, 1), rt, op::Parameters{A, B, C});
auto manager = runtime::Manager::get("CPU");
auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f);
auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external);
......@@ -293,7 +293,7 @@ TEST(cpu, concat_matrix_colwise)
result->get_vector());
}
TEST(cpu, concat_matrix_rowwise)
TEST(${BACKEND_NAME}, concat_matrix_rowwise)
{
auto shape_a = Shape{2, 2};
auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape_a);
......@@ -306,7 +306,7 @@ TEST(cpu, concat_matrix_rowwise)
auto f = make_shared<Function>(
make_shared<op::Concat>(Nodes{A, B, C}, 0), rt, op::Parameters{A, B, C});
auto manager = runtime::Manager::get("CPU");
auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f);
auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external);
......@@ -325,7 +325,7 @@ TEST(cpu, concat_matrix_rowwise)
result->get_vector());
}
TEST(cpu, concat_matrix_int64)
TEST(${BACKEND_NAME}, concat_matrix_int64)
{
auto shape_a = Shape{2, 2};
auto A = make_shared<op::Parameter>(element::Int64::element_type(), shape_a);
......@@ -338,7 +338,7 @@ TEST(cpu, concat_matrix_int64)
auto f = make_shared<Function>(
make_shared<op::Concat>(Nodes{A, B, C}, 0), rt, op::Parameters{A, B, C});
auto manager = runtime::Manager::get("CPU");
auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f);
auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external);
......@@ -357,7 +357,7 @@ TEST(cpu, concat_matrix_int64)
result->get_vector());
}
TEST(cpu, concat_vector)
TEST(${BACKEND_NAME}, concat_vector)
{
auto shape_a = Shape{4};
auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape_a);
......@@ -370,7 +370,7 @@ TEST(cpu, concat_vector)
auto f = make_shared<Function>(
make_shared<op::Concat>(Nodes{A, B, C}, 0), rt, op::Parameters{A, B, C});
auto manager = runtime::Manager::get("CPU");
auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f);
auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external);
......@@ -388,9 +388,9 @@ TEST(cpu, concat_vector)
ASSERT_EQ((vector<float>{2, 4, 8, 16, 1, 2, 4, 8, 16, 32, 18, 19}), result->get_vector());
}
TEST(cpu, divide)
TEST(${BACKEND_NAME}, divide)
{
auto manager = runtime::Manager::get("CPU");
auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto backend = manager->allocate_backend();
auto shape = Shape{2, 2};
......@@ -418,7 +418,7 @@ TEST(cpu, divide)
ASSERT_EQ((vector<float>{2, 2, 2, 2}), result->get_vector());
}
TEST(cpu, equal)
TEST(${BACKEND_NAME}, equal)
{
auto shape = Shape{2, 2, 2};
auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape);
......@@ -426,7 +426,7 @@ TEST(cpu, equal)
auto rt = make_shared<TensorViewType>(element::Bool::element_type(), shape);
auto f = make_shared<Function>(make_shared<op::Equal>(A, B), rt, op::Parameters{A, B});
auto manager = runtime::Manager::get("CPU");
auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f);
auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external);
......@@ -442,7 +442,7 @@ TEST(cpu, equal)
ASSERT_EQ((vector<char>{1, 1, 0, 0, 0, 1, 1, 0}), result->get_vector());
}
TEST(cpu, dot_0_0)
TEST(${BACKEND_NAME}, dot_0_0)
{
auto shape = Shape{0};
auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape);
......@@ -451,7 +451,7 @@ TEST(cpu, dot_0_0)
auto rt = make_shared<TensorViewType>(element::Float32::element_type(), Shape{});
auto f = make_shared<Function>(make_shared<op::Dot>(A, B), rt, op::Parameters{A, B});
auto manager = runtime::Manager::get("CPU");
auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f);
auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external);
......@@ -467,13 +467,13 @@ TEST(cpu, dot_0_0)
ASSERT_EQ((vector<float>{0}), result->get_vector());
}
TEST(cpu, dot_matrix_2x0_0x2)
TEST(${BACKEND_NAME}, dot_matrix_2x0_0x2)
{
auto shape_a = Shape{2, 0};
auto shape_b = Shape{0, 2};
auto shape_r = Shape{2, 2};
auto manager = runtime::Manager::get("CPU");
auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto backend = manager->allocate_backend();
auto make_external = [&]() {
......@@ -499,7 +499,7 @@ TEST(cpu, dot_matrix_2x0_0x2)
ASSERT_EQ((vector<float>{0, 0, 0, 0}), result->get_vector());
}
TEST(cpu, dot_matrix_0x2_2x0)
TEST(${BACKEND_NAME}, dot_matrix_0x2_2x0)
{
auto shape_a = Shape{0, 2};
auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape_a);
......@@ -509,7 +509,7 @@ TEST(cpu, dot_matrix_0x2_2x0)
auto rt = make_shared<TensorViewType>(element::Float32::element_type(), shape_r);
auto f = make_shared<Function>(make_shared<op::Dot>(A, B), rt, op::Parameters{A, B});
auto manager = runtime::Manager::get("CPU");
auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f);
auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external);
......@@ -525,7 +525,7 @@ TEST(cpu, dot_matrix_0x2_2x0)
ASSERT_EQ((vector<float>{}), result->get_vector());
}
TEST(cpu, dot_matrix_3x2_2x0)
TEST(${BACKEND_NAME}, dot_matrix_3x2_2x0)
{
auto shape_a = Shape{3, 2};
auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape_a);
......@@ -535,7 +535,7 @@ TEST(cpu, dot_matrix_3x2_2x0)
auto rt = make_shared<TensorViewType>(element::Float32::element_type(), shape_r);
auto f = make_shared<Function>(make_shared<op::Dot>(A, B), rt, op::Parameters{A, B});
auto manager = runtime::Manager::get("CPU");
auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f);
auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external);
......@@ -551,7 +551,7 @@ TEST(cpu, dot_matrix_3x2_2x0)
ASSERT_EQ((vector<float>{}), result->get_vector());
}
TEST(cpu, dot_scalar_0x2)
TEST(${BACKEND_NAME}, dot_scalar_0x2)
{
auto shape_a = Shape{};
auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape_a);
......@@ -561,7 +561,7 @@ TEST(cpu, dot_scalar_0x2)
auto rt = make_shared<TensorViewType>(element::Float32::element_type(), shape_r);
auto f = make_shared<Function>(make_shared<op::Dot>(A, B), rt, op::Parameters{A, B});
auto manager = runtime::Manager::get("CPU");
auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f);
auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external);
......@@ -577,7 +577,7 @@ TEST(cpu, dot_scalar_0x2)
ASSERT_EQ((vector<float>{}), result->get_vector());
}
TEST(cpu, dot_2x0_0)
TEST(${BACKEND_NAME}, dot_2x0_0)
{
auto shape_a = Shape{2, 0};
auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape_a);
......@@ -587,7 +587,7 @@ TEST(cpu, dot_2x0_0)
auto rt = make_shared<TensorViewType>(element::Float32::element_type(), shape_r);
auto f = make_shared<Function>(make_shared<op::Dot>(A, B), rt, op::Parameters{A, B});
auto manager = runtime::Manager::get("CPU");
auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f);
auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external);
......@@ -603,7 +603,7 @@ TEST(cpu, dot_2x0_0)
ASSERT_EQ((vector<float>{0, 0}), result->get_vector());
}
TEST(cpu, dot1d)
TEST(${BACKEND_NAME}, dot1d)
{
auto shape = Shape{4};
auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape);
......@@ -612,7 +612,7 @@ TEST(cpu, dot1d)
auto rt = make_shared<TensorViewType>(element::Float32::element_type(), Shape{});
auto f = make_shared<Function>(make_shared<op::Dot>(A, B), rt, op::Parameters{A, B});
auto manager = runtime::Manager::get("CPU");
auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f);
auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external);
......@@ -628,7 +628,7 @@ TEST(cpu, dot1d)
ASSERT_EQ((vector<float>{170}), result->get_vector());
}
TEST(cpu, dot2d)
TEST(${BACKEND_NAME}, dot2d)
{
auto shape = Shape{2, 2};
auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape);
......@@ -637,7 +637,7 @@ TEST(cpu, dot2d)
auto rt = make_shared<TensorViewType>(element::Float32::element_type(), shape);
auto f = make_shared<Function>(make_shared<op::Dot>(A, B), rt, op::Parameters{A, B});
auto manager = runtime::Manager::get("CPU");
auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f);
auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external);
......@@ -653,7 +653,7 @@ TEST(cpu, dot2d)
ASSERT_EQ((vector<float>{19, 22, 43, 50}), result->get_vector());
}
TEST(cpu, dot_scalar_tensor_arg0)
TEST(${BACKEND_NAME}, dot_scalar_tensor_arg0)
{
auto shape_a = Shape{};
auto shape_b = Shape{2, 2, 2};
......@@ -662,7 +662,7 @@ TEST(cpu, dot_scalar_tensor_arg0)
auto rt = make_shared<TensorViewType>(element::Float32::element_type(), shape_b);
auto f = make_shared<Function>(make_shared<op::Dot>(A, B), rt, op::Parameters{A, B});
auto manager = runtime::Manager::get("CPU");
auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f);
auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external);
......@@ -678,7 +678,7 @@ TEST(cpu, dot_scalar_tensor_arg0)
ASSERT_EQ((vector<float>{6, 12, 18, 24, 30, 36, 42, 48}), result->get_vector());
}
TEST(cpu, dot_scalar_tensor_arg1)
TEST(${BACKEND_NAME}, dot_scalar_tensor_arg1)
{
auto shape_a = Shape{2, 2, 2};
auto shape_b = Shape{};
......@@ -687,7 +687,7 @@ TEST(cpu, dot_scalar_tensor_arg1)
auto rt = make_shared<TensorViewType>(element::Float32::element_type(), shape_a);
auto f = make_shared<Function>(make_shared<op::Dot>(A, B), rt, op::Parameters{A, B});
auto manager = runtime::Manager::get("CPU");
auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f);
auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external);
......@@ -703,7 +703,7 @@ TEST(cpu, dot_scalar_tensor_arg1)
ASSERT_EQ((vector<float>{6, 12, 18, 24, 30, 36, 42, 48}), result->get_vector());
}
TEST(cpu, dot_scalar_scalar)
TEST(${BACKEND_NAME}, dot_scalar_scalar)
{
auto shape = Shape{};
auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape);
......@@ -711,7 +711,7 @@ TEST(cpu, dot_scalar_scalar)
auto rt = make_shared<TensorViewType>(element::Float32::element_type(), shape);
auto f = make_shared<Function>(make_shared<op::Dot>(A, B), rt, op::Parameters{A, B});
auto manager = runtime::Manager::get("CPU");
auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f);
auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external);
......@@ -727,7 +727,7 @@ TEST(cpu, dot_scalar_scalar)
ASSERT_EQ((vector<float>{48}), result->get_vector());
}
TEST(cpu, dot_matrix_vector)
TEST(${BACKEND_NAME}, dot_matrix_vector)
{
auto shape_a = Shape{4, 4};
auto shape_b = Shape{4};
......@@ -737,7 +737,7 @@ TEST(cpu, dot_matrix_vector)
auto f = make_shared<Function>(make_shared<op::Dot>(A, B), rt, op::Parameters{A, B});
auto shape_r = Shape{4};
auto manager = runtime::Manager::get("CPU");
auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f);
auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external);
......@@ -753,7 +753,7 @@ TEST(cpu, dot_matrix_vector)
ASSERT_EQ((vector<float>{190, 486, 782, 1078}), result->get_vector());
}
TEST(cpu, dot_matrix_vector_int64)
TEST(${BACKEND_NAME}, dot_matrix_vector_int64)
{
auto shape_a = Shape{4, 4};
auto shape_b = Shape{4};
......@@ -763,7 +763,7 @@ TEST(cpu, dot_matrix_vector_int64)
auto f = make_shared<Function>(make_shared<op::Dot>(A, B), rt, op::Parameters{A, B});
auto shape_r = Shape{4};
auto manager = runtime::Manager::get("CPU");
auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f);
auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external);
......@@ -779,7 +779,7 @@ TEST(cpu, dot_matrix_vector_int64)
ASSERT_EQ((vector<element::Int64::type>{190, 486, 782, 1078}), result->get_vector());
}
TEST(cpu, greater)
TEST(${BACKEND_NAME}, greater)
{
auto shape = Shape{2, 2, 2};
auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape);
......@@ -787,7 +787,7 @@ TEST(cpu, greater)
auto rt = make_shared<TensorViewType>(element::Bool::element_type(), shape);
auto f = make_shared<Function>(make_shared<op::Greater>(A, B), rt, op::Parameters{A, B});
auto manager = runtime::Manager::get("CPU");
auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f);
auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external);
......@@ -803,7 +803,7 @@ TEST(cpu, greater)
ASSERT_EQ((vector<char>{0, 1, 0, 1, 0, 1, 1, 0}), result->get_vector());
}
TEST(cpu, greatereq)
TEST(${BACKEND_NAME}, greatereq)
{
auto shape = Shape{2, 2, 2};
auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape);
......@@ -811,7 +811,7 @@ TEST(cpu, greatereq)
auto rt = make_shared<TensorViewType>(element::Bool::element_type(), shape);
auto f = make_shared<Function>(make_shared<op::GreaterEq>(A, B), rt, op::Parameters{A, B});
auto manager = runtime::Manager::get("CPU");
auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f);
auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external);
......@@ -827,7 +827,7 @@ TEST(cpu, greatereq)
ASSERT_EQ((vector<char>{1, 1, 1, 1, 0, 1, 1, 0}), result->get_vector());
}
TEST(cpu, less)
TEST(${BACKEND_NAME}, less)
{
auto shape = Shape{2, 2, 2};
auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape);
......@@ -835,7 +835,7 @@ TEST(cpu, less)
auto rt = make_shared<TensorViewType>(element::Bool::element_type(), shape);
auto f = make_shared<Function>(make_shared<op::Less>(A, B), rt, op::Parameters{A, B});
auto manager = runtime::Manager::get("CPU");
auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f);
auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external);
......@@ -851,7 +851,7 @@ TEST(cpu, less)
ASSERT_EQ((vector<char>{0, 0, 1, 0, 1, 0, 0, 1}), result->get_vector());
}
TEST(cpu, lesseq)
TEST(${BACKEND_NAME}, lesseq)
{
auto shape = Shape{2, 2, 2};
auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape);
......@@ -859,7 +859,7 @@ TEST(cpu, lesseq)
auto rt = make_shared<TensorViewType>(element::Bool::element_type(), shape);
auto f = make_shared<Function>(make_shared<op::LessEq>(A, B), rt, op::Parameters{A, B});
auto manager = runtime::Manager::get("CPU");
auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f);
auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external);
......@@ -875,14 +875,14 @@ TEST(cpu, lesseq)
ASSERT_EQ((vector<char>{1, 0, 1, 0, 1, 1, 0, 1}), result->get_vector());
}
TEST(cpu, log)
TEST(${BACKEND_NAME}, log)
{
auto shape = Shape{2, 2, 2};
auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape);
auto rt = make_shared<TensorViewType>(element::Float32::element_type(), shape);
auto f = make_shared<Function>(make_shared<op::Log>(A), rt, op::Parameters{A});
auto manager = runtime::Manager::get("CPU");
auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f);
auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external);
......@@ -901,7 +901,7 @@ TEST(cpu, log)
ASSERT_EQ(loga, result->get_vector());
}
TEST(cpu, maximum)
TEST(${BACKEND_NAME}, maximum)
{
auto shape = Shape{2, 2, 2};
auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape);
......@@ -909,7 +909,7 @@ TEST(cpu, maximum)
auto rt = make_shared<TensorViewType>(element::Float32::element_type(), shape);
auto f = make_shared<Function>(make_shared<op::Maximum>(A, B), rt, op::Parameters{A, B});
auto manager = runtime::Manager::get("CPU");
auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f);
auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external);
......@@ -925,14 +925,14 @@ TEST(cpu, maximum)
ASSERT_EQ((vector<float>{1, 8, 4, 17, 0, 0.5, 2, 1.5}), result->get_vector());
}
TEST(cpu, negative)
TEST(${BACKEND_NAME}, negative)
{
auto shape = Shape{2, 3};
auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape);
auto rt = make_shared<TensorViewType>(element::Float32::element_type(), shape);
auto f = make_shared<Function>(make_shared<op::Negative>(A), rt, op::Parameters{A});
auto manager = runtime::Manager::get("CPU");
auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f);
auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external);
......@@ -946,7 +946,7 @@ TEST(cpu, negative)
ASSERT_EQ((vector<float>{-1, 2, 0, 4.8f, -8.6f, 8.6f}), result->get_vector());
}
TEST(cpu, notequal)
TEST(${BACKEND_NAME}, notequal)
{
auto shape = Shape{2, 2, 2};
auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape);
......@@ -954,7 +954,7 @@ TEST(cpu, notequal)
auto rt = make_shared<TensorViewType>(element::Bool::element_type(), shape);
auto f = make_shared<Function>(make_shared<op::NotEqual>(A, B), rt, op::Parameters{A, B});
auto manager = runtime::Manager::get("CPU");
auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f);
auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external);
......@@ -970,7 +970,7 @@ TEST(cpu, notequal)
ASSERT_EQ((vector<char>{0, 0, 1, 1, 1, 0, 0, 1}), result->get_vector());
}
TEST(cpu, select)
TEST(${BACKEND_NAME}, select)
{
auto shape = Shape{2, 2, 2};
auto A = make_shared<op::Parameter>(element::Bool::element_type(), shape);
......@@ -979,7 +979,7 @@ TEST(cpu, select)
auto rt = make_shared<TensorViewType>(element::Float32::element_type(), shape);
auto f = make_shared<Function>(make_shared<op::Select>(A, B, C), rt, op::Parameters{A, B, C});
auto manager = runtime::Manager::get("CPU");
auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f);
auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external);
......@@ -997,7 +997,7 @@ TEST(cpu, select)
ASSERT_EQ((vector<float>{11, 2, 3, 14, 15, 6, 17, 8}), result->get_vector());
}
TEST(cpu, subtract)
TEST(${BACKEND_NAME}, subtract)
{
auto shape = Shape{2, 2};
auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape);
......@@ -1005,7 +1005,7 @@ TEST(cpu, subtract)
auto rt = make_shared<TensorViewType>(element::Float32::element_type(), shape);
auto f = make_shared<Function>(make_shared<op::Subtract>(A, B), rt, op::Parameters{A, B});
auto manager = runtime::Manager::get("CPU");
auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f);
auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external);
......@@ -1021,7 +1021,7 @@ TEST(cpu, subtract)
ASSERT_EQ((vector<float>{1, 2, 4, 8}), result->get_vector());
}
TEST(cpu, scalar_constant)
TEST(${BACKEND_NAME}, scalar_constant)
{
auto shape = Shape{};
auto t = ngraph::runtime::make_tensor<element::Float32>(shape);
......@@ -1030,7 +1030,7 @@ TEST(cpu, scalar_constant)
auto rt = make_shared<TensorViewType>(element::Float32::element_type(), shape);
auto f = make_shared<Function>(A, rt, op::Parameters{});
auto manager = runtime::Manager::get("CPU");
auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f);
auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external);
......@@ -1042,7 +1042,7 @@ TEST(cpu, scalar_constant)
ASSERT_EQ((vector<float>{-3.0f}), result->get_vector());
}
TEST(cpu, tensor_constant)
TEST(${BACKEND_NAME}, tensor_constant)
{
auto shape = Shape{2, 2, 2};
auto t = ngraph::runtime::make_tensor<element::Float32>(shape);
......@@ -1051,7 +1051,7 @@ TEST(cpu, tensor_constant)
auto rt = make_shared<TensorViewType>(element::Float32::element_type(), shape);
auto f = make_shared<Function>(A, rt, op::Parameters{});
auto manager = runtime::Manager::get("CPU");
auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f);
auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external);
......@@ -1063,7 +1063,7 @@ TEST(cpu, tensor_constant)
ASSERT_EQ((vector<float>{1, 2, 3, 4, 5, 6, 7, 8}), result->get_vector());
}
TEST(cpu, tensor_constant_with_op)
TEST(${BACKEND_NAME}, tensor_constant_with_op)
{
auto shape = Shape{2, 2, 2};
auto t = ngraph::runtime::make_tensor<element::Float32>(shape);
......@@ -1072,7 +1072,7 @@ TEST(cpu, tensor_constant_with_op)
auto rt = make_shared<TensorViewType>(element::Float32::element_type(), shape);
auto f = make_shared<Function>(make_shared<op::Abs>(A), rt, op::Parameters{});
auto manager = runtime::Manager::get("CPU");
auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f);
auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external);
......@@ -1085,7 +1085,7 @@ TEST(cpu, tensor_constant_with_op)
}
/*
TEST(execute, function_call)
TEST(${BACKEND_NAME}, function_call)
{
// First create "f(A,B,C) = (A+B)*C".
auto shape = Shape{2, 2};
......@@ -1106,7 +1106,7 @@ TEST(execute, function_call)
op::Parameters{X, Y, Z});
// Now call g on some test vectors.
auto manager = runtime::Manager::get("NGVM");
auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(g);
auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external);
......@@ -1130,7 +1130,7 @@ TEST(execute, function_call)
}
*/
TEST(cpu, broadcast_scalar_vector)
TEST(${BACKEND_NAME}, broadcast_scalar_vector)
{
auto shape_a = Shape{};
auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape_a);
......@@ -1139,7 +1139,7 @@ TEST(cpu, broadcast_scalar_vector)
auto f = make_shared<Function>(
make_shared<op::Broadcast>(A, shape_r, AxisSet{0}), rt, op::Parameters{A});
auto manager = runtime::Manager::get("CPU");
auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f);
auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external);
......@@ -1153,7 +1153,7 @@ TEST(cpu, broadcast_scalar_vector)
ASSERT_EQ((vector<float>{6, 6, 6, 6}), result->get_vector());
}
TEST(cpu, broadcast_scalar_matrix)
TEST(${BACKEND_NAME}, broadcast_scalar_matrix)
{
auto shape_a = Shape{};
auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape_a);
......@@ -1162,7 +1162,7 @@ TEST(cpu, broadcast_scalar_matrix)
auto f = make_shared<Function>(
make_shared<op::Broadcast>(A, shape_r, AxisSet{0, 1}), rt, op::Parameters{A});
auto manager = runtime::Manager::get("CPU");
auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f);
auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external);
......@@ -1176,7 +1176,7 @@ TEST(cpu, broadcast_scalar_matrix)
ASSERT_EQ((vector<float>{6, 6, 6, 6}), result->get_vector());
}
TEST(cpu, broadcast_scalar_tensor)
TEST(${BACKEND_NAME}, broadcast_scalar_tensor)
{
auto shape_a = Shape{};
auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape_a);
......@@ -1185,7 +1185,7 @@ TEST(cpu, broadcast_scalar_tensor)
auto f = make_shared<Function>(
make_shared<op::Broadcast>(A, shape_r, AxisSet{0, 1, 2}), rt, op::Parameters{A});
auto manager = runtime::Manager::get("CPU");
auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f);
auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external);
......@@ -1199,7 +1199,7 @@ TEST(cpu, broadcast_scalar_tensor)
ASSERT_EQ((vector<float>{6, 6, 6, 6, 6, 6, 6, 6}), result->get_vector());
}
TEST(cpu, broadcast_trivial)
TEST(${BACKEND_NAME}, broadcast_trivial)
{
auto shape = Shape{2, 2, 2};
auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape);
......@@ -1207,7 +1207,7 @@ TEST(cpu, broadcast_trivial)
auto f = make_shared<Function>(
make_shared<op::Broadcast>(A, shape, AxisSet{}), rt, op::Parameters{A});
auto manager = runtime::Manager::get("CPU");
auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f);
auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external);
......@@ -1221,7 +1221,7 @@ TEST(cpu, broadcast_trivial)
ASSERT_EQ((vector<float>{2, 4, 6, 8, 16, 32, 64, 128}), result->get_vector());
}
TEST(cpu, broadcast_vector_colwise)
TEST(${BACKEND_NAME}, broadcast_vector_colwise)
{
auto shape_a = Shape{3};
auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape_a);
......@@ -1230,7 +1230,7 @@ TEST(cpu, broadcast_vector_colwise)
auto f = make_shared<Function>(
make_shared<op::Broadcast>(A, shape_r, AxisSet{1}), rt, op::Parameters{A});
auto manager = runtime::Manager::get("CPU");
auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f);
auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external);
......@@ -1244,7 +1244,7 @@ TEST(cpu, broadcast_vector_colwise)
ASSERT_EQ((vector<float>{1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3}), result->get_vector());
}
TEST(cpu, broadcast_vector_rowwise)
TEST(${BACKEND_NAME}, broadcast_vector_rowwise)
{
auto shape_a = Shape{4};
auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape_a);
......@@ -1253,7 +1253,7 @@ TEST(cpu, broadcast_vector_rowwise)
auto f = make_shared<Function>(
make_shared<op::Broadcast>(A, shape_r, AxisSet{0}), rt, op::Parameters{A});
auto manager = runtime::Manager::get("CPU");
auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f);
auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external);
......@@ -1267,7 +1267,7 @@ TEST(cpu, broadcast_vector_rowwise)
ASSERT_EQ((vector<float>{1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4}), result->get_vector());
}
TEST(cpu, broadcast_vector_rowwise_int64)
TEST(${BACKEND_NAME}, broadcast_vector_rowwise_int64)
{
auto shape_a = Shape{4};
auto A = make_shared<op::Parameter>(element::Int64::element_type(), shape_a);
......@@ -1276,7 +1276,7 @@ TEST(cpu, broadcast_vector_rowwise_int64)
auto f = make_shared<Function>(
make_shared<op::Broadcast>(A, shape_r, AxisSet{0}), rt, op::Parameters{A});
auto manager = runtime::Manager::get("CPU");
auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f);
auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external);
......@@ -1291,7 +1291,7 @@ TEST(cpu, broadcast_vector_rowwise_int64)
result->get_vector());
}
TEST(cpu, convert_int32_float32)
TEST(${BACKEND_NAME}, convert_int32_float32)
{
auto shape = Shape{2, 2};
auto A = make_shared<op::Parameter>(element::Int32::element_type(), shape);
......@@ -1299,7 +1299,7 @@ TEST(cpu, convert_int32_float32)
auto f = make_shared<Function>(
make_shared<op::Convert>(A, element::Float32::element_type()), rt, op::Parameters{A});
auto manager = runtime::Manager::get("CPU");
auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f);
auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external);
......@@ -1313,7 +1313,7 @@ TEST(cpu, convert_int32_float32)
ASSERT_EQ((vector<element::Float32::type>{1, 2, 3, 4}), result->get_vector());
}
TEST(cpu, convert_int32_bool)
TEST(${BACKEND_NAME}, convert_int32_bool)
{
auto shape = Shape{2, 2};
auto A = make_shared<op::Parameter>(element::Int32::element_type(), shape);
......@@ -1321,7 +1321,7 @@ TEST(cpu, convert_int32_bool)
auto f = make_shared<Function>(
make_shared<op::Convert>(A, element::Bool::element_type()), rt, op::Parameters{A});
auto manager = runtime::Manager::get("CPU");
auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f);
auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external);
......@@ -1335,7 +1335,7 @@ TEST(cpu, convert_int32_bool)
ASSERT_EQ((vector<element::Bool::type>{1, 2, 3, 4}), result->get_vector());
}
TEST(cpu, convert_float32_bool)
TEST(${BACKEND_NAME}, convert_float32_bool)
{
auto shape = Shape{2, 2};
auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape);
......@@ -1343,7 +1343,7 @@ TEST(cpu, convert_float32_bool)
auto f = make_shared<Function>(
make_shared<op::Convert>(A, element::Bool::element_type()), rt, op::Parameters{A});
auto manager = runtime::Manager::get("CPU");
auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f);
auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external);
......@@ -1359,7 +1359,7 @@ TEST(cpu, convert_float32_bool)
/*
// Trivial case with no reduction axes.
TEST(execute, reduce_trivial)
TEST(${BACKEND_NAME}, reduce_trivial)
{
// First, the reduction function (f(x:float32[],y:float32[]) = x+y).
auto f_A = make_shared<op::Parameter>(element::Float32::element_type(), Shape{});
......@@ -1375,7 +1375,7 @@ TEST(execute, reduce_trivial)
auto g = make_shared<Function>(
make_shared<op::Reduce>(g_A, g_B, f, AxisSet{}), g_rt, op::Parameters{g_A, g_B});
auto manager = runtime::Manager::get("NGVM");
auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(g);
auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external);
......@@ -1391,7 +1391,7 @@ TEST(execute, reduce_trivial)
ASSERT_EQ((vector<float>{1, 2, 3, 4}), result->get_vector());
}
TEST(execute, reduce_to_scalar)
TEST(${BACKEND_NAME}, reduce_to_scalar)
{
// First, the reduction function (f(x:float32[],y:float32[]) = x+y).
auto f_A = make_shared<op::Parameter>(element::Float32::element_type(), Shape{});
......@@ -1407,7 +1407,7 @@ TEST(execute, reduce_to_scalar)
auto g = make_shared<Function>(
make_shared<op::Reduce>(g_A, g_B, f, AxisSet{0, 1}), g_rt, op::Parameters{g_A, g_B});
auto manager = runtime::Manager::get("NGVM");
auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(g);
auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external);
......@@ -1428,7 +1428,7 @@ TEST(execute, reduce_to_scalar)
ASSERT_EQ((vector<float>{0}), b->get_vector());
}
TEST(execute, reduce_matrix_columns)
TEST(${BACKEND_NAME}, reduce_matrix_columns)
{
// First, the reduction function (f(x:float32[],y:float32[]) = x+y).
auto f_A = make_shared<op::Parameter>(element::Float32::element_type(), Shape{});
......@@ -1445,7 +1445,7 @@ TEST(execute, reduce_matrix_columns)
auto g = make_shared<Function>(
make_shared<op::Reduce>(g_A, g_B, f, AxisSet{0}), g_rt, op::Parameters{g_A, g_B});
auto manager = runtime::Manager::get("NGVM");
auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(g);
auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external);
......@@ -1466,7 +1466,7 @@ TEST(execute, reduce_matrix_columns)
ASSERT_EQ((vector<float>{0}), b->get_vector());
}
TEST(execute, reduce_matrix_rows)
TEST(${BACKEND_NAME}, reduce_matrix_rows)
{
// First, the reduction function (f(x:float32[],y:float32[]) = x+y).
auto f_A = make_shared<op::Parameter>(element::Float32::element_type(), Shape{});
......@@ -1483,7 +1483,7 @@ TEST(execute, reduce_matrix_rows)
auto g = make_shared<Function>(
make_shared<op::Reduce>(g_A, g_B, f, AxisSet{1}), g_rt, op::Parameters{g_A, g_B});
auto manager = runtime::Manager::get("NGVM");
auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(g);
auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external);
......@@ -1504,7 +1504,7 @@ TEST(execute, reduce_matrix_rows)
ASSERT_EQ((vector<float>{0}), b->get_vector());
}
TEST(execute, reduce_matrix_rows_zero)
TEST(${BACKEND_NAME}, reduce_matrix_rows_zero)
{
// First, the reduction function (f(x:float32[],y:float32[]) = x+y).
auto f_A = make_shared<op::Parameter>(element::Float32::element_type(), Shape{});
......@@ -1521,7 +1521,7 @@ TEST(execute, reduce_matrix_rows_zero)
auto g = make_shared<Function>(
make_shared<op::Reduce>(g_A, g_B, f, AxisSet{1}), g_rt, op::Parameters{g_A, g_B});
auto manager = runtime::Manager::get("NGVM");
auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(g);
auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external);
......@@ -1542,7 +1542,7 @@ TEST(execute, reduce_matrix_rows_zero)
ASSERT_EQ((vector<float>{66}), b->get_vector());
}
TEST(execute, reduce_matrix_cols_zero)
TEST(${BACKEND_NAME}, reduce_matrix_cols_zero)
{
// First, the reduction function (f(x:float32[],y:float32[]) = x+y).
auto f_A = make_shared<op::Parameter>(element::Float32::element_type(), Shape{});
......@@ -1559,7 +1559,7 @@ TEST(execute, reduce_matrix_cols_zero)
auto g = make_shared<Function>(
make_shared<op::Reduce>(g_A, g_B, f, AxisSet{0}), g_rt, op::Parameters{g_A, g_B});
auto manager = runtime::Manager::get("NGVM");
auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(g);
auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external);
......@@ -1580,7 +1580,7 @@ TEST(execute, reduce_matrix_cols_zero)
ASSERT_EQ((vector<float>{77}), b->get_vector());
}
TEST(execute, reduce_vector_zero)
TEST(${BACKEND_NAME}, reduce_vector_zero)
{
// First, the reduction function (f(x:float32[],y:float32[]) = x+y).
auto f_A = make_shared<op::Parameter>(element::Float32::element_type(), Shape{});
......@@ -1597,7 +1597,7 @@ TEST(execute, reduce_vector_zero)
auto g = make_shared<Function>(
make_shared<op::Reduce>(g_A, g_B, f, AxisSet{0}), g_rt, op::Parameters{g_A, g_B});
auto manager = runtime::Manager::get("NGVM");
auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(g);
auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external);
......@@ -1618,7 +1618,7 @@ TEST(execute, reduce_vector_zero)
ASSERT_EQ((vector<float>{88}), b->get_vector());
}
TEST(execute, reduce_matrix_to_scalar_zero_by_zero)
TEST(${BACKEND_NAME}, reduce_matrix_to_scalar_zero_by_zero)
{
// First, the reduction function (f(x:float32[],y:float32[]) = x+y).
auto f_A = make_shared<op::Parameter>(element::Float32::element_type(), Shape{});
......@@ -1635,7 +1635,7 @@ TEST(execute, reduce_matrix_to_scalar_zero_by_zero)
auto g = make_shared<Function>(
make_shared<op::Reduce>(g_A, g_B, f, AxisSet{0, 1}), g_rt, op::Parameters{g_A, g_B});
auto manager = runtime::Manager::get("NGVM");
auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(g);
auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external);
......@@ -1656,7 +1656,7 @@ TEST(execute, reduce_matrix_to_scalar_zero_by_zero)
ASSERT_EQ((vector<float>{99}), b->get_vector());
}
TEST(execute, reshape_t2v_012)
TEST(${BACKEND_NAME}, reshape_t2v_012)
{
auto shape_a = Shape{2, 2, 3};
auto A = make_shared<op::Parameter>(
......@@ -1666,7 +1666,7 @@ TEST(execute, reshape_t2v_012)
auto r = make_shared<op::Reshape>(A, AxisVector{0, 1, 2}, shape_r);
auto f = make_shared<Function>(r, rt, op::Parameters{A});
auto manager = runtime::Manager::get("NGVM");
auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f);
auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external);
......@@ -1680,7 +1680,7 @@ TEST(execute, reshape_t2v_012)
ASSERT_EQ((vector<float>{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}), result->get_vector());
}
TEST(execute, reshape_t2s_012)
TEST(${BACKEND_NAME}, reshape_t2s_012)
{
auto shape_a = Shape{1, 1, 1};
auto A = make_shared<op::Parameter>(
......@@ -1690,7 +1690,7 @@ TEST(execute, reshape_t2s_012)
auto r = make_shared<op::Reshape>(A, AxisVector{0, 1, 2}, shape_r);
auto f = make_shared<Function>(r, rt, op::Parameters{A});
auto manager = runtime::Manager::get("NGVM");
auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f);
auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external);
......@@ -1704,7 +1704,7 @@ TEST(execute, reshape_t2s_012)
ASSERT_EQ((vector<float>{6}), result->get_vector());
}
TEST(execute, reshape_t2s_120)
TEST(${BACKEND_NAME}, reshape_t2s_120)
{
auto shape_a = Shape{1, 1, 1};
auto A = make_shared<op::Parameter>(
......@@ -1714,7 +1714,7 @@ TEST(execute, reshape_t2s_120)
auto r = make_shared<op::Reshape>(A, AxisVector{1, 2, 0}, shape_r);
auto f = make_shared<Function>(r, rt, op::Parameters{A});
auto manager = runtime::Manager::get("NGVM");
auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f);
auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external);
......@@ -1728,7 +1728,7 @@ TEST(execute, reshape_t2s_120)
ASSERT_EQ((vector<float>{6}), result->get_vector());
}
TEST(execute, reshape_s2t)
TEST(${BACKEND_NAME}, reshape_s2t)
{
auto shape_a = Shape{};
auto A = make_shared<op::Parameter>(
......@@ -1738,7 +1738,7 @@ TEST(execute, reshape_s2t)
auto r = make_shared<op::Reshape>(A, AxisVector{}, shape_r);
auto f = make_shared<Function>(r, rt, op::Parameters{A});
auto manager = runtime::Manager::get("NGVM");
auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f);
auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external);
......@@ -1752,7 +1752,7 @@ TEST(execute, reshape_s2t)
ASSERT_EQ((vector<float>{42}), result->get_vector());
}
TEST(execute, reshape_v2m_col)
TEST(${BACKEND_NAME}, reshape_v2m_col)
{
auto shape_a = Shape{3};
auto A = make_shared<op::Parameter>(
......@@ -1762,7 +1762,7 @@ TEST(execute, reshape_v2m_col)
auto r = make_shared<op::Reshape>(A, AxisVector{0}, shape_r);
auto f = make_shared<Function>(r, rt, op::Parameters{A});
auto manager = runtime::Manager::get("NGVM");
auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f);
auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external);
......@@ -1776,7 +1776,7 @@ TEST(execute, reshape_v2m_col)
ASSERT_EQ((vector<float>{1, 2, 3}), result->get_vector());
}
TEST(execute, reshape_v2m_row)
TEST(${BACKEND_NAME}, reshape_v2m_row)
{
auto shape_a = Shape{3};
auto A = make_shared<op::Parameter>(
......@@ -1786,7 +1786,7 @@ TEST(execute, reshape_v2m_row)
auto r = make_shared<op::Reshape>(A, AxisVector{0}, shape_r);
auto f = make_shared<Function>(r, rt, op::Parameters{A});
auto manager = runtime::Manager::get("NGVM");
auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f);
auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external);
......@@ -1800,7 +1800,7 @@ TEST(execute, reshape_v2m_row)
ASSERT_EQ((vector<float>{1, 2, 3}), result->get_vector());
}
TEST(execute, reshape_v2t_middle)
TEST(${BACKEND_NAME}, reshape_v2t_middle)
{
auto shape_a = Shape{3};
auto A = make_shared<op::Parameter>(
......@@ -1810,7 +1810,7 @@ TEST(execute, reshape_v2t_middle)
auto r = make_shared<op::Reshape>(A, AxisVector{0}, shape_r);
auto f = make_shared<Function>(r, rt, op::Parameters{A});
auto manager = runtime::Manager::get("NGVM");
auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f);
auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external);
......@@ -1824,7 +1824,7 @@ TEST(execute, reshape_v2t_middle)
ASSERT_EQ((vector<float>{1, 2, 3}), result->get_vector());
}
TEST(execute, reshape_m2m_same)
TEST(${BACKEND_NAME}, reshape_m2m_same)
{
auto shape_a = Shape{3, 3};
auto A = make_shared<op::Parameter>(
......@@ -1834,7 +1834,7 @@ TEST(execute, reshape_m2m_same)
auto r = make_shared<op::Reshape>(A, AxisVector{0, 1}, shape_r);
auto f = make_shared<Function>(r, rt, op::Parameters{A});
auto manager = runtime::Manager::get("NGVM");
auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f);
auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external);
......@@ -1848,7 +1848,7 @@ TEST(execute, reshape_m2m_same)
ASSERT_EQ((vector<float>{1, 2, 3, 4, 5, 6, 7, 8, 9}), result->get_vector());
}
TEST(execute, reshape_m2m_transpose)
TEST(${BACKEND_NAME}, reshape_m2m_transpose)
{
auto shape_a = Shape{3, 3};
auto A = make_shared<op::Parameter>(
......@@ -1858,7 +1858,7 @@ TEST(execute, reshape_m2m_transpose)
auto r = make_shared<op::Reshape>(A, AxisVector{1, 0}, shape_r);
auto f = make_shared<Function>(r, rt, op::Parameters{A});
auto manager = runtime::Manager::get("NGVM");
auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f);
auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external);
......@@ -1872,7 +1872,7 @@ TEST(execute, reshape_m2m_transpose)
ASSERT_EQ((vector<float>{1, 4, 7, 2, 5, 8, 3, 6, 9}), result->get_vector());
}
TEST(execute, reshape_m2m_dim_change_transpose)
TEST(${BACKEND_NAME}, reshape_m2m_dim_change_transpose)
{
auto shape_a = Shape{3, 2};
auto A = make_shared<op::Parameter>(
......@@ -1882,7 +1882,7 @@ TEST(execute, reshape_m2m_dim_change_transpose)
auto r = make_shared<op::Reshape>(A, AxisVector{1, 0}, shape_r);
auto f = make_shared<Function>(r, rt, op::Parameters{A});
auto manager = runtime::Manager::get("NGVM");
auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f);
auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external);
......@@ -1896,14 +1896,14 @@ TEST(execute, reshape_m2m_dim_change_transpose)
ASSERT_EQ((vector<float>{1, 3, 5, 2, 4, 6}), result->get_vector());
}
TEST(execute, sin)
TEST(${BACKEND_NAME}, sin)
{
auto shape = Shape{6};
auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape);
auto result_type = make_shared<TensorViewType>(element::Float32::element_type(), shape);
auto f = make_shared<Function>(make_shared<op::Sin>(A), result_type, op::Parameters{A});
auto manager = runtime::Manager::get("NGVM");
auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f);
auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external);
......@@ -1922,14 +1922,14 @@ TEST(execute, sin)
ASSERT_EQ(input, result->get_vector());
}
TEST(execute, cos)
TEST(${BACKEND_NAME}, cos)
{
auto shape = Shape{6};
auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape);
auto result_type = make_shared<TensorViewType>(element::Float32::element_type(), shape);
auto f = make_shared<Function>(make_shared<op::Cos>(A), result_type, op::Parameters{A});
auto manager = runtime::Manager::get("NGVM");
auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f);
auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external);
......@@ -1948,14 +1948,14 @@ TEST(execute, cos)
ASSERT_EQ(input, result->get_vector());
}
TEST(execute, tan)
TEST(${BACKEND_NAME}, tan)
{
auto shape = Shape{6};
auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape);
auto result_type = make_shared<TensorViewType>(element::Float32::element_type(), shape);
auto f = make_shared<Function>(make_shared<op::Tan>(A), result_type, op::Parameters{A});
auto manager = runtime::Manager::get("NGVM");
auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f);
auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external);
......@@ -1974,14 +1974,14 @@ TEST(execute, tan)
ASSERT_EQ(input, result->get_vector());
}
TEST(execute, asin)
TEST(${BACKEND_NAME}, asin)
{
auto shape = Shape{6};
auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape);
auto result_type = make_shared<TensorViewType>(element::Float32::element_type(), shape);
auto f = make_shared<Function>(make_shared<op::Asin>(A), result_type, op::Parameters{A});
auto manager = runtime::Manager::get("NGVM");
auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f);
auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external);
......@@ -1999,14 +1999,14 @@ TEST(execute, asin)
ASSERT_EQ(input, result->get_vector());
}
TEST(execute, acos)
TEST(${BACKEND_NAME}, acos)
{
auto shape = Shape{6};
auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape);
auto result_type = make_shared<TensorViewType>(element::Float32::element_type(), shape);
auto f = make_shared<Function>(make_shared<op::Acos>(A), result_type, op::Parameters{A});
auto manager = runtime::Manager::get("NGVM");
auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f);
auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external);
......@@ -2024,14 +2024,14 @@ TEST(execute, acos)
ASSERT_EQ(input, result->get_vector());
}
TEST(execute, atan)
TEST(${BACKEND_NAME}, atan)
{
auto shape = Shape{6};
auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape);
auto result_type = make_shared<TensorViewType>(element::Float32::element_type(), shape);
auto f = make_shared<Function>(make_shared<op::Atan>(A), result_type, op::Parameters{A});
auto manager = runtime::Manager::get("NGVM");
auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f);
auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external);
......@@ -2049,14 +2049,14 @@ TEST(execute, atan)
ASSERT_EQ(input, result->get_vector());
}
TEST(execute, sinh)
TEST(${BACKEND_NAME}, sinh)
{
auto shape = Shape{6};
auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape);
auto result_type = make_shared<TensorViewType>(element::Float32::element_type(), shape);
auto f = make_shared<Function>(make_shared<op::Sinh>(A), result_type, op::Parameters{A});
auto manager = runtime::Manager::get("NGVM");
auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f);
auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external);
......@@ -2074,14 +2074,14 @@ TEST(execute, sinh)
ASSERT_EQ(input, result->get_vector());
}
TEST(execute, cosh)
TEST(${BACKEND_NAME}, cosh)
{
auto shape = Shape{6};
auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape);
auto result_type = make_shared<TensorViewType>(element::Float32::element_type(), shape);
auto f = make_shared<Function>(make_shared<op::Cosh>(A), result_type, op::Parameters{A});
auto manager = runtime::Manager::get("NGVM");
auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f);
auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external);
......@@ -2099,14 +2099,14 @@ TEST(execute, cosh)
ASSERT_EQ(input, result->get_vector());
}
TEST(execute, tanh)
TEST(${BACKEND_NAME}, tanh)
{
auto shape = Shape{6};
auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape);
auto result_type = make_shared<TensorViewType>(element::Float32::element_type(), shape);
auto f = make_shared<Function>(make_shared<op::Tanh>(A), result_type, op::Parameters{A});
auto manager = runtime::Manager::get("NGVM");
auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f);
auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external);
......@@ -2124,14 +2124,14 @@ TEST(execute, tanh)
ASSERT_EQ(input, result->get_vector());
}
TEST(execute, exp)
TEST(${BACKEND_NAME}, exp)
{
auto shape = Shape{8};
auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape);
auto result_type = make_shared<TensorViewType>(element::Float32::element_type(), shape);
auto f = make_shared<Function>(make_shared<op::Exp>(A), result_type, op::Parameters{A});
auto manager = runtime::Manager::get("NGVM");
auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f);
auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external);
......@@ -2147,7 +2147,7 @@ TEST(execute, exp)
result->get_vector());
}
TEST(execute, slice_scalar)
TEST(${BACKEND_NAME}, slice_scalar)
{
auto shape_a = Shape{};
auto A = make_shared<op::Parameter>(
......@@ -2157,7 +2157,7 @@ TEST(execute, slice_scalar)
auto r = make_shared<op::Slice>(A, Coordinate{}, Coordinate{});
auto f = make_shared<Function>(r, rt, op::Parameters{A});
auto manager = runtime::Manager::get("NGVM");
auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f);
auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external);
......@@ -2171,7 +2171,7 @@ TEST(execute, slice_scalar)
ASSERT_EQ((vector<float>{312}), result->get_vector());
}
TEST(execute, slice_matrix)
TEST(${BACKEND_NAME}, slice_matrix)
{
auto shape_a = Shape{4, 4};
auto A = make_shared<op::Parameter>(
......@@ -2181,7 +2181,7 @@ TEST(execute, slice_matrix)
auto r = make_shared<op::Slice>(A, Coordinate{0, 1}, Coordinate{3, 3});
auto f = make_shared<Function>(r, rt, op::Parameters{A});
auto manager = runtime::Manager::get("NGVM");
auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f);
auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external);
......@@ -2195,7 +2195,7 @@ TEST(execute, slice_matrix)
ASSERT_EQ((vector<float>{2, 3, 6, 7, 10, 11}), result->get_vector());
}
TEST(execute, slice_vector)
TEST(${BACKEND_NAME}, slice_vector)
{
auto shape_a = Shape{16};
auto A = make_shared<op::Parameter>(
......@@ -2205,7 +2205,7 @@ TEST(execute, slice_vector)
auto r = make_shared<op::Slice>(A, Coordinate{2}, Coordinate{14});
auto f = make_shared<Function>(r, rt, op::Parameters{A});
auto manager = runtime::Manager::get("NGVM");
auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f);
auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external);
......@@ -2219,13 +2219,13 @@ TEST(execute, slice_vector)
ASSERT_EQ((vector<float>{2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13}), result->get_vector());
}
TEST(execute, scalar_constant_float32)
TEST(${BACKEND_NAME}, scalar_constant_float32)
{
auto rt = make_shared<TensorViewType>(element::Float32::element_type(), Shape{});
auto r = make_shared<op::Constant>(element::Float32::element_type(), Shape{}, "4.8");
auto f = make_shared<Function>(r, rt, op::Parameters{});
auto manager = runtime::Manager::get("NGVM");
auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f);
auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external);
......@@ -2237,13 +2237,13 @@ TEST(execute, scalar_constant_float32)
ASSERT_EQ(vector<float>{std::strtof("4.8", NULL)}, result->get_vector());
}
TEST(execute, scalar_constant_int64)
TEST(${BACKEND_NAME}, scalar_constant_int64)
{
auto rt = make_shared<TensorViewType>(element::Int64::element_type(), Shape{});
auto r = make_shared<op::Constant>(element::Int64::element_type(), Shape{}, "2112");
auto f = make_shared<Function>(r, rt, op::Parameters{});
auto manager = runtime::Manager::get("NGVM");
auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f);
auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external);
......@@ -2255,7 +2255,7 @@ TEST(execute, scalar_constant_int64)
ASSERT_EQ(vector<element::Int64::type>{std::strtol("2112", NULL, 10)}, result->get_vector());
}
TEST(execute, tensor_constant_float32)
TEST(${BACKEND_NAME}, tensor_constant_float32)
{
auto shape = Shape{2, 2};
auto rt = make_shared<TensorViewType>(element::Float32::element_type(), shape);
......@@ -2264,7 +2264,7 @@ TEST(execute, tensor_constant_float32)
std::vector<std::string>{"4.8", "4.7", "-5.3", "0"});
auto f = make_shared<Function>(r, rt, op::Parameters{});
auto manager = runtime::Manager::get("NGVM");
auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f);
auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external);
......@@ -2280,7 +2280,7 @@ TEST(execute, tensor_constant_float32)
result->get_vector());
}
TEST(execute, tensor_constant_int64)
TEST(${BACKEND_NAME}, tensor_constant_int64)
{
auto shape = Shape{2, 2};
auto rt = make_shared<TensorViewType>(element::Int64::element_type(), shape);
......@@ -2289,7 +2289,7 @@ TEST(execute, tensor_constant_int64)
std::vector<std::string>{"2112", "1848", "1776", "1964"});
auto f = make_shared<Function>(r, rt, op::Parameters{});
auto manager = runtime::Manager::get("NGVM");
auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f);
auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external);
......@@ -2306,14 +2306,14 @@ TEST(execute, tensor_constant_int64)
}
// Trivial case with no summed axes.
TEST(execute, sum_trivial)
TEST(${BACKEND_NAME}, sum_trivial)
{
auto shape = Shape{2, 2};
auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape);
auto rt = make_shared<TensorViewType>(element::Float32::element_type(), shape);
auto f = make_shared<Function>(make_shared<op::Sum>(A, AxisSet{}), rt, op::Parameters{A});
auto manager = runtime::Manager::get("NGVM");
auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f);
auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external);
......@@ -2327,14 +2327,14 @@ TEST(execute, sum_trivial)
ASSERT_EQ((vector<float>{1, 2, 3, 4}), result->get_vector());
}
TEST(execute, sum_to_scalar)
TEST(${BACKEND_NAME}, sum_to_scalar)
{
auto shape = Shape{2, 2};
auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape);
auto rt = make_shared<TensorViewType>(element::Float32::element_type(), Shape{});
auto f = make_shared<Function>(make_shared<op::Sum>(A, AxisSet{0, 1}), rt, op::Parameters{A});
auto manager = runtime::Manager::get("NGVM");
auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f);
auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external);
......@@ -2352,7 +2352,7 @@ TEST(execute, sum_to_scalar)
ASSERT_EQ((vector<float>{1, 2, 3, 4}), a->get_vector());
}
TEST(execute, sum_matrix_columns)
TEST(${BACKEND_NAME}, sum_matrix_columns)
{
auto shape_a = Shape{3, 2};
auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape_a);
......@@ -2360,7 +2360,7 @@ TEST(execute, sum_matrix_columns)
auto rt = make_shared<TensorViewType>(element::Float32::element_type(), shape_rt);
auto f = make_shared<Function>(make_shared<op::Sum>(A, AxisSet{0}), rt, op::Parameters{A});
auto manager = runtime::Manager::get("NGVM");
auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f);
auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external);
......@@ -2378,7 +2378,7 @@ TEST(execute, sum_matrix_columns)
ASSERT_EQ((vector<float>{1, 2, 3, 4, 5, 6}), a->get_vector());
}
TEST(execute, sum_matrix_rows)
TEST(${BACKEND_NAME}, sum_matrix_rows)
{
auto shape_a = Shape{3, 2};
auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape_a);
......@@ -2386,7 +2386,7 @@ TEST(execute, sum_matrix_rows)
auto rt = make_shared<TensorViewType>(element::Float32::element_type(), shape_rt);
auto f = make_shared<Function>(make_shared<op::Sum>(A, AxisSet{1}), rt, op::Parameters{A});
auto manager = runtime::Manager::get("NGVM");
auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f);
auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external);
......@@ -2404,7 +2404,7 @@ TEST(execute, sum_matrix_rows)
ASSERT_EQ((vector<float>{1, 2, 3, 4, 5, 6}), a->get_vector());
}
TEST(execute, sum_matrix_rows_zero)
TEST(${BACKEND_NAME}, sum_matrix_rows_zero)
{
auto shape_a = Shape{3, 0};
auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape_a);
......@@ -2412,7 +2412,7 @@ TEST(execute, sum_matrix_rows_zero)
auto rt = make_shared<TensorViewType>(element::Float32::element_type(), shape_rt);
auto f = make_shared<Function>(make_shared<op::Sum>(A, AxisSet{1}), rt, op::Parameters{A});
auto manager = runtime::Manager::get("NGVM");
auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f);
auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external);
......@@ -2430,7 +2430,7 @@ TEST(execute, sum_matrix_rows_zero)
ASSERT_EQ((vector<float>{}), a->get_vector());
}
TEST(execute, sum_matrix_cols_zero)
TEST(${BACKEND_NAME}, sum_matrix_cols_zero)
{
// Now the reduction (g(x:float32[2,2],y:float32[]) = reduce(x,y,f,axes={})).
auto shape_a = Shape{0, 2};
......@@ -2439,7 +2439,7 @@ TEST(execute, sum_matrix_cols_zero)
auto rt = make_shared<TensorViewType>(element::Float32::element_type(), shape_rt);
auto f = make_shared<Function>(make_shared<op::Sum>(A, AxisSet{0}), rt, op::Parameters{A});
auto manager = runtime::Manager::get("NGVM");
auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f);
auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external);
......@@ -2457,7 +2457,7 @@ TEST(execute, sum_matrix_cols_zero)
ASSERT_EQ((vector<float>{}), a->get_vector());
}
TEST(execute, sum_vector_zero)
TEST(${BACKEND_NAME}, sum_vector_zero)
{
auto shape_a = Shape{0};
auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape_a);
......@@ -2465,7 +2465,7 @@ TEST(execute, sum_vector_zero)
auto rt = make_shared<TensorViewType>(element::Float32::element_type(), shape_rt);
auto f = make_shared<Function>(make_shared<op::Sum>(A, AxisSet{0}), rt, op::Parameters{A});
auto manager = runtime::Manager::get("NGVM");
auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f);
auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external);
......@@ -2483,7 +2483,7 @@ TEST(execute, sum_vector_zero)
ASSERT_EQ((vector<float>{}), a->get_vector());
}
TEST(execute, sum_matrix_to_scalar_zero_by_zero)
TEST(${BACKEND_NAME}, sum_matrix_to_scalar_zero_by_zero)
{
auto shape_a = Shape{0, 0};
auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape_a);
......@@ -2491,7 +2491,7 @@ TEST(execute, sum_matrix_to_scalar_zero_by_zero)
auto rt = make_shared<TensorViewType>(element::Float32::element_type(), shape_rt);
auto f = make_shared<Function>(make_shared<op::Sum>(A, AxisSet{0, 1}), rt, op::Parameters{A});
auto manager = runtime::Manager::get("NGVM");
auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f);
auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external);
......@@ -2509,14 +2509,14 @@ TEST(execute, sum_matrix_to_scalar_zero_by_zero)
ASSERT_EQ((vector<float>{}), a->get_vector());
}
TEST(execute, sign)
TEST(${BACKEND_NAME}, sign)
{
auto shape = Shape{2, 3};
auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape);
auto result_type = make_shared<TensorViewType>(element::Float32::element_type(), shape);
auto f = make_shared<Function>(make_shared<op::Sign>(A), result_type, op::Parameters{A});
auto manager = runtime::Manager::get("NGVM");
auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f);
auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external);
......
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment