Commit 6dc0ef17 authored by Jaikrishnan Menon's avatar Jaikrishnan Menon

Merge remote-tracking branch 'origin/bob/shared_test' into jmenon/cpu

Conflicts:
	test/CMakeLists.txt
	test/execute.cpp
parents afe15127 44094488
...@@ -24,7 +24,6 @@ include_directories( ...@@ -24,7 +24,6 @@ include_directories(
set (SRC set (SRC
build_graph.cpp build_graph.cpp
eigen.cpp eigen.cpp
execute.cpp
input_output_assign.cpp input_output_assign.cpp
main.cpp main.cpp
op.cpp op.cpp
...@@ -42,6 +41,14 @@ set (SRC ...@@ -42,6 +41,14 @@ set (SRC
uuid.cpp uuid.cpp
) )
#================================================================================================
# To auto generate a suite of unit tests for a backend add a line like this
# set(BACKEND_NAMES ${BACKEND_NAMES} "BACKEND_NAME_GOES_HERE")
# and replace BACKEND_NAME_GOES_HERE with your backend name.
# The code for the unit test suite is in test/backend_test.in.cpp
#================================================================================================
set(BACKEND_NAMES ${BACKEND_NAMES} "NGVM")
if(MKLDNN_INCLUDE_DIR) if(MKLDNN_INCLUDE_DIR)
include_directories(SYSTEM ${MKLDNN_INCLUDE_DIR}) include_directories(SYSTEM ${MKLDNN_INCLUDE_DIR})
link_directories(${MKLDNN_LIB_DIR}) link_directories(${MKLDNN_LIB_DIR})
...@@ -50,9 +57,16 @@ endif() ...@@ -50,9 +57,16 @@ endif()
if(LLVM_INCLUDE_DIR) if(LLVM_INCLUDE_DIR)
include_directories(SYSTEM ${LLVM_INCLUDE_DIR}) include_directories(SYSTEM ${LLVM_INCLUDE_DIR})
set(SRC ${SRC} codegen.cpp cpu.cpp) set(SRC ${SRC} codegen.cpp)
set(BACKEND_NAMES ${BACKEND_NAMES} "CPU")
endif() endif()
foreach(BACKEND_NAME ${BACKEND_NAMES})
configure_file(backend_test.in.cpp backend_test_${BACKEND_NAME}.cpp)
set(SRC ${SRC} ${CMAKE_CURRENT_BINARY_DIR}/backend_test_${BACKEND_NAME}.cpp)
message(STATUS "Adding unit test for backend ${BACKEND_NAME}")
endforeach()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DCURDIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}\\\"") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DCURDIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}\\\"")
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
using namespace std; using namespace std;
using namespace ngraph; using namespace ngraph;
TEST(execute, abc) TEST(${BACKEND_NAME}, abc)
{ {
auto shape = Shape{2, 2}; auto shape = Shape{2, 2};
auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape); auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape);
...@@ -30,7 +30,7 @@ TEST(execute, abc) ...@@ -30,7 +30,7 @@ TEST(execute, abc)
auto rt = make_shared<TensorViewType>(element::Float32::element_type(), shape); 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 f = make_shared<Function>((A + B) * C, rt, op::Parameters{A, B, C});
auto manager = runtime::Manager::get("NGVM"); auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f); auto external = manager->compile(f);
auto backend = manager->allocate_backend(); auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external); auto cf = backend->make_call_frame(external);
...@@ -54,7 +54,7 @@ TEST(execute, abc) ...@@ -54,7 +54,7 @@ TEST(execute, abc)
ASSERT_EQ(*result, (runtime::NDArray<float, 2>({{50, 72}, {98, 128}}))); ASSERT_EQ(*result, (runtime::NDArray<float, 2>({{50, 72}, {98, 128}})));
} }
TEST(execute, abc_int64) TEST(${BACKEND_NAME}, abc_int64)
{ {
auto shape = Shape{2, 2}; auto shape = Shape{2, 2};
auto A = make_shared<op::Parameter>(element::Int64::element_type(), shape); auto A = make_shared<op::Parameter>(element::Int64::element_type(), shape);
...@@ -63,7 +63,7 @@ TEST(execute, abc_int64) ...@@ -63,7 +63,7 @@ TEST(execute, abc_int64)
auto rt = make_shared<TensorViewType>(element::Int64::element_type(), shape); 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 f = make_shared<Function>((A + B) * C, rt, op::Parameters{A, B, C});
auto manager = runtime::Manager::get("NGVM"); auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f); auto external = manager->compile(f);
auto backend = manager->allocate_backend(); auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external); auto cf = backend->make_call_frame(external);
...@@ -88,7 +88,7 @@ TEST(execute, abc_int64) ...@@ -88,7 +88,7 @@ TEST(execute, abc_int64)
} }
// Same as abc, but using tuples for input and output // Same as abc, but using tuples for input and output
TEST(execute, abc_tuple) TEST(${BACKEND_NAME}, abc_tuple)
{ {
auto shape = Shape{2, 2}; auto shape = Shape{2, 2};
...@@ -103,7 +103,7 @@ TEST(execute, abc_tuple) ...@@ -103,7 +103,7 @@ TEST(execute, abc_tuple)
auto f = make_shared<Function>( auto f = make_shared<Function>(
make_shared<op::Tuple>(Nodes{(A + B) * C}), tensor_view_type, op::Parameters{ABC}); make_shared<op::Tuple>(Nodes{(A + B) * C}), tensor_view_type, op::Parameters{ABC});
auto manager = runtime::Manager::get("NGVM"); auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f); auto external = manager->compile(f);
auto backend = manager->allocate_backend(); auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external); auto cf = backend->make_call_frame(external);
...@@ -132,7 +132,7 @@ TEST(execute, abc_tuple) ...@@ -132,7 +132,7 @@ TEST(execute, abc_tuple)
} }
// Same as abc, but using tuples for input and output // Same as abc, but using tuples for input and output
TEST(execute, abc_tuple_int64) TEST(${BACKEND_NAME}, abc_tuple_int64)
{ {
auto shape = Shape{2, 2}; auto shape = Shape{2, 2};
...@@ -147,7 +147,7 @@ TEST(execute, abc_tuple_int64) ...@@ -147,7 +147,7 @@ TEST(execute, abc_tuple_int64)
auto f = make_shared<Function>( auto f = make_shared<Function>(
make_shared<op::Tuple>(Nodes{(A + B) * C}), tensor_view_type, op::Parameters{ABC}); make_shared<op::Tuple>(Nodes{(A + B) * C}), tensor_view_type, op::Parameters{ABC});
auto manager = runtime::Manager::get("NGVM"); auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f); auto external = manager->compile(f);
auto backend = manager->allocate_backend(); auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external); auto cf = backend->make_call_frame(external);
...@@ -176,7 +176,7 @@ TEST(execute, abc_tuple_int64) ...@@ -176,7 +176,7 @@ TEST(execute, abc_tuple_int64)
} }
// Multiple retrive values // Multiple retrive values
TEST(execute, tuple_result) TEST(${BACKEND_NAME}, tuple_result)
{ {
auto shape = Shape{2, 2}; auto shape = Shape{2, 2};
auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape); auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape);
...@@ -191,7 +191,7 @@ TEST(execute, tuple_result) ...@@ -191,7 +191,7 @@ TEST(execute, tuple_result)
auto f = make_shared<Function>( auto f = make_shared<Function>(
make_shared<op::Tuple>(Nodes{A_add_B, A_add_B_mul_C}), rt, op::Parameters{A, B, C}); make_shared<op::Tuple>(Nodes{A_add_B, A_add_B_mul_C}), rt, op::Parameters{A, B, C});
auto manager = runtime::Manager::get("NGVM"); auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f); auto external = manager->compile(f);
auto backend = manager->allocate_backend(); auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external); auto cf = backend->make_call_frame(external);
...@@ -213,14 +213,14 @@ TEST(execute, tuple_result) ...@@ -213,14 +213,14 @@ TEST(execute, tuple_result)
ASSERT_EQ((vector<float>{54, 80, 110, 144}), r1->get_vector()); ASSERT_EQ((vector<float>{54, 80, 110, 144}), r1->get_vector());
} }
TEST(execute, abs) TEST(${BACKEND_NAME}, abs)
{ {
auto shape = Shape{2, 2}; auto shape = Shape{2, 2};
auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape); auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape);
auto result_type = make_shared<TensorViewType>(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 f = make_shared<Function>(make_shared<op::Abs>(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 external = manager->compile(f);
auto backend = manager->allocate_backend(); auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external); auto cf = backend->make_call_frame(external);
...@@ -234,7 +234,7 @@ TEST(execute, abs) ...@@ -234,7 +234,7 @@ TEST(execute, abs)
ASSERT_EQ((vector<float>{1, 2, 0, 4.8f}), result->get_vector()); ASSERT_EQ((vector<float>{1, 2, 0, 4.8f}), result->get_vector());
} }
TEST(execute, concat_matrix_colwise) TEST(${BACKEND_NAME}, concat_matrix_colwise)
{ {
auto shape_a = Shape{2, 2}; auto shape_a = Shape{2, 2};
auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape_a); auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape_a);
...@@ -247,7 +247,7 @@ TEST(execute, concat_matrix_colwise) ...@@ -247,7 +247,7 @@ TEST(execute, concat_matrix_colwise)
auto f = make_shared<Function>( auto f = make_shared<Function>(
make_shared<op::Concat>(Nodes{A, B, C}, 1), rt, op::Parameters{A, B, C}); make_shared<op::Concat>(Nodes{A, B, C}, 1), rt, op::Parameters{A, B, C});
auto manager = runtime::Manager::get("NGVM"); auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f); auto external = manager->compile(f);
auto backend = manager->allocate_backend(); auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external); auto cf = backend->make_call_frame(external);
...@@ -266,7 +266,7 @@ TEST(execute, concat_matrix_colwise) ...@@ -266,7 +266,7 @@ TEST(execute, concat_matrix_colwise)
result->get_vector()); result->get_vector());
} }
TEST(execute, concat_matrix_rowwise) TEST(${BACKEND_NAME}, concat_matrix_rowwise)
{ {
auto shape_a = Shape{2, 2}; auto shape_a = Shape{2, 2};
auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape_a); auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape_a);
...@@ -279,7 +279,7 @@ TEST(execute, concat_matrix_rowwise) ...@@ -279,7 +279,7 @@ TEST(execute, concat_matrix_rowwise)
auto f = make_shared<Function>( auto f = make_shared<Function>(
make_shared<op::Concat>(Nodes{A, B, C}, 0), rt, op::Parameters{A, B, C}); make_shared<op::Concat>(Nodes{A, B, C}, 0), rt, op::Parameters{A, B, C});
auto manager = runtime::Manager::get("NGVM"); auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f); auto external = manager->compile(f);
auto backend = manager->allocate_backend(); auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external); auto cf = backend->make_call_frame(external);
...@@ -298,7 +298,7 @@ TEST(execute, concat_matrix_rowwise) ...@@ -298,7 +298,7 @@ TEST(execute, concat_matrix_rowwise)
result->get_vector()); result->get_vector());
} }
TEST(execute, concat_matrix_int64) TEST(${BACKEND_NAME}, concat_matrix_int64)
{ {
auto shape_a = Shape{2, 2}; auto shape_a = Shape{2, 2};
auto A = make_shared<op::Parameter>(element::Int64::element_type(), shape_a); auto A = make_shared<op::Parameter>(element::Int64::element_type(), shape_a);
...@@ -311,7 +311,7 @@ TEST(execute, concat_matrix_int64) ...@@ -311,7 +311,7 @@ TEST(execute, concat_matrix_int64)
auto f = make_shared<Function>( auto f = make_shared<Function>(
make_shared<op::Concat>(Nodes{A, B, C}, 0), rt, op::Parameters{A, B, C}); make_shared<op::Concat>(Nodes{A, B, C}, 0), rt, op::Parameters{A, B, C});
auto manager = runtime::Manager::get("NGVM"); auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f); auto external = manager->compile(f);
auto backend = manager->allocate_backend(); auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external); auto cf = backend->make_call_frame(external);
...@@ -330,7 +330,7 @@ TEST(execute, concat_matrix_int64) ...@@ -330,7 +330,7 @@ TEST(execute, concat_matrix_int64)
result->get_vector()); result->get_vector());
} }
TEST(execute, concat_vector) TEST(${BACKEND_NAME}, concat_vector)
{ {
auto shape_a = Shape{4}; auto shape_a = Shape{4};
auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape_a); auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape_a);
...@@ -343,7 +343,7 @@ TEST(execute, concat_vector) ...@@ -343,7 +343,7 @@ TEST(execute, concat_vector)
auto f = make_shared<Function>( auto f = make_shared<Function>(
make_shared<op::Concat>(Nodes{A, B, C}, 0), rt, op::Parameters{A, B, C}); make_shared<op::Concat>(Nodes{A, B, C}, 0), rt, op::Parameters{A, B, C});
auto manager = runtime::Manager::get("NGVM"); auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f); auto external = manager->compile(f);
auto backend = manager->allocate_backend(); auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external); auto cf = backend->make_call_frame(external);
...@@ -361,9 +361,9 @@ TEST(execute, concat_vector) ...@@ -361,9 +361,9 @@ TEST(execute, concat_vector)
ASSERT_EQ((vector<float>{2, 4, 8, 16, 1, 2, 4, 8, 16, 32, 18, 19}), result->get_vector()); ASSERT_EQ((vector<float>{2, 4, 8, 16, 1, 2, 4, 8, 16, 32, 18, 19}), result->get_vector());
} }
TEST(execute, divide) TEST(${BACKEND_NAME}, divide)
{ {
auto manager = runtime::Manager::get("NGVM"); auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto backend = manager->allocate_backend(); auto backend = manager->allocate_backend();
auto shape = Shape{2, 2}; auto shape = Shape{2, 2};
...@@ -391,7 +391,7 @@ TEST(execute, divide) ...@@ -391,7 +391,7 @@ TEST(execute, divide)
ASSERT_EQ((vector<float>{2, 2, 2, 2}), result->get_vector()); ASSERT_EQ((vector<float>{2, 2, 2, 2}), result->get_vector());
} }
TEST(execute, equal) TEST(${BACKEND_NAME}, equal)
{ {
auto shape = Shape{2, 2, 2}; auto shape = Shape{2, 2, 2};
auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape); auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape);
...@@ -399,7 +399,7 @@ TEST(execute, equal) ...@@ -399,7 +399,7 @@ TEST(execute, equal)
auto rt = make_shared<TensorViewType>(element::Bool::element_type(), shape); 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 f = make_shared<Function>(make_shared<op::Equal>(A, B), rt, op::Parameters{A, B});
auto manager = runtime::Manager::get("NGVM"); auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f); auto external = manager->compile(f);
auto backend = manager->allocate_backend(); auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external); auto cf = backend->make_call_frame(external);
...@@ -415,7 +415,7 @@ TEST(execute, equal) ...@@ -415,7 +415,7 @@ TEST(execute, equal)
ASSERT_EQ((vector<char>{1, 1, 0, 0, 0, 1, 1, 0}), result->get_vector()); ASSERT_EQ((vector<char>{1, 1, 0, 0, 0, 1, 1, 0}), result->get_vector());
} }
TEST(execute, dot_0_0) TEST(${BACKEND_NAME}, dot_0_0)
{ {
auto shape = Shape{0}; auto shape = Shape{0};
auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape); auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape);
...@@ -424,7 +424,7 @@ TEST(execute, dot_0_0) ...@@ -424,7 +424,7 @@ TEST(execute, dot_0_0)
auto rt = make_shared<TensorViewType>(element::Float32::element_type(), Shape{}); 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 f = make_shared<Function>(make_shared<op::Dot>(A, B), rt, op::Parameters{A, B});
auto manager = runtime::Manager::get("NGVM"); auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f); auto external = manager->compile(f);
auto backend = manager->allocate_backend(); auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external); auto cf = backend->make_call_frame(external);
...@@ -440,13 +440,13 @@ TEST(execute, dot_0_0) ...@@ -440,13 +440,13 @@ TEST(execute, dot_0_0)
ASSERT_EQ((vector<float>{0}), result->get_vector()); ASSERT_EQ((vector<float>{0}), result->get_vector());
} }
TEST(execute, dot_matrix_2x0_0x2) TEST(${BACKEND_NAME}, dot_matrix_2x0_0x2)
{ {
auto shape_a = Shape{2, 0}; auto shape_a = Shape{2, 0};
auto shape_b = Shape{0, 2}; auto shape_b = Shape{0, 2};
auto shape_r = Shape{2, 2}; auto shape_r = Shape{2, 2};
auto manager = runtime::Manager::get("NGVM"); auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto backend = manager->allocate_backend(); auto backend = manager->allocate_backend();
auto make_external = [&]() { auto make_external = [&]() {
...@@ -472,7 +472,7 @@ TEST(execute, dot_matrix_2x0_0x2) ...@@ -472,7 +472,7 @@ TEST(execute, dot_matrix_2x0_0x2)
ASSERT_EQ((vector<float>{0, 0, 0, 0}), result->get_vector()); ASSERT_EQ((vector<float>{0, 0, 0, 0}), result->get_vector());
} }
TEST(execute, dot_matrix_0x2_2x0) TEST(${BACKEND_NAME}, dot_matrix_0x2_2x0)
{ {
auto shape_a = Shape{0, 2}; auto shape_a = Shape{0, 2};
auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape_a); auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape_a);
...@@ -482,7 +482,7 @@ TEST(execute, dot_matrix_0x2_2x0) ...@@ -482,7 +482,7 @@ TEST(execute, dot_matrix_0x2_2x0)
auto rt = make_shared<TensorViewType>(element::Float32::element_type(), shape_r); 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 f = make_shared<Function>(make_shared<op::Dot>(A, B), rt, op::Parameters{A, B});
auto manager = runtime::Manager::get("NGVM"); auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f); auto external = manager->compile(f);
auto backend = manager->allocate_backend(); auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external); auto cf = backend->make_call_frame(external);
...@@ -498,7 +498,7 @@ TEST(execute, dot_matrix_0x2_2x0) ...@@ -498,7 +498,7 @@ TEST(execute, dot_matrix_0x2_2x0)
ASSERT_EQ((vector<float>{}), result->get_vector()); ASSERT_EQ((vector<float>{}), result->get_vector());
} }
TEST(execute, dot_matrix_3x2_2x0) TEST(${BACKEND_NAME}, dot_matrix_3x2_2x0)
{ {
auto shape_a = Shape{3, 2}; auto shape_a = Shape{3, 2};
auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape_a); auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape_a);
...@@ -508,7 +508,7 @@ TEST(execute, dot_matrix_3x2_2x0) ...@@ -508,7 +508,7 @@ TEST(execute, dot_matrix_3x2_2x0)
auto rt = make_shared<TensorViewType>(element::Float32::element_type(), shape_r); 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 f = make_shared<Function>(make_shared<op::Dot>(A, B), rt, op::Parameters{A, B});
auto manager = runtime::Manager::get("NGVM"); auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f); auto external = manager->compile(f);
auto backend = manager->allocate_backend(); auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external); auto cf = backend->make_call_frame(external);
...@@ -524,7 +524,7 @@ TEST(execute, dot_matrix_3x2_2x0) ...@@ -524,7 +524,7 @@ TEST(execute, dot_matrix_3x2_2x0)
ASSERT_EQ((vector<float>{}), result->get_vector()); ASSERT_EQ((vector<float>{}), result->get_vector());
} }
TEST(execute, dot_scalar_0x2) TEST(${BACKEND_NAME}, dot_scalar_0x2)
{ {
auto shape_a = Shape{}; auto shape_a = Shape{};
auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape_a); auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape_a);
...@@ -534,7 +534,7 @@ TEST(execute, dot_scalar_0x2) ...@@ -534,7 +534,7 @@ TEST(execute, dot_scalar_0x2)
auto rt = make_shared<TensorViewType>(element::Float32::element_type(), shape_r); 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 f = make_shared<Function>(make_shared<op::Dot>(A, B), rt, op::Parameters{A, B});
auto manager = runtime::Manager::get("NGVM"); auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f); auto external = manager->compile(f);
auto backend = manager->allocate_backend(); auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external); auto cf = backend->make_call_frame(external);
...@@ -550,7 +550,7 @@ TEST(execute, dot_scalar_0x2) ...@@ -550,7 +550,7 @@ TEST(execute, dot_scalar_0x2)
ASSERT_EQ((vector<float>{}), result->get_vector()); ASSERT_EQ((vector<float>{}), result->get_vector());
} }
TEST(execute, dot_2x0_0) TEST(${BACKEND_NAME}, dot_2x0_0)
{ {
auto shape_a = Shape{2, 0}; auto shape_a = Shape{2, 0};
auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape_a); auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape_a);
...@@ -560,7 +560,7 @@ TEST(execute, dot_2x0_0) ...@@ -560,7 +560,7 @@ TEST(execute, dot_2x0_0)
auto rt = make_shared<TensorViewType>(element::Float32::element_type(), shape_r); 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 f = make_shared<Function>(make_shared<op::Dot>(A, B), rt, op::Parameters{A, B});
auto manager = runtime::Manager::get("NGVM"); auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f); auto external = manager->compile(f);
auto backend = manager->allocate_backend(); auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external); auto cf = backend->make_call_frame(external);
...@@ -576,7 +576,7 @@ TEST(execute, dot_2x0_0) ...@@ -576,7 +576,7 @@ TEST(execute, dot_2x0_0)
ASSERT_EQ((vector<float>{0, 0}), result->get_vector()); ASSERT_EQ((vector<float>{0, 0}), result->get_vector());
} }
TEST(execute, dot1d) TEST(${BACKEND_NAME}, dot1d)
{ {
auto shape = Shape{4}; auto shape = Shape{4};
auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape); auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape);
...@@ -585,7 +585,7 @@ TEST(execute, dot1d) ...@@ -585,7 +585,7 @@ TEST(execute, dot1d)
auto rt = make_shared<TensorViewType>(element::Float32::element_type(), Shape{}); 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 f = make_shared<Function>(make_shared<op::Dot>(A, B), rt, op::Parameters{A, B});
auto manager = runtime::Manager::get("NGVM"); auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f); auto external = manager->compile(f);
auto backend = manager->allocate_backend(); auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external); auto cf = backend->make_call_frame(external);
...@@ -601,7 +601,7 @@ TEST(execute, dot1d) ...@@ -601,7 +601,7 @@ TEST(execute, dot1d)
ASSERT_EQ((vector<float>{170}), result->get_vector()); ASSERT_EQ((vector<float>{170}), result->get_vector());
} }
TEST(execute, dot2d) TEST(${BACKEND_NAME}, dot2d)
{ {
auto shape = Shape{2, 2}; auto shape = Shape{2, 2};
auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape); auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape);
...@@ -610,7 +610,7 @@ TEST(execute, dot2d) ...@@ -610,7 +610,7 @@ TEST(execute, dot2d)
auto rt = make_shared<TensorViewType>(element::Float32::element_type(), shape); 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 f = make_shared<Function>(make_shared<op::Dot>(A, B), rt, op::Parameters{A, B});
auto manager = runtime::Manager::get("NGVM"); auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f); auto external = manager->compile(f);
auto backend = manager->allocate_backend(); auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external); auto cf = backend->make_call_frame(external);
...@@ -626,7 +626,7 @@ TEST(execute, dot2d) ...@@ -626,7 +626,7 @@ TEST(execute, dot2d)
ASSERT_EQ((vector<float>{19, 22, 43, 50}), result->get_vector()); ASSERT_EQ((vector<float>{19, 22, 43, 50}), result->get_vector());
} }
TEST(execute, dot_scalar_tensor_arg0) TEST(${BACKEND_NAME}, dot_scalar_tensor_arg0)
{ {
auto shape_a = Shape{}; auto shape_a = Shape{};
auto shape_b = Shape{2, 2, 2}; auto shape_b = Shape{2, 2, 2};
...@@ -635,7 +635,7 @@ TEST(execute, dot_scalar_tensor_arg0) ...@@ -635,7 +635,7 @@ TEST(execute, dot_scalar_tensor_arg0)
auto rt = make_shared<TensorViewType>(element::Float32::element_type(), shape_b); 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 f = make_shared<Function>(make_shared<op::Dot>(A, B), rt, op::Parameters{A, B});
auto manager = runtime::Manager::get("NGVM"); auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f); auto external = manager->compile(f);
auto backend = manager->allocate_backend(); auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external); auto cf = backend->make_call_frame(external);
...@@ -651,7 +651,7 @@ TEST(execute, dot_scalar_tensor_arg0) ...@@ -651,7 +651,7 @@ TEST(execute, dot_scalar_tensor_arg0)
ASSERT_EQ((vector<float>{6, 12, 18, 24, 30, 36, 42, 48}), result->get_vector()); ASSERT_EQ((vector<float>{6, 12, 18, 24, 30, 36, 42, 48}), result->get_vector());
} }
TEST(execute, dot_scalar_tensor_arg1) TEST(${BACKEND_NAME}, dot_scalar_tensor_arg1)
{ {
auto shape_a = Shape{2, 2, 2}; auto shape_a = Shape{2, 2, 2};
auto shape_b = Shape{}; auto shape_b = Shape{};
...@@ -660,7 +660,7 @@ TEST(execute, dot_scalar_tensor_arg1) ...@@ -660,7 +660,7 @@ TEST(execute, dot_scalar_tensor_arg1)
auto rt = make_shared<TensorViewType>(element::Float32::element_type(), shape_a); 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 f = make_shared<Function>(make_shared<op::Dot>(A, B), rt, op::Parameters{A, B});
auto manager = runtime::Manager::get("NGVM"); auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f); auto external = manager->compile(f);
auto backend = manager->allocate_backend(); auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external); auto cf = backend->make_call_frame(external);
...@@ -676,7 +676,7 @@ TEST(execute, dot_scalar_tensor_arg1) ...@@ -676,7 +676,7 @@ TEST(execute, dot_scalar_tensor_arg1)
ASSERT_EQ((vector<float>{6, 12, 18, 24, 30, 36, 42, 48}), result->get_vector()); ASSERT_EQ((vector<float>{6, 12, 18, 24, 30, 36, 42, 48}), result->get_vector());
} }
TEST(execute, dot_scalar_scalar) TEST(${BACKEND_NAME}, dot_scalar_scalar)
{ {
auto shape = Shape{}; auto shape = Shape{};
auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape); auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape);
...@@ -684,7 +684,7 @@ TEST(execute, dot_scalar_scalar) ...@@ -684,7 +684,7 @@ TEST(execute, dot_scalar_scalar)
auto rt = make_shared<TensorViewType>(element::Float32::element_type(), shape); 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 f = make_shared<Function>(make_shared<op::Dot>(A, B), rt, op::Parameters{A, B});
auto manager = runtime::Manager::get("NGVM"); auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f); auto external = manager->compile(f);
auto backend = manager->allocate_backend(); auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external); auto cf = backend->make_call_frame(external);
...@@ -700,7 +700,7 @@ TEST(execute, dot_scalar_scalar) ...@@ -700,7 +700,7 @@ TEST(execute, dot_scalar_scalar)
ASSERT_EQ((vector<float>{48}), result->get_vector()); ASSERT_EQ((vector<float>{48}), result->get_vector());
} }
TEST(execute, dot_matrix_vector) TEST(${BACKEND_NAME}, dot_matrix_vector)
{ {
auto shape_a = Shape{4, 4}; auto shape_a = Shape{4, 4};
auto shape_b = Shape{4}; auto shape_b = Shape{4};
...@@ -710,7 +710,7 @@ TEST(execute, dot_matrix_vector) ...@@ -710,7 +710,7 @@ TEST(execute, dot_matrix_vector)
auto f = make_shared<Function>(make_shared<op::Dot>(A, B), rt, op::Parameters{A, B}); auto f = make_shared<Function>(make_shared<op::Dot>(A, B), rt, op::Parameters{A, B});
auto shape_r = Shape{4}; auto shape_r = Shape{4};
auto manager = runtime::Manager::get("NGVM"); auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f); auto external = manager->compile(f);
auto backend = manager->allocate_backend(); auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external); auto cf = backend->make_call_frame(external);
...@@ -726,7 +726,7 @@ TEST(execute, dot_matrix_vector) ...@@ -726,7 +726,7 @@ TEST(execute, dot_matrix_vector)
ASSERT_EQ((vector<float>{190, 486, 782, 1078}), result->get_vector()); ASSERT_EQ((vector<float>{190, 486, 782, 1078}), result->get_vector());
} }
TEST(execute, dot_matrix_vector_int64) TEST(${BACKEND_NAME}, dot_matrix_vector_int64)
{ {
auto shape_a = Shape{4, 4}; auto shape_a = Shape{4, 4};
auto shape_b = Shape{4}; auto shape_b = Shape{4};
...@@ -736,7 +736,7 @@ TEST(execute, dot_matrix_vector_int64) ...@@ -736,7 +736,7 @@ TEST(execute, dot_matrix_vector_int64)
auto f = make_shared<Function>(make_shared<op::Dot>(A, B), rt, op::Parameters{A, B}); auto f = make_shared<Function>(make_shared<op::Dot>(A, B), rt, op::Parameters{A, B});
auto shape_r = Shape{4}; auto shape_r = Shape{4};
auto manager = runtime::Manager::get("NGVM"); auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f); auto external = manager->compile(f);
auto backend = manager->allocate_backend(); auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external); auto cf = backend->make_call_frame(external);
...@@ -752,7 +752,7 @@ TEST(execute, dot_matrix_vector_int64) ...@@ -752,7 +752,7 @@ TEST(execute, dot_matrix_vector_int64)
ASSERT_EQ((vector<element::Int64::type>{190, 486, 782, 1078}), result->get_vector()); ASSERT_EQ((vector<element::Int64::type>{190, 486, 782, 1078}), result->get_vector());
} }
TEST(execute, greater) TEST(${BACKEND_NAME}, greater)
{ {
auto shape = Shape{2, 2, 2}; auto shape = Shape{2, 2, 2};
auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape); auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape);
...@@ -760,7 +760,7 @@ TEST(execute, greater) ...@@ -760,7 +760,7 @@ TEST(execute, greater)
auto rt = make_shared<TensorViewType>(element::Bool::element_type(), shape); 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 f = make_shared<Function>(make_shared<op::Greater>(A, B), rt, op::Parameters{A, B});
auto manager = runtime::Manager::get("NGVM"); auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f); auto external = manager->compile(f);
auto backend = manager->allocate_backend(); auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external); auto cf = backend->make_call_frame(external);
...@@ -776,7 +776,7 @@ TEST(execute, greater) ...@@ -776,7 +776,7 @@ TEST(execute, greater)
ASSERT_EQ((vector<char>{0, 1, 0, 1, 0, 1, 1, 0}), result->get_vector()); ASSERT_EQ((vector<char>{0, 1, 0, 1, 0, 1, 1, 0}), result->get_vector());
} }
TEST(execute, greatereq) TEST(${BACKEND_NAME}, greatereq)
{ {
auto shape = Shape{2, 2, 2}; auto shape = Shape{2, 2, 2};
auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape); auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape);
...@@ -784,7 +784,7 @@ TEST(execute, greatereq) ...@@ -784,7 +784,7 @@ TEST(execute, greatereq)
auto rt = make_shared<TensorViewType>(element::Bool::element_type(), shape); 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 f = make_shared<Function>(make_shared<op::GreaterEq>(A, B), rt, op::Parameters{A, B});
auto manager = runtime::Manager::get("NGVM"); auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f); auto external = manager->compile(f);
auto backend = manager->allocate_backend(); auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external); auto cf = backend->make_call_frame(external);
...@@ -800,7 +800,7 @@ TEST(execute, greatereq) ...@@ -800,7 +800,7 @@ TEST(execute, greatereq)
ASSERT_EQ((vector<char>{1, 1, 1, 1, 0, 1, 1, 0}), result->get_vector()); ASSERT_EQ((vector<char>{1, 1, 1, 1, 0, 1, 1, 0}), result->get_vector());
} }
TEST(execute, less) TEST(${BACKEND_NAME}, less)
{ {
auto shape = Shape{2, 2, 2}; auto shape = Shape{2, 2, 2};
auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape); auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape);
...@@ -808,7 +808,7 @@ TEST(execute, less) ...@@ -808,7 +808,7 @@ TEST(execute, less)
auto rt = make_shared<TensorViewType>(element::Bool::element_type(), shape); 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 f = make_shared<Function>(make_shared<op::Less>(A, B), rt, op::Parameters{A, B});
auto manager = runtime::Manager::get("NGVM"); auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f); auto external = manager->compile(f);
auto backend = manager->allocate_backend(); auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external); auto cf = backend->make_call_frame(external);
...@@ -824,7 +824,7 @@ TEST(execute, less) ...@@ -824,7 +824,7 @@ TEST(execute, less)
ASSERT_EQ((vector<char>{0, 0, 1, 0, 1, 0, 0, 1}), result->get_vector()); ASSERT_EQ((vector<char>{0, 0, 1, 0, 1, 0, 0, 1}), result->get_vector());
} }
TEST(execute, lesseq) TEST(${BACKEND_NAME}, lesseq)
{ {
auto shape = Shape{2, 2, 2}; auto shape = Shape{2, 2, 2};
auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape); auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape);
...@@ -832,7 +832,7 @@ TEST(execute, lesseq) ...@@ -832,7 +832,7 @@ TEST(execute, lesseq)
auto rt = make_shared<TensorViewType>(element::Bool::element_type(), shape); 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 f = make_shared<Function>(make_shared<op::LessEq>(A, B), rt, op::Parameters{A, B});
auto manager = runtime::Manager::get("NGVM"); auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f); auto external = manager->compile(f);
auto backend = manager->allocate_backend(); auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external); auto cf = backend->make_call_frame(external);
...@@ -848,7 +848,7 @@ TEST(execute, lesseq) ...@@ -848,7 +848,7 @@ TEST(execute, lesseq)
ASSERT_EQ((vector<char>{1, 0, 1, 0, 1, 1, 0, 1}), result->get_vector()); ASSERT_EQ((vector<char>{1, 0, 1, 0, 1, 1, 0, 1}), result->get_vector());
} }
TEST(execute, lesseq_bool) TEST(${BACKEND_NAME}, lesseq_bool)
{ {
auto shape = Shape{2, 2, 2}; auto shape = Shape{2, 2, 2};
auto A = make_shared<op::Parameter>(element::Bool::element_type(), shape); auto A = make_shared<op::Parameter>(element::Bool::element_type(), shape);
...@@ -856,7 +856,7 @@ TEST(execute, lesseq_bool) ...@@ -856,7 +856,7 @@ TEST(execute, lesseq_bool)
auto rt = make_shared<TensorViewType>(element::Bool::element_type(), shape); 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 f = make_shared<Function>(make_shared<op::LessEq>(A, B), rt, op::Parameters{A, B});
auto manager = runtime::Manager::get("NGVM"); auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f); auto external = manager->compile(f);
auto backend = manager->allocate_backend(); auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external); auto cf = backend->make_call_frame(external);
...@@ -872,14 +872,14 @@ TEST(execute, lesseq_bool) ...@@ -872,14 +872,14 @@ TEST(execute, lesseq_bool)
ASSERT_EQ((vector<char>{0, 0, 0, 0, 0, 0, 0, 0}), result->get_vector()); ASSERT_EQ((vector<char>{0, 0, 0, 0, 0, 0, 0, 0}), result->get_vector());
} }
TEST(execute, log) TEST(${BACKEND_NAME}, log)
{ {
auto shape = Shape{2, 2, 2}; auto shape = Shape{2, 2, 2};
auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape); auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape);
auto rt = make_shared<TensorViewType>(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 f = make_shared<Function>(make_shared<op::Log>(A), rt, op::Parameters{A});
auto manager = runtime::Manager::get("NGVM"); auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f); auto external = manager->compile(f);
auto backend = manager->allocate_backend(); auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external); auto cf = backend->make_call_frame(external);
...@@ -898,7 +898,7 @@ TEST(execute, log) ...@@ -898,7 +898,7 @@ TEST(execute, log)
ASSERT_EQ(loga, result->get_vector()); ASSERT_EQ(loga, result->get_vector());
} }
TEST(execute, maximum) TEST(${BACKEND_NAME}, maximum)
{ {
auto shape = Shape{2, 2, 2}; auto shape = Shape{2, 2, 2};
auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape); auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape);
...@@ -906,7 +906,7 @@ TEST(execute, maximum) ...@@ -906,7 +906,7 @@ TEST(execute, maximum)
auto rt = make_shared<TensorViewType>(element::Float32::element_type(), shape); 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 f = make_shared<Function>(make_shared<op::Maximum>(A, B), rt, op::Parameters{A, B});
auto manager = runtime::Manager::get("NGVM"); auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f); auto external = manager->compile(f);
auto backend = manager->allocate_backend(); auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external); auto cf = backend->make_call_frame(external);
...@@ -922,7 +922,7 @@ TEST(execute, maximum) ...@@ -922,7 +922,7 @@ TEST(execute, maximum)
ASSERT_EQ((vector<float>{1, 8, 4, 17, 0, 0.5, 2, 1.5}), result->get_vector()); ASSERT_EQ((vector<float>{1, 8, 4, 17, 0, 0.5, 2, 1.5}), result->get_vector());
} }
TEST(execute, minimum) TEST(${BACKEND_NAME}, minimum)
{ {
auto shape = Shape{2, 2, 2}; auto shape = Shape{2, 2, 2};
auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape); auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape);
...@@ -930,7 +930,7 @@ TEST(execute, minimum) ...@@ -930,7 +930,7 @@ TEST(execute, minimum)
auto rt = make_shared<TensorViewType>(element::Float32::element_type(), shape); auto rt = make_shared<TensorViewType>(element::Float32::element_type(), shape);
auto f = make_shared<Function>(make_shared<op::Minimum>(A, B), rt, op::Parameters{A, B}); auto f = make_shared<Function>(make_shared<op::Minimum>(A, B), rt, op::Parameters{A, B});
auto manager = runtime::Manager::get("NGVM"); auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f); auto external = manager->compile(f);
auto backend = manager->allocate_backend(); auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external); auto cf = backend->make_call_frame(external);
...@@ -946,14 +946,14 @@ TEST(execute, minimum) ...@@ -946,14 +946,14 @@ TEST(execute, minimum)
ASSERT_EQ((vector<float>{1, 2, -8, 8, -.5, 0, 1, 1}), result->get_vector()); ASSERT_EQ((vector<float>{1, 2, -8, 8, -.5, 0, 1, 1}), result->get_vector());
} }
TEST(execute, negative) TEST(${BACKEND_NAME}, negative)
{ {
auto shape = Shape{2, 3}; auto shape = Shape{2, 3};
auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape); auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape);
auto rt = make_shared<TensorViewType>(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 f = make_shared<Function>(make_shared<op::Negative>(A), rt, op::Parameters{A});
auto manager = runtime::Manager::get("NGVM"); auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f); auto external = manager->compile(f);
auto backend = manager->allocate_backend(); auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external); auto cf = backend->make_call_frame(external);
...@@ -967,7 +967,7 @@ TEST(execute, negative) ...@@ -967,7 +967,7 @@ TEST(execute, negative)
ASSERT_EQ((vector<float>{-1, 2, 0, 4.8f, -8.6f, 8.6f}), result->get_vector()); ASSERT_EQ((vector<float>{-1, 2, 0, 4.8f, -8.6f, 8.6f}), result->get_vector());
} }
TEST(execute, notequal) TEST(${BACKEND_NAME}, notequal)
{ {
auto shape = Shape{2, 2, 2}; auto shape = Shape{2, 2, 2};
auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape); auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape);
...@@ -975,7 +975,7 @@ TEST(execute, notequal) ...@@ -975,7 +975,7 @@ TEST(execute, notequal)
auto rt = make_shared<TensorViewType>(element::Bool::element_type(), shape); 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 f = make_shared<Function>(make_shared<op::NotEqual>(A, B), rt, op::Parameters{A, B});
auto manager = runtime::Manager::get("NGVM"); auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f); auto external = manager->compile(f);
auto backend = manager->allocate_backend(); auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external); auto cf = backend->make_call_frame(external);
...@@ -991,7 +991,7 @@ TEST(execute, notequal) ...@@ -991,7 +991,7 @@ TEST(execute, notequal)
ASSERT_EQ((vector<char>{0, 0, 1, 1, 1, 0, 0, 1}), result->get_vector()); ASSERT_EQ((vector<char>{0, 0, 1, 1, 1, 0, 0, 1}), result->get_vector());
} }
TEST(execute, select) TEST(${BACKEND_NAME}, select)
{ {
auto shape = Shape{2, 2, 2}; auto shape = Shape{2, 2, 2};
auto A = make_shared<op::Parameter>(element::Bool::element_type(), shape); auto A = make_shared<op::Parameter>(element::Bool::element_type(), shape);
...@@ -1000,7 +1000,7 @@ TEST(execute, select) ...@@ -1000,7 +1000,7 @@ TEST(execute, select)
auto rt = make_shared<TensorViewType>(element::Float32::element_type(), shape); 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 f = make_shared<Function>(make_shared<op::Select>(A, B, C), rt, op::Parameters{A, B, C});
auto manager = runtime::Manager::get("NGVM"); auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f); auto external = manager->compile(f);
auto backend = manager->allocate_backend(); auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external); auto cf = backend->make_call_frame(external);
...@@ -1018,7 +1018,7 @@ TEST(execute, select) ...@@ -1018,7 +1018,7 @@ TEST(execute, select)
ASSERT_EQ((vector<float>{11, 2, 3, 14, 15, 6, 17, 8}), result->get_vector()); ASSERT_EQ((vector<float>{11, 2, 3, 14, 15, 6, 17, 8}), result->get_vector());
} }
TEST(execute, subtract) TEST(${BACKEND_NAME}, subtract)
{ {
auto shape = Shape{2, 2}; auto shape = Shape{2, 2};
auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape); auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape);
...@@ -1026,7 +1026,7 @@ TEST(execute, subtract) ...@@ -1026,7 +1026,7 @@ TEST(execute, subtract)
auto rt = make_shared<TensorViewType>(element::Float32::element_type(), shape); 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 f = make_shared<Function>(make_shared<op::Subtract>(A, B), rt, op::Parameters{A, B});
auto manager = runtime::Manager::get("NGVM"); auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f); auto external = manager->compile(f);
auto backend = manager->allocate_backend(); auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external); auto cf = backend->make_call_frame(external);
...@@ -1042,7 +1042,7 @@ TEST(execute, subtract) ...@@ -1042,7 +1042,7 @@ TEST(execute, subtract)
ASSERT_EQ((vector<float>{1, 2, 4, 8}), result->get_vector()); ASSERT_EQ((vector<float>{1, 2, 4, 8}), result->get_vector());
} }
TEST(execute, scalar_constant) TEST(${BACKEND_NAME}, scalar_constant)
{ {
auto shape = Shape{}; auto shape = Shape{};
auto t = ngraph::runtime::make_tensor<element::Float32>(shape); auto t = ngraph::runtime::make_tensor<element::Float32>(shape);
...@@ -1051,7 +1051,7 @@ TEST(execute, scalar_constant) ...@@ -1051,7 +1051,7 @@ TEST(execute, scalar_constant)
auto rt = make_shared<TensorViewType>(element::Float32::element_type(), shape); auto rt = make_shared<TensorViewType>(element::Float32::element_type(), shape);
auto f = make_shared<Function>(A, rt, op::Parameters{}); auto f = make_shared<Function>(A, rt, op::Parameters{});
auto manager = runtime::Manager::get("NGVM"); auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f); auto external = manager->compile(f);
auto backend = manager->allocate_backend(); auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external); auto cf = backend->make_call_frame(external);
...@@ -1063,7 +1063,7 @@ TEST(execute, scalar_constant) ...@@ -1063,7 +1063,7 @@ TEST(execute, scalar_constant)
ASSERT_EQ((vector<float>{-3.0f}), result->get_vector()); ASSERT_EQ((vector<float>{-3.0f}), result->get_vector());
} }
TEST(execute, tensor_constant) TEST(${BACKEND_NAME}, tensor_constant)
{ {
auto shape = Shape{2, 2, 2}; auto shape = Shape{2, 2, 2};
auto t = ngraph::runtime::make_tensor<element::Float32>(shape); auto t = ngraph::runtime::make_tensor<element::Float32>(shape);
...@@ -1072,7 +1072,7 @@ TEST(execute, tensor_constant) ...@@ -1072,7 +1072,7 @@ TEST(execute, tensor_constant)
auto rt = make_shared<TensorViewType>(element::Float32::element_type(), shape); auto rt = make_shared<TensorViewType>(element::Float32::element_type(), shape);
auto f = make_shared<Function>(A, rt, op::Parameters{}); auto f = make_shared<Function>(A, rt, op::Parameters{});
auto manager = runtime::Manager::get("NGVM"); auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f); auto external = manager->compile(f);
auto backend = manager->allocate_backend(); auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external); auto cf = backend->make_call_frame(external);
...@@ -1084,7 +1084,7 @@ TEST(execute, tensor_constant) ...@@ -1084,7 +1084,7 @@ TEST(execute, tensor_constant)
ASSERT_EQ((vector<float>{1, 2, 3, 4, 5, 6, 7, 8}), result->get_vector()); ASSERT_EQ((vector<float>{1, 2, 3, 4, 5, 6, 7, 8}), result->get_vector());
} }
TEST(execute, tensor_constant_with_op) TEST(${BACKEND_NAME}, tensor_constant_with_op)
{ {
auto shape = Shape{2, 2, 2}; auto shape = Shape{2, 2, 2};
auto t = ngraph::runtime::make_tensor<element::Float32>(shape); auto t = ngraph::runtime::make_tensor<element::Float32>(shape);
...@@ -1093,7 +1093,7 @@ TEST(execute, tensor_constant_with_op) ...@@ -1093,7 +1093,7 @@ TEST(execute, tensor_constant_with_op)
auto rt = make_shared<TensorViewType>(element::Float32::element_type(), shape); auto rt = make_shared<TensorViewType>(element::Float32::element_type(), shape);
auto f = make_shared<Function>(make_shared<op::Abs>(A), rt, op::Parameters{}); auto f = make_shared<Function>(make_shared<op::Abs>(A), rt, op::Parameters{});
auto manager = runtime::Manager::get("NGVM"); auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f); auto external = manager->compile(f);
auto backend = manager->allocate_backend(); auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external); auto cf = backend->make_call_frame(external);
...@@ -1105,7 +1105,7 @@ TEST(execute, tensor_constant_with_op) ...@@ -1105,7 +1105,7 @@ TEST(execute, tensor_constant_with_op)
ASSERT_EQ((vector<float>{1, 2, 3, 4, 5, 6, 7, 8}), result->get_vector()); ASSERT_EQ((vector<float>{1, 2, 3, 4, 5, 6, 7, 8}), result->get_vector());
} }
TEST(execute, function_call) TEST(${BACKEND_NAME}, function_call)
{ {
// First create "f(A,B,C) = (A+B)*C". // First create "f(A,B,C) = (A+B)*C".
auto shape = Shape{2, 2}; auto shape = Shape{2, 2};
...@@ -1126,7 +1126,7 @@ TEST(execute, function_call) ...@@ -1126,7 +1126,7 @@ TEST(execute, function_call)
op::Parameters{X, Y, Z}); op::Parameters{X, Y, Z});
// Now call g on some test vectors. // 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 external = manager->compile(g);
auto backend = manager->allocate_backend(); auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external); auto cf = backend->make_call_frame(external);
...@@ -1149,7 +1149,7 @@ TEST(execute, function_call) ...@@ -1149,7 +1149,7 @@ TEST(execute, function_call)
ASSERT_EQ((vector<float>{100, 144, 196, 256}), result->get_vector()); ASSERT_EQ((vector<float>{100, 144, 196, 256}), result->get_vector());
} }
TEST(execute, broadcast_scalar_vector) TEST(${BACKEND_NAME}, broadcast_scalar_vector)
{ {
auto shape_a = Shape{}; auto shape_a = Shape{};
auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape_a); auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape_a);
...@@ -1158,7 +1158,7 @@ TEST(execute, broadcast_scalar_vector) ...@@ -1158,7 +1158,7 @@ TEST(execute, broadcast_scalar_vector)
auto f = make_shared<Function>( auto f = make_shared<Function>(
make_shared<op::Broadcast>(A, shape_r, AxisSet{0}), rt, op::Parameters{A}); make_shared<op::Broadcast>(A, shape_r, 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 external = manager->compile(f);
auto backend = manager->allocate_backend(); auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external); auto cf = backend->make_call_frame(external);
...@@ -1172,7 +1172,7 @@ TEST(execute, broadcast_scalar_vector) ...@@ -1172,7 +1172,7 @@ TEST(execute, broadcast_scalar_vector)
ASSERT_EQ((vector<float>{6, 6, 6, 6}), result->get_vector()); ASSERT_EQ((vector<float>{6, 6, 6, 6}), result->get_vector());
} }
TEST(execute, broadcast_scalar_matrix) TEST(${BACKEND_NAME}, broadcast_scalar_matrix)
{ {
auto shape_a = Shape{}; auto shape_a = Shape{};
auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape_a); auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape_a);
...@@ -1181,7 +1181,7 @@ TEST(execute, broadcast_scalar_matrix) ...@@ -1181,7 +1181,7 @@ TEST(execute, broadcast_scalar_matrix)
auto f = make_shared<Function>( auto f = make_shared<Function>(
make_shared<op::Broadcast>(A, shape_r, AxisSet{0, 1}), rt, op::Parameters{A}); make_shared<op::Broadcast>(A, shape_r, 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 external = manager->compile(f);
auto backend = manager->allocate_backend(); auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external); auto cf = backend->make_call_frame(external);
...@@ -1195,7 +1195,7 @@ TEST(execute, broadcast_scalar_matrix) ...@@ -1195,7 +1195,7 @@ TEST(execute, broadcast_scalar_matrix)
ASSERT_EQ((vector<float>{6, 6, 6, 6}), result->get_vector()); ASSERT_EQ((vector<float>{6, 6, 6, 6}), result->get_vector());
} }
TEST(execute, broadcast_scalar_tensor) TEST(${BACKEND_NAME}, broadcast_scalar_tensor)
{ {
auto shape_a = Shape{}; auto shape_a = Shape{};
auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape_a); auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape_a);
...@@ -1204,7 +1204,7 @@ TEST(execute, broadcast_scalar_tensor) ...@@ -1204,7 +1204,7 @@ TEST(execute, broadcast_scalar_tensor)
auto f = make_shared<Function>( auto f = make_shared<Function>(
make_shared<op::Broadcast>(A, shape_r, AxisSet{0, 1, 2}), rt, op::Parameters{A}); make_shared<op::Broadcast>(A, shape_r, AxisSet{0, 1, 2}), rt, op::Parameters{A});
auto manager = runtime::Manager::get("NGVM"); auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f); auto external = manager->compile(f);
auto backend = manager->allocate_backend(); auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external); auto cf = backend->make_call_frame(external);
...@@ -1218,7 +1218,7 @@ TEST(execute, broadcast_scalar_tensor) ...@@ -1218,7 +1218,7 @@ TEST(execute, broadcast_scalar_tensor)
ASSERT_EQ((vector<float>{6, 6, 6, 6, 6, 6, 6, 6}), result->get_vector()); ASSERT_EQ((vector<float>{6, 6, 6, 6, 6, 6, 6, 6}), result->get_vector());
} }
TEST(execute, broadcast_trivial) TEST(${BACKEND_NAME}, broadcast_trivial)
{ {
auto shape = Shape{2, 2, 2}; auto shape = Shape{2, 2, 2};
auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape); auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape);
...@@ -1226,7 +1226,7 @@ TEST(execute, broadcast_trivial) ...@@ -1226,7 +1226,7 @@ TEST(execute, broadcast_trivial)
auto f = make_shared<Function>( auto f = make_shared<Function>(
make_shared<op::Broadcast>(A, shape, AxisSet{}), rt, op::Parameters{A}); make_shared<op::Broadcast>(A, shape, AxisSet{}), rt, op::Parameters{A});
auto manager = runtime::Manager::get("NGVM"); auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f); auto external = manager->compile(f);
auto backend = manager->allocate_backend(); auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external); auto cf = backend->make_call_frame(external);
...@@ -1240,7 +1240,7 @@ TEST(execute, broadcast_trivial) ...@@ -1240,7 +1240,7 @@ TEST(execute, broadcast_trivial)
ASSERT_EQ((vector<float>{2, 4, 6, 8, 16, 32, 64, 128}), result->get_vector()); ASSERT_EQ((vector<float>{2, 4, 6, 8, 16, 32, 64, 128}), result->get_vector());
} }
TEST(execute, broadcast_vector_colwise) TEST(${BACKEND_NAME}, broadcast_vector_colwise)
{ {
auto shape_a = Shape{3}; auto shape_a = Shape{3};
auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape_a); auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape_a);
...@@ -1249,7 +1249,7 @@ TEST(execute, broadcast_vector_colwise) ...@@ -1249,7 +1249,7 @@ TEST(execute, broadcast_vector_colwise)
auto f = make_shared<Function>( auto f = make_shared<Function>(
make_shared<op::Broadcast>(A, shape_r, AxisSet{1}), rt, op::Parameters{A}); make_shared<op::Broadcast>(A, shape_r, 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 external = manager->compile(f);
auto backend = manager->allocate_backend(); auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external); auto cf = backend->make_call_frame(external);
...@@ -1263,7 +1263,7 @@ TEST(execute, broadcast_vector_colwise) ...@@ -1263,7 +1263,7 @@ TEST(execute, broadcast_vector_colwise)
ASSERT_EQ((vector<float>{1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3}), result->get_vector()); ASSERT_EQ((vector<float>{1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3}), result->get_vector());
} }
TEST(execute, broadcast_vector_rowwise) TEST(${BACKEND_NAME}, broadcast_vector_rowwise)
{ {
auto shape_a = Shape{4}; auto shape_a = Shape{4};
auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape_a); auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape_a);
...@@ -1272,7 +1272,7 @@ TEST(execute, broadcast_vector_rowwise) ...@@ -1272,7 +1272,7 @@ TEST(execute, broadcast_vector_rowwise)
auto f = make_shared<Function>( auto f = make_shared<Function>(
make_shared<op::Broadcast>(A, shape_r, AxisSet{0}), rt, op::Parameters{A}); make_shared<op::Broadcast>(A, shape_r, 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 external = manager->compile(f);
auto backend = manager->allocate_backend(); auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external); auto cf = backend->make_call_frame(external);
...@@ -1286,7 +1286,7 @@ TEST(execute, broadcast_vector_rowwise) ...@@ -1286,7 +1286,7 @@ TEST(execute, broadcast_vector_rowwise)
ASSERT_EQ((vector<float>{1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4}), result->get_vector()); ASSERT_EQ((vector<float>{1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4}), result->get_vector());
} }
TEST(execute, broadcast_vector_rowwise_int64) TEST(${BACKEND_NAME}, broadcast_vector_rowwise_int64)
{ {
auto shape_a = Shape{4}; auto shape_a = Shape{4};
auto A = make_shared<op::Parameter>(element::Int64::element_type(), shape_a); auto A = make_shared<op::Parameter>(element::Int64::element_type(), shape_a);
...@@ -1295,7 +1295,7 @@ TEST(execute, broadcast_vector_rowwise_int64) ...@@ -1295,7 +1295,7 @@ TEST(execute, broadcast_vector_rowwise_int64)
auto f = make_shared<Function>( auto f = make_shared<Function>(
make_shared<op::Broadcast>(A, shape_r, AxisSet{0}), rt, op::Parameters{A}); make_shared<op::Broadcast>(A, shape_r, 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 external = manager->compile(f);
auto backend = manager->allocate_backend(); auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external); auto cf = backend->make_call_frame(external);
...@@ -1310,7 +1310,7 @@ TEST(execute, broadcast_vector_rowwise_int64) ...@@ -1310,7 +1310,7 @@ TEST(execute, broadcast_vector_rowwise_int64)
result->get_vector()); result->get_vector());
} }
TEST(execute, convert_int32_float32) TEST(${BACKEND_NAME}, convert_int32_float32)
{ {
auto shape = Shape{2, 2}; auto shape = Shape{2, 2};
auto A = make_shared<op::Parameter>(element::Int32::element_type(), shape); auto A = make_shared<op::Parameter>(element::Int32::element_type(), shape);
...@@ -1318,7 +1318,7 @@ TEST(execute, convert_int32_float32) ...@@ -1318,7 +1318,7 @@ TEST(execute, convert_int32_float32)
auto f = make_shared<Function>( auto f = make_shared<Function>(
make_shared<op::Convert>(A, element::Float32::element_type()), rt, op::Parameters{A}); make_shared<op::Convert>(A, element::Float32::element_type()), rt, op::Parameters{A});
auto manager = runtime::Manager::get("NGVM"); auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f); auto external = manager->compile(f);
auto backend = manager->allocate_backend(); auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external); auto cf = backend->make_call_frame(external);
...@@ -1332,7 +1332,7 @@ TEST(execute, convert_int32_float32) ...@@ -1332,7 +1332,7 @@ TEST(execute, convert_int32_float32)
ASSERT_EQ((vector<element::Float32::type>{1, 2, 3, 4}), result->get_vector()); ASSERT_EQ((vector<element::Float32::type>{1, 2, 3, 4}), result->get_vector());
} }
TEST(execute, convert_int32_bool) TEST(${BACKEND_NAME}, convert_int32_bool)
{ {
auto shape = Shape{2, 2}; auto shape = Shape{2, 2};
auto A = make_shared<op::Parameter>(element::Int32::element_type(), shape); auto A = make_shared<op::Parameter>(element::Int32::element_type(), shape);
...@@ -1340,7 +1340,7 @@ TEST(execute, convert_int32_bool) ...@@ -1340,7 +1340,7 @@ TEST(execute, convert_int32_bool)
auto f = make_shared<Function>( auto f = make_shared<Function>(
make_shared<op::Convert>(A, element::Bool::element_type()), rt, op::Parameters{A}); make_shared<op::Convert>(A, element::Bool::element_type()), rt, op::Parameters{A});
auto manager = runtime::Manager::get("NGVM"); auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f); auto external = manager->compile(f);
auto backend = manager->allocate_backend(); auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external); auto cf = backend->make_call_frame(external);
...@@ -1354,7 +1354,7 @@ TEST(execute, convert_int32_bool) ...@@ -1354,7 +1354,7 @@ TEST(execute, convert_int32_bool)
ASSERT_EQ((vector<element::Bool::type>{1, 2, 3, 4}), result->get_vector()); ASSERT_EQ((vector<element::Bool::type>{1, 2, 3, 4}), result->get_vector());
} }
TEST(execute, convert_float32_bool) TEST(${BACKEND_NAME}, convert_float32_bool)
{ {
auto shape = Shape{2, 2}; auto shape = Shape{2, 2};
auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape); auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape);
...@@ -1362,7 +1362,7 @@ TEST(execute, convert_float32_bool) ...@@ -1362,7 +1362,7 @@ TEST(execute, convert_float32_bool)
auto f = make_shared<Function>( auto f = make_shared<Function>(
make_shared<op::Convert>(A, element::Bool::element_type()), rt, op::Parameters{A}); make_shared<op::Convert>(A, element::Bool::element_type()), rt, op::Parameters{A});
auto manager = runtime::Manager::get("NGVM"); auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f); auto external = manager->compile(f);
auto backend = manager->allocate_backend(); auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external); auto cf = backend->make_call_frame(external);
...@@ -1377,7 +1377,7 @@ TEST(execute, convert_float32_bool) ...@@ -1377,7 +1377,7 @@ TEST(execute, convert_float32_bool)
} }
// Trivial case with no reduction axes. // 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). // First, the reduction function (f(x:float32[],y:float32[]) = x+y).
auto f_A = make_shared<op::Parameter>(element::Float32::element_type(), Shape{}); auto f_A = make_shared<op::Parameter>(element::Float32::element_type(), Shape{});
...@@ -1393,7 +1393,7 @@ TEST(execute, reduce_trivial) ...@@ -1393,7 +1393,7 @@ TEST(execute, reduce_trivial)
auto g = make_shared<Function>( auto g = make_shared<Function>(
make_shared<op::Reduce>(g_A, g_B, f, AxisSet{}), g_rt, op::Parameters{g_A, g_B}); 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 external = manager->compile(g);
auto backend = manager->allocate_backend(); auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external); auto cf = backend->make_call_frame(external);
...@@ -1409,7 +1409,7 @@ TEST(execute, reduce_trivial) ...@@ -1409,7 +1409,7 @@ TEST(execute, reduce_trivial)
ASSERT_EQ((vector<float>{1, 2, 3, 4}), result->get_vector()); 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). // First, the reduction function (f(x:float32[],y:float32[]) = x+y).
auto f_A = make_shared<op::Parameter>(element::Float32::element_type(), Shape{}); auto f_A = make_shared<op::Parameter>(element::Float32::element_type(), Shape{});
...@@ -1425,7 +1425,7 @@ TEST(execute, reduce_to_scalar) ...@@ -1425,7 +1425,7 @@ TEST(execute, reduce_to_scalar)
auto g = make_shared<Function>( 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}); 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 external = manager->compile(g);
auto backend = manager->allocate_backend(); auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external); auto cf = backend->make_call_frame(external);
...@@ -1446,7 +1446,7 @@ TEST(execute, reduce_to_scalar) ...@@ -1446,7 +1446,7 @@ TEST(execute, reduce_to_scalar)
ASSERT_EQ((vector<float>{0}), b->get_vector()); 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). // First, the reduction function (f(x:float32[],y:float32[]) = x+y).
auto f_A = make_shared<op::Parameter>(element::Float32::element_type(), Shape{}); auto f_A = make_shared<op::Parameter>(element::Float32::element_type(), Shape{});
...@@ -1463,7 +1463,7 @@ TEST(execute, reduce_matrix_columns) ...@@ -1463,7 +1463,7 @@ TEST(execute, reduce_matrix_columns)
auto g = make_shared<Function>( auto g = make_shared<Function>(
make_shared<op::Reduce>(g_A, g_B, f, AxisSet{0}), g_rt, op::Parameters{g_A, g_B}); 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 external = manager->compile(g);
auto backend = manager->allocate_backend(); auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external); auto cf = backend->make_call_frame(external);
...@@ -1484,7 +1484,7 @@ TEST(execute, reduce_matrix_columns) ...@@ -1484,7 +1484,7 @@ TEST(execute, reduce_matrix_columns)
ASSERT_EQ((vector<float>{0}), b->get_vector()); 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). // First, the reduction function (f(x:float32[],y:float32[]) = x+y).
auto f_A = make_shared<op::Parameter>(element::Float32::element_type(), Shape{}); auto f_A = make_shared<op::Parameter>(element::Float32::element_type(), Shape{});
...@@ -1501,7 +1501,7 @@ TEST(execute, reduce_matrix_rows) ...@@ -1501,7 +1501,7 @@ TEST(execute, reduce_matrix_rows)
auto g = make_shared<Function>( auto g = make_shared<Function>(
make_shared<op::Reduce>(g_A, g_B, f, AxisSet{1}), g_rt, op::Parameters{g_A, g_B}); 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 external = manager->compile(g);
auto backend = manager->allocate_backend(); auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external); auto cf = backend->make_call_frame(external);
...@@ -1522,7 +1522,7 @@ TEST(execute, reduce_matrix_rows) ...@@ -1522,7 +1522,7 @@ TEST(execute, reduce_matrix_rows)
ASSERT_EQ((vector<float>{0}), b->get_vector()); 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). // First, the reduction function (f(x:float32[],y:float32[]) = x+y).
auto f_A = make_shared<op::Parameter>(element::Float32::element_type(), Shape{}); auto f_A = make_shared<op::Parameter>(element::Float32::element_type(), Shape{});
...@@ -1539,7 +1539,7 @@ TEST(execute, reduce_matrix_rows_zero) ...@@ -1539,7 +1539,7 @@ TEST(execute, reduce_matrix_rows_zero)
auto g = make_shared<Function>( auto g = make_shared<Function>(
make_shared<op::Reduce>(g_A, g_B, f, AxisSet{1}), g_rt, op::Parameters{g_A, g_B}); 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 external = manager->compile(g);
auto backend = manager->allocate_backend(); auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external); auto cf = backend->make_call_frame(external);
...@@ -1560,7 +1560,7 @@ TEST(execute, reduce_matrix_rows_zero) ...@@ -1560,7 +1560,7 @@ TEST(execute, reduce_matrix_rows_zero)
ASSERT_EQ((vector<float>{66}), b->get_vector()); 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). // First, the reduction function (f(x:float32[],y:float32[]) = x+y).
auto f_A = make_shared<op::Parameter>(element::Float32::element_type(), Shape{}); auto f_A = make_shared<op::Parameter>(element::Float32::element_type(), Shape{});
...@@ -1577,7 +1577,7 @@ TEST(execute, reduce_matrix_cols_zero) ...@@ -1577,7 +1577,7 @@ TEST(execute, reduce_matrix_cols_zero)
auto g = make_shared<Function>( auto g = make_shared<Function>(
make_shared<op::Reduce>(g_A, g_B, f, AxisSet{0}), g_rt, op::Parameters{g_A, g_B}); 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 external = manager->compile(g);
auto backend = manager->allocate_backend(); auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external); auto cf = backend->make_call_frame(external);
...@@ -1598,7 +1598,7 @@ TEST(execute, reduce_matrix_cols_zero) ...@@ -1598,7 +1598,7 @@ TEST(execute, reduce_matrix_cols_zero)
ASSERT_EQ((vector<float>{77}), b->get_vector()); 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). // First, the reduction function (f(x:float32[],y:float32[]) = x+y).
auto f_A = make_shared<op::Parameter>(element::Float32::element_type(), Shape{}); auto f_A = make_shared<op::Parameter>(element::Float32::element_type(), Shape{});
...@@ -1615,7 +1615,7 @@ TEST(execute, reduce_vector_zero) ...@@ -1615,7 +1615,7 @@ TEST(execute, reduce_vector_zero)
auto g = make_shared<Function>( auto g = make_shared<Function>(
make_shared<op::Reduce>(g_A, g_B, f, AxisSet{0}), g_rt, op::Parameters{g_A, g_B}); 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 external = manager->compile(g);
auto backend = manager->allocate_backend(); auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external); auto cf = backend->make_call_frame(external);
...@@ -1636,7 +1636,7 @@ TEST(execute, reduce_vector_zero) ...@@ -1636,7 +1636,7 @@ TEST(execute, reduce_vector_zero)
ASSERT_EQ((vector<float>{88}), b->get_vector()); 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). // First, the reduction function (f(x:float32[],y:float32[]) = x+y).
auto f_A = make_shared<op::Parameter>(element::Float32::element_type(), Shape{}); auto f_A = make_shared<op::Parameter>(element::Float32::element_type(), Shape{});
...@@ -1653,7 +1653,7 @@ TEST(execute, reduce_matrix_to_scalar_zero_by_zero) ...@@ -1653,7 +1653,7 @@ TEST(execute, reduce_matrix_to_scalar_zero_by_zero)
auto g = make_shared<Function>( 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}); 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 external = manager->compile(g);
auto backend = manager->allocate_backend(); auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external); auto cf = backend->make_call_frame(external);
...@@ -1674,7 +1674,7 @@ TEST(execute, reduce_matrix_to_scalar_zero_by_zero) ...@@ -1674,7 +1674,7 @@ TEST(execute, reduce_matrix_to_scalar_zero_by_zero)
ASSERT_EQ((vector<float>{99}), b->get_vector()); 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 shape_a = Shape{2, 2, 3};
auto A = make_shared<op::Parameter>( auto A = make_shared<op::Parameter>(
...@@ -1684,7 +1684,7 @@ TEST(execute, reshape_t2v_012) ...@@ -1684,7 +1684,7 @@ TEST(execute, reshape_t2v_012)
auto r = make_shared<op::Reshape>(A, AxisVector{0, 1, 2}, shape_r); auto r = make_shared<op::Reshape>(A, AxisVector{0, 1, 2}, shape_r);
auto f = make_shared<Function>(r, rt, op::Parameters{A}); 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 external = manager->compile(f);
auto backend = manager->allocate_backend(); auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external); auto cf = backend->make_call_frame(external);
...@@ -1698,7 +1698,7 @@ TEST(execute, reshape_t2v_012) ...@@ -1698,7 +1698,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()); 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 shape_a = Shape{1, 1, 1};
auto A = make_shared<op::Parameter>( auto A = make_shared<op::Parameter>(
...@@ -1708,7 +1708,7 @@ TEST(execute, reshape_t2s_012) ...@@ -1708,7 +1708,7 @@ TEST(execute, reshape_t2s_012)
auto r = make_shared<op::Reshape>(A, AxisVector{0, 1, 2}, shape_r); auto r = make_shared<op::Reshape>(A, AxisVector{0, 1, 2}, shape_r);
auto f = make_shared<Function>(r, rt, op::Parameters{A}); 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 external = manager->compile(f);
auto backend = manager->allocate_backend(); auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external); auto cf = backend->make_call_frame(external);
...@@ -1722,7 +1722,7 @@ TEST(execute, reshape_t2s_012) ...@@ -1722,7 +1722,7 @@ TEST(execute, reshape_t2s_012)
ASSERT_EQ((vector<float>{6}), result->get_vector()); 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 shape_a = Shape{1, 1, 1};
auto A = make_shared<op::Parameter>( auto A = make_shared<op::Parameter>(
...@@ -1732,7 +1732,7 @@ TEST(execute, reshape_t2s_120) ...@@ -1732,7 +1732,7 @@ TEST(execute, reshape_t2s_120)
auto r = make_shared<op::Reshape>(A, AxisVector{1, 2, 0}, shape_r); auto r = make_shared<op::Reshape>(A, AxisVector{1, 2, 0}, shape_r);
auto f = make_shared<Function>(r, rt, op::Parameters{A}); 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 external = manager->compile(f);
auto backend = manager->allocate_backend(); auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external); auto cf = backend->make_call_frame(external);
...@@ -1746,7 +1746,7 @@ TEST(execute, reshape_t2s_120) ...@@ -1746,7 +1746,7 @@ TEST(execute, reshape_t2s_120)
ASSERT_EQ((vector<float>{6}), result->get_vector()); ASSERT_EQ((vector<float>{6}), result->get_vector());
} }
TEST(execute, reshape_s2t) TEST(${BACKEND_NAME}, reshape_s2t)
{ {
auto shape_a = Shape{}; auto shape_a = Shape{};
auto A = make_shared<op::Parameter>( auto A = make_shared<op::Parameter>(
...@@ -1756,7 +1756,7 @@ TEST(execute, reshape_s2t) ...@@ -1756,7 +1756,7 @@ TEST(execute, reshape_s2t)
auto r = make_shared<op::Reshape>(A, AxisVector{}, shape_r); auto r = make_shared<op::Reshape>(A, AxisVector{}, shape_r);
auto f = make_shared<Function>(r, rt, op::Parameters{A}); 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 external = manager->compile(f);
auto backend = manager->allocate_backend(); auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external); auto cf = backend->make_call_frame(external);
...@@ -1770,7 +1770,7 @@ TEST(execute, reshape_s2t) ...@@ -1770,7 +1770,7 @@ TEST(execute, reshape_s2t)
ASSERT_EQ((vector<float>{42}), result->get_vector()); 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 shape_a = Shape{3};
auto A = make_shared<op::Parameter>( auto A = make_shared<op::Parameter>(
...@@ -1780,7 +1780,7 @@ TEST(execute, reshape_v2m_col) ...@@ -1780,7 +1780,7 @@ TEST(execute, reshape_v2m_col)
auto r = make_shared<op::Reshape>(A, AxisVector{0}, shape_r); auto r = make_shared<op::Reshape>(A, AxisVector{0}, shape_r);
auto f = make_shared<Function>(r, rt, op::Parameters{A}); 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 external = manager->compile(f);
auto backend = manager->allocate_backend(); auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external); auto cf = backend->make_call_frame(external);
...@@ -1794,7 +1794,7 @@ TEST(execute, reshape_v2m_col) ...@@ -1794,7 +1794,7 @@ TEST(execute, reshape_v2m_col)
ASSERT_EQ((vector<float>{1, 2, 3}), result->get_vector()); 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 shape_a = Shape{3};
auto A = make_shared<op::Parameter>( auto A = make_shared<op::Parameter>(
...@@ -1804,7 +1804,7 @@ TEST(execute, reshape_v2m_row) ...@@ -1804,7 +1804,7 @@ TEST(execute, reshape_v2m_row)
auto r = make_shared<op::Reshape>(A, AxisVector{0}, shape_r); auto r = make_shared<op::Reshape>(A, AxisVector{0}, shape_r);
auto f = make_shared<Function>(r, rt, op::Parameters{A}); 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 external = manager->compile(f);
auto backend = manager->allocate_backend(); auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external); auto cf = backend->make_call_frame(external);
...@@ -1818,7 +1818,7 @@ TEST(execute, reshape_v2m_row) ...@@ -1818,7 +1818,7 @@ TEST(execute, reshape_v2m_row)
ASSERT_EQ((vector<float>{1, 2, 3}), result->get_vector()); 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 shape_a = Shape{3};
auto A = make_shared<op::Parameter>( auto A = make_shared<op::Parameter>(
...@@ -1828,7 +1828,7 @@ TEST(execute, reshape_v2t_middle) ...@@ -1828,7 +1828,7 @@ TEST(execute, reshape_v2t_middle)
auto r = make_shared<op::Reshape>(A, AxisVector{0}, shape_r); auto r = make_shared<op::Reshape>(A, AxisVector{0}, shape_r);
auto f = make_shared<Function>(r, rt, op::Parameters{A}); 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 external = manager->compile(f);
auto backend = manager->allocate_backend(); auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external); auto cf = backend->make_call_frame(external);
...@@ -1842,7 +1842,7 @@ TEST(execute, reshape_v2t_middle) ...@@ -1842,7 +1842,7 @@ TEST(execute, reshape_v2t_middle)
ASSERT_EQ((vector<float>{1, 2, 3}), result->get_vector()); 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 shape_a = Shape{3, 3};
auto A = make_shared<op::Parameter>( auto A = make_shared<op::Parameter>(
...@@ -1852,7 +1852,7 @@ TEST(execute, reshape_m2m_same) ...@@ -1852,7 +1852,7 @@ TEST(execute, reshape_m2m_same)
auto r = make_shared<op::Reshape>(A, AxisVector{0, 1}, shape_r); auto r = make_shared<op::Reshape>(A, AxisVector{0, 1}, shape_r);
auto f = make_shared<Function>(r, rt, op::Parameters{A}); 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 external = manager->compile(f);
auto backend = manager->allocate_backend(); auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external); auto cf = backend->make_call_frame(external);
...@@ -1866,7 +1866,7 @@ TEST(execute, reshape_m2m_same) ...@@ -1866,7 +1866,7 @@ TEST(execute, reshape_m2m_same)
ASSERT_EQ((vector<float>{1, 2, 3, 4, 5, 6, 7, 8, 9}), result->get_vector()); 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 shape_a = Shape{3, 3};
auto A = make_shared<op::Parameter>( auto A = make_shared<op::Parameter>(
...@@ -1876,7 +1876,7 @@ TEST(execute, reshape_m2m_transpose) ...@@ -1876,7 +1876,7 @@ TEST(execute, reshape_m2m_transpose)
auto r = make_shared<op::Reshape>(A, AxisVector{1, 0}, shape_r); auto r = make_shared<op::Reshape>(A, AxisVector{1, 0}, shape_r);
auto f = make_shared<Function>(r, rt, op::Parameters{A}); 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 external = manager->compile(f);
auto backend = manager->allocate_backend(); auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external); auto cf = backend->make_call_frame(external);
...@@ -1890,7 +1890,7 @@ TEST(execute, reshape_m2m_transpose) ...@@ -1890,7 +1890,7 @@ TEST(execute, reshape_m2m_transpose)
ASSERT_EQ((vector<float>{1, 4, 7, 2, 5, 8, 3, 6, 9}), result->get_vector()); 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 shape_a = Shape{3, 2};
auto A = make_shared<op::Parameter>( auto A = make_shared<op::Parameter>(
...@@ -1900,7 +1900,7 @@ TEST(execute, reshape_m2m_dim_change_transpose) ...@@ -1900,7 +1900,7 @@ TEST(execute, reshape_m2m_dim_change_transpose)
auto r = make_shared<op::Reshape>(A, AxisVector{1, 0}, shape_r); auto r = make_shared<op::Reshape>(A, AxisVector{1, 0}, shape_r);
auto f = make_shared<Function>(r, rt, op::Parameters{A}); 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 external = manager->compile(f);
auto backend = manager->allocate_backend(); auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external); auto cf = backend->make_call_frame(external);
...@@ -1914,14 +1914,14 @@ TEST(execute, reshape_m2m_dim_change_transpose) ...@@ -1914,14 +1914,14 @@ TEST(execute, reshape_m2m_dim_change_transpose)
ASSERT_EQ((vector<float>{1, 3, 5, 2, 4, 6}), result->get_vector()); 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 shape = Shape{6};
auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape); auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape);
auto result_type = make_shared<TensorViewType>(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 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 external = manager->compile(f);
auto backend = manager->allocate_backend(); auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external); auto cf = backend->make_call_frame(external);
...@@ -1940,14 +1940,14 @@ TEST(execute, sin) ...@@ -1940,14 +1940,14 @@ TEST(execute, sin)
ASSERT_EQ(input, result->get_vector()); ASSERT_EQ(input, result->get_vector());
} }
TEST(execute, cos) TEST(${BACKEND_NAME}, cos)
{ {
auto shape = Shape{6}; auto shape = Shape{6};
auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape); auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape);
auto result_type = make_shared<TensorViewType>(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 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 external = manager->compile(f);
auto backend = manager->allocate_backend(); auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external); auto cf = backend->make_call_frame(external);
...@@ -1966,14 +1966,14 @@ TEST(execute, cos) ...@@ -1966,14 +1966,14 @@ TEST(execute, cos)
ASSERT_EQ(input, result->get_vector()); ASSERT_EQ(input, result->get_vector());
} }
TEST(execute, tan) TEST(${BACKEND_NAME}, tan)
{ {
auto shape = Shape{6}; auto shape = Shape{6};
auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape); auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape);
auto result_type = make_shared<TensorViewType>(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 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 external = manager->compile(f);
auto backend = manager->allocate_backend(); auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external); auto cf = backend->make_call_frame(external);
...@@ -1992,14 +1992,14 @@ TEST(execute, tan) ...@@ -1992,14 +1992,14 @@ TEST(execute, tan)
ASSERT_EQ(input, result->get_vector()); ASSERT_EQ(input, result->get_vector());
} }
TEST(execute, asin) TEST(${BACKEND_NAME}, asin)
{ {
auto shape = Shape{6}; auto shape = Shape{6};
auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape); auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape);
auto result_type = make_shared<TensorViewType>(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 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 external = manager->compile(f);
auto backend = manager->allocate_backend(); auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external); auto cf = backend->make_call_frame(external);
...@@ -2017,14 +2017,14 @@ TEST(execute, asin) ...@@ -2017,14 +2017,14 @@ TEST(execute, asin)
ASSERT_EQ(input, result->get_vector()); ASSERT_EQ(input, result->get_vector());
} }
TEST(execute, acos) TEST(${BACKEND_NAME}, acos)
{ {
auto shape = Shape{6}; auto shape = Shape{6};
auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape); auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape);
auto result_type = make_shared<TensorViewType>(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 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 external = manager->compile(f);
auto backend = manager->allocate_backend(); auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external); auto cf = backend->make_call_frame(external);
...@@ -2042,14 +2042,14 @@ TEST(execute, acos) ...@@ -2042,14 +2042,14 @@ TEST(execute, acos)
ASSERT_EQ(input, result->get_vector()); ASSERT_EQ(input, result->get_vector());
} }
TEST(execute, atan) TEST(${BACKEND_NAME}, atan)
{ {
auto shape = Shape{6}; auto shape = Shape{6};
auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape); auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape);
auto result_type = make_shared<TensorViewType>(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 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 external = manager->compile(f);
auto backend = manager->allocate_backend(); auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external); auto cf = backend->make_call_frame(external);
...@@ -2067,14 +2067,14 @@ TEST(execute, atan) ...@@ -2067,14 +2067,14 @@ TEST(execute, atan)
ASSERT_EQ(input, result->get_vector()); ASSERT_EQ(input, result->get_vector());
} }
TEST(execute, sinh) TEST(${BACKEND_NAME}, sinh)
{ {
auto shape = Shape{6}; auto shape = Shape{6};
auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape); auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape);
auto result_type = make_shared<TensorViewType>(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 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 external = manager->compile(f);
auto backend = manager->allocate_backend(); auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external); auto cf = backend->make_call_frame(external);
...@@ -2092,14 +2092,14 @@ TEST(execute, sinh) ...@@ -2092,14 +2092,14 @@ TEST(execute, sinh)
ASSERT_EQ(input, result->get_vector()); ASSERT_EQ(input, result->get_vector());
} }
TEST(execute, cosh) TEST(${BACKEND_NAME}, cosh)
{ {
auto shape = Shape{6}; auto shape = Shape{6};
auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape); auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape);
auto result_type = make_shared<TensorViewType>(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 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 external = manager->compile(f);
auto backend = manager->allocate_backend(); auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external); auto cf = backend->make_call_frame(external);
...@@ -2117,14 +2117,14 @@ TEST(execute, cosh) ...@@ -2117,14 +2117,14 @@ TEST(execute, cosh)
ASSERT_EQ(input, result->get_vector()); ASSERT_EQ(input, result->get_vector());
} }
TEST(execute, tanh) TEST(${BACKEND_NAME}, tanh)
{ {
auto shape = Shape{6}; auto shape = Shape{6};
auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape); auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape);
auto result_type = make_shared<TensorViewType>(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 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 external = manager->compile(f);
auto backend = manager->allocate_backend(); auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external); auto cf = backend->make_call_frame(external);
...@@ -2142,14 +2142,14 @@ TEST(execute, tanh) ...@@ -2142,14 +2142,14 @@ TEST(execute, tanh)
ASSERT_EQ(input, result->get_vector()); ASSERT_EQ(input, result->get_vector());
} }
TEST(execute, exp) TEST(${BACKEND_NAME}, exp)
{ {
auto shape = Shape{8}; auto shape = Shape{8};
auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape); auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape);
auto result_type = make_shared<TensorViewType>(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 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 external = manager->compile(f);
auto backend = manager->allocate_backend(); auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external); auto cf = backend->make_call_frame(external);
...@@ -2165,7 +2165,7 @@ TEST(execute, exp) ...@@ -2165,7 +2165,7 @@ TEST(execute, exp)
result->get_vector()); result->get_vector());
} }
TEST(execute, slice_scalar) TEST(${BACKEND_NAME}, slice_scalar)
{ {
auto shape_a = Shape{}; auto shape_a = Shape{};
auto A = make_shared<op::Parameter>( auto A = make_shared<op::Parameter>(
...@@ -2175,7 +2175,7 @@ TEST(execute, slice_scalar) ...@@ -2175,7 +2175,7 @@ TEST(execute, slice_scalar)
auto r = make_shared<op::Slice>(A, Coordinate{}, Coordinate{}); auto r = make_shared<op::Slice>(A, Coordinate{}, Coordinate{});
auto f = make_shared<Function>(r, rt, op::Parameters{A}); 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 external = manager->compile(f);
auto backend = manager->allocate_backend(); auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external); auto cf = backend->make_call_frame(external);
...@@ -2189,7 +2189,7 @@ TEST(execute, slice_scalar) ...@@ -2189,7 +2189,7 @@ TEST(execute, slice_scalar)
ASSERT_EQ((vector<float>{312}), result->get_vector()); ASSERT_EQ((vector<float>{312}), result->get_vector());
} }
TEST(execute, slice_matrix) TEST(${BACKEND_NAME}, slice_matrix)
{ {
auto shape_a = Shape{4, 4}; auto shape_a = Shape{4, 4};
auto A = make_shared<op::Parameter>( auto A = make_shared<op::Parameter>(
...@@ -2199,7 +2199,7 @@ TEST(execute, slice_matrix) ...@@ -2199,7 +2199,7 @@ TEST(execute, slice_matrix)
auto r = make_shared<op::Slice>(A, Coordinate{0, 1}, Coordinate{3, 3}); auto r = make_shared<op::Slice>(A, Coordinate{0, 1}, Coordinate{3, 3});
auto f = make_shared<Function>(r, rt, op::Parameters{A}); 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 external = manager->compile(f);
auto backend = manager->allocate_backend(); auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external); auto cf = backend->make_call_frame(external);
...@@ -2213,7 +2213,7 @@ TEST(execute, slice_matrix) ...@@ -2213,7 +2213,7 @@ TEST(execute, slice_matrix)
ASSERT_EQ((vector<float>{2, 3, 6, 7, 10, 11}), result->get_vector()); 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 shape_a = Shape{16};
auto A = make_shared<op::Parameter>( auto A = make_shared<op::Parameter>(
...@@ -2223,7 +2223,7 @@ TEST(execute, slice_vector) ...@@ -2223,7 +2223,7 @@ TEST(execute, slice_vector)
auto r = make_shared<op::Slice>(A, Coordinate{2}, Coordinate{14}); auto r = make_shared<op::Slice>(A, Coordinate{2}, Coordinate{14});
auto f = make_shared<Function>(r, rt, op::Parameters{A}); 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 external = manager->compile(f);
auto backend = manager->allocate_backend(); auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external); auto cf = backend->make_call_frame(external);
...@@ -2237,13 +2237,13 @@ TEST(execute, slice_vector) ...@@ -2237,13 +2237,13 @@ TEST(execute, slice_vector)
ASSERT_EQ((vector<float>{2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13}), result->get_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 rt = make_shared<TensorViewType>(element::Float32::element_type(), Shape{});
auto r = make_shared<op::Constant>(element::Float32::element_type(), Shape{}, "4.8"); auto r = make_shared<op::Constant>(element::Float32::element_type(), Shape{}, "4.8");
auto f = make_shared<Function>(r, rt, op::Parameters{}); 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 external = manager->compile(f);
auto backend = manager->allocate_backend(); auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external); auto cf = backend->make_call_frame(external);
...@@ -2255,13 +2255,13 @@ TEST(execute, scalar_constant_float32) ...@@ -2255,13 +2255,13 @@ TEST(execute, scalar_constant_float32)
ASSERT_EQ(vector<float>{std::strtof("4.8", NULL)}, result->get_vector()); 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 rt = make_shared<TensorViewType>(element::Int64::element_type(), Shape{});
auto r = make_shared<op::Constant>(element::Int64::element_type(), Shape{}, "2112"); auto r = make_shared<op::Constant>(element::Int64::element_type(), Shape{}, "2112");
auto f = make_shared<Function>(r, rt, op::Parameters{}); 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 external = manager->compile(f);
auto backend = manager->allocate_backend(); auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external); auto cf = backend->make_call_frame(external);
...@@ -2273,7 +2273,7 @@ TEST(execute, scalar_constant_int64) ...@@ -2273,7 +2273,7 @@ TEST(execute, scalar_constant_int64)
ASSERT_EQ(vector<element::Int64::type>{std::strtol("2112", NULL, 10)}, result->get_vector()); 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 shape = Shape{2, 2};
auto rt = make_shared<TensorViewType>(element::Float32::element_type(), shape); auto rt = make_shared<TensorViewType>(element::Float32::element_type(), shape);
...@@ -2282,7 +2282,7 @@ TEST(execute, tensor_constant_float32) ...@@ -2282,7 +2282,7 @@ TEST(execute, tensor_constant_float32)
std::vector<std::string>{"4.8", "4.7", "-5.3", "0"}); std::vector<std::string>{"4.8", "4.7", "-5.3", "0"});
auto f = make_shared<Function>(r, rt, op::Parameters{}); 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 external = manager->compile(f);
auto backend = manager->allocate_backend(); auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external); auto cf = backend->make_call_frame(external);
...@@ -2298,7 +2298,7 @@ TEST(execute, tensor_constant_float32) ...@@ -2298,7 +2298,7 @@ TEST(execute, tensor_constant_float32)
result->get_vector()); result->get_vector());
} }
TEST(execute, tensor_constant_int64) TEST(${BACKEND_NAME}, tensor_constant_int64)
{ {
auto shape = Shape{2, 2}; auto shape = Shape{2, 2};
auto rt = make_shared<TensorViewType>(element::Int64::element_type(), shape); auto rt = make_shared<TensorViewType>(element::Int64::element_type(), shape);
...@@ -2307,7 +2307,7 @@ TEST(execute, tensor_constant_int64) ...@@ -2307,7 +2307,7 @@ TEST(execute, tensor_constant_int64)
std::vector<std::string>{"2112", "1848", "1776", "1964"}); std::vector<std::string>{"2112", "1848", "1776", "1964"});
auto f = make_shared<Function>(r, rt, op::Parameters{}); 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 external = manager->compile(f);
auto backend = manager->allocate_backend(); auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external); auto cf = backend->make_call_frame(external);
...@@ -2324,14 +2324,14 @@ TEST(execute, tensor_constant_int64) ...@@ -2324,14 +2324,14 @@ TEST(execute, tensor_constant_int64)
} }
// Trivial case with no summed axes. // Trivial case with no summed axes.
TEST(execute, sum_trivial) TEST(${BACKEND_NAME}, sum_trivial)
{ {
auto shape = Shape{2, 2}; auto shape = Shape{2, 2};
auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape); auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape);
auto rt = make_shared<TensorViewType>(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 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 external = manager->compile(f);
auto backend = manager->allocate_backend(); auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external); auto cf = backend->make_call_frame(external);
...@@ -2345,14 +2345,14 @@ TEST(execute, sum_trivial) ...@@ -2345,14 +2345,14 @@ TEST(execute, sum_trivial)
ASSERT_EQ((vector<float>{1, 2, 3, 4}), result->get_vector()); 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 shape = Shape{2, 2};
auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape); auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape);
auto rt = make_shared<TensorViewType>(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 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 external = manager->compile(f);
auto backend = manager->allocate_backend(); auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external); auto cf = backend->make_call_frame(external);
...@@ -2370,7 +2370,7 @@ TEST(execute, sum_to_scalar) ...@@ -2370,7 +2370,7 @@ TEST(execute, sum_to_scalar)
ASSERT_EQ((vector<float>{1, 2, 3, 4}), a->get_vector()); 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 shape_a = Shape{3, 2};
auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape_a); auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape_a);
...@@ -2378,7 +2378,7 @@ TEST(execute, sum_matrix_columns) ...@@ -2378,7 +2378,7 @@ TEST(execute, sum_matrix_columns)
auto rt = make_shared<TensorViewType>(element::Float32::element_type(), shape_rt); 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 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 external = manager->compile(f);
auto backend = manager->allocate_backend(); auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external); auto cf = backend->make_call_frame(external);
...@@ -2396,7 +2396,7 @@ TEST(execute, sum_matrix_columns) ...@@ -2396,7 +2396,7 @@ TEST(execute, sum_matrix_columns)
ASSERT_EQ((vector<float>{1, 2, 3, 4, 5, 6}), a->get_vector()); 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 shape_a = Shape{3, 2};
auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape_a); auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape_a);
...@@ -2404,7 +2404,7 @@ TEST(execute, sum_matrix_rows) ...@@ -2404,7 +2404,7 @@ TEST(execute, sum_matrix_rows)
auto rt = make_shared<TensorViewType>(element::Float32::element_type(), shape_rt); 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 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 external = manager->compile(f);
auto backend = manager->allocate_backend(); auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external); auto cf = backend->make_call_frame(external);
...@@ -2422,7 +2422,7 @@ TEST(execute, sum_matrix_rows) ...@@ -2422,7 +2422,7 @@ TEST(execute, sum_matrix_rows)
ASSERT_EQ((vector<float>{1, 2, 3, 4, 5, 6}), a->get_vector()); 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 shape_a = Shape{3, 0};
auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape_a); auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape_a);
...@@ -2430,7 +2430,7 @@ TEST(execute, sum_matrix_rows_zero) ...@@ -2430,7 +2430,7 @@ TEST(execute, sum_matrix_rows_zero)
auto rt = make_shared<TensorViewType>(element::Float32::element_type(), shape_rt); 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 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 external = manager->compile(f);
auto backend = manager->allocate_backend(); auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external); auto cf = backend->make_call_frame(external);
...@@ -2448,7 +2448,7 @@ TEST(execute, sum_matrix_rows_zero) ...@@ -2448,7 +2448,7 @@ TEST(execute, sum_matrix_rows_zero)
ASSERT_EQ((vector<float>{}), a->get_vector()); 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={})). // Now the reduction (g(x:float32[2,2],y:float32[]) = reduce(x,y,f,axes={})).
auto shape_a = Shape{0, 2}; auto shape_a = Shape{0, 2};
...@@ -2457,7 +2457,7 @@ TEST(execute, sum_matrix_cols_zero) ...@@ -2457,7 +2457,7 @@ TEST(execute, sum_matrix_cols_zero)
auto rt = make_shared<TensorViewType>(element::Float32::element_type(), shape_rt); 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 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 external = manager->compile(f);
auto backend = manager->allocate_backend(); auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external); auto cf = backend->make_call_frame(external);
...@@ -2475,7 +2475,7 @@ TEST(execute, sum_matrix_cols_zero) ...@@ -2475,7 +2475,7 @@ TEST(execute, sum_matrix_cols_zero)
ASSERT_EQ((vector<float>{}), a->get_vector()); ASSERT_EQ((vector<float>{}), a->get_vector());
} }
TEST(execute, sum_vector_zero) TEST(${BACKEND_NAME}, sum_vector_zero)
{ {
auto shape_a = Shape{0}; auto shape_a = Shape{0};
auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape_a); auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape_a);
...@@ -2483,7 +2483,7 @@ TEST(execute, sum_vector_zero) ...@@ -2483,7 +2483,7 @@ TEST(execute, sum_vector_zero)
auto rt = make_shared<TensorViewType>(element::Float32::element_type(), shape_rt); 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 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 external = manager->compile(f);
auto backend = manager->allocate_backend(); auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external); auto cf = backend->make_call_frame(external);
...@@ -2501,7 +2501,7 @@ TEST(execute, sum_vector_zero) ...@@ -2501,7 +2501,7 @@ TEST(execute, sum_vector_zero)
ASSERT_EQ((vector<float>{}), a->get_vector()); 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 shape_a = Shape{0, 0};
auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape_a); auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape_a);
...@@ -2509,7 +2509,7 @@ TEST(execute, sum_matrix_to_scalar_zero_by_zero) ...@@ -2509,7 +2509,7 @@ TEST(execute, sum_matrix_to_scalar_zero_by_zero)
auto rt = make_shared<TensorViewType>(element::Float32::element_type(), shape_rt); 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 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 external = manager->compile(f);
auto backend = manager->allocate_backend(); auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external); auto cf = backend->make_call_frame(external);
...@@ -2527,14 +2527,14 @@ TEST(execute, sum_matrix_to_scalar_zero_by_zero) ...@@ -2527,14 +2527,14 @@ TEST(execute, sum_matrix_to_scalar_zero_by_zero)
ASSERT_EQ((vector<float>{}), a->get_vector()); ASSERT_EQ((vector<float>{}), a->get_vector());
} }
TEST(execute, sign) TEST(${BACKEND_NAME}, sign)
{ {
auto shape = Shape{2, 3}; auto shape = Shape{2, 3};
auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape); auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape);
auto result_type = make_shared<TensorViewType>(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 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 external = manager->compile(f);
auto backend = manager->allocate_backend(); auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external); 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