Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
N
ngraph
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ngraph
Commits
87b5baa1
Commit
87b5baa1
authored
Dec 04, 2019
by
Sang Ik Lee
Committed by
Scott Cyphers
Dec 04, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Fluid test. (#3987)
* Add FLuid test. * Fix typo. * Fix Typo.
parent
bc23562a
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
148 additions
and
0 deletions
+148
-0
CMakeLists.txt
src/ngraph/frontend/CMakeLists.txt
+3
-0
CMakeLists.txt
src/ngraph/frontend/fluid/CMakeLists.txt
+4
-0
CMakeLists.txt
src/ngraph/frontend/fluid/operators/test/CMakeLists.txt
+77
-0
main.cpp
src/ngraph/frontend/fluid/operators/test/main.cpp
+62
-0
reduce_sum.cpp
src/ngraph/frontend/fluid/operators/test/reduce_sum.cpp
+0
-0
test.manifest
src/ngraph/frontend/fluid/operators/test/test.manifest
+2
-0
No files found.
src/ngraph/frontend/CMakeLists.txt
View file @
87b5baa1
...
...
@@ -26,5 +26,8 @@ NORMALIZE_BOOL(NGRAPH_FLUID_ENABLE)
message
(
STATUS
"NGRAPH_FLUID_ENABLE:
${
NGRAPH_FLUID_ENABLE
}
"
)
if
(
NGRAPH_FLUID_ENABLE
)
option
(
NGRAPH_FLUID_TEST_ENABLE
"Enable PaddlePaddle Fluid operator tests"
OFF
)
NORMALIZE_BOOL
(
NGRAPH_FLUID_TEST_ENABLE
)
message
(
STATUS
"NGRAPH_FLUID_TEST_ENABLE:
${
NGRAPH_FLUID_TEST_ENABLE
}
"
)
add_subdirectory
(
fluid
)
endif
()
src/ngraph/frontend/fluid/CMakeLists.txt
View file @
87b5baa1
...
...
@@ -19,3 +19,7 @@ target_sources (ngraph PRIVATE
${
CMAKE_CURRENT_SOURCE_DIR
}
/operators/reduce_sum.cpp
${
CMAKE_CURRENT_SOURCE_DIR
}
/operators/reduce_sum.hpp
)
if
(
NGRAPH_FLUID_TEST_ENABLE
)
add_subdirectory
(
operators/test
)
endif
()
src/ngraph/frontend/fluid/operators/test/CMakeLists.txt
0 → 100644
View file @
87b5baa1
# ******************************************************************************
# Copyright 2017-2019 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ******************************************************************************
if
(
NOT NGRAPH_FLUID_TEST_ENABLE
)
message
(
STATUS
"Fluid tests disabled"
)
return
()
endif
()
if
(
NOT NGRAPH_CPU_ENABLE
)
message
(
STATUS
"Fluid tests needs CPU enabled"
)
return
()
endif
()
message
(
STATUS
"fluid tests enabled"
)
if
(
LINUX
)
set
(
CMAKE_BUILD_WITH_INSTALL_RPATH FALSE
)
endif
()
if
(
CMAKE_CXX_COMPILER_ID STREQUAL
"Clang"
)
if
(
CMAKE_CXX_COMPILER_VERSION VERSION_GREATER
"4.0.0"
)
# gtest has issues with this with v1.8.x
# gtest issue is supposed to be addressed after v1.8.x
add_compile_options
(
-Wno-zero-as-null-pointer-constant
)
endif
()
endif
()
set
(
SRC
main.cpp
reduce_sum.cpp
)
set
(
CMAKE_RUNTIME_OUTPUT_DIRECTORY
${
CMAKE_CURRENT_BINARY_DIR
}
/../../../../../../test
)
add_executable
(
fluid-test
${
SRC
}
)
target_include_directories
(
fluid-test PRIVATE
"../../../../../../test"
)
target_link_libraries
(
fluid-test PRIVATE ngraph_test_util
)
target_link_libraries
(
fluid-test PRIVATE ngraph libgtest
)
if
(
NOT WIN32
)
target_link_libraries
(
fluid-test PRIVATE pthread
)
endif
()
target_link_libraries
(
fluid-test PRIVATE
${
CMAKE_DL_LIBS
}
)
if
(
"
${
CMAKE_CXX_COMPILER_ID
}
"
MATCHES
"^(Apple)?Clang$"
)
target_compile_options
(
fluid-test PRIVATE -Wno-undef -Wno-reserved-id-macro
)
endif
()
# So many type_prop tests these days that we need to set /bigobj flag for MSVC.
# We should probably split up type_prop.cpp.
if
(
MSVC
)
target_compile_options
(
fluid-test PRIVATE
"/bigobj"
)
endif
()
# The INTERPRETER backend is required for convolution, and backwards unit tests
target_link_libraries
(
fluid-test PRIVATE cpu_backend
)
target_link_libraries
(
fluid-test PRIVATE libmkldnn
)
target_compile_definitions
(
fluid-test PRIVATE NGRAPH_CPU_ENABLE
)
if
(
NGRAPH_TBB_ENABLE
)
target_compile_definitions
(
fluid-test PRIVATE
"NGRAPH_TBB_ENABLE"
)
endif
()
src/ngraph/frontend/fluid/operators/test/main.cpp
0 → 100644
View file @
87b5baa1
//*****************************************************************************
// Copyright 2017-2019 Intel Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//*****************************************************************************
#include <chrono>
#include <iostream>
#undef IN_NGRAPH_LIBRARY
#include "gtest/gtest.h"
#include "ngraph/log.hpp"
#include "ngraph/ngraph.hpp"
#include "ngraph/runtime/backend.hpp"
#include "ngraph/runtime/backend_manager.hpp"
using
namespace
std
;
int
main
(
int
argc
,
char
**
argv
)
{
const
string
cpath_flag
{
"--cpath"
};
string
cpath
;
const
char
*
exclude
=
"--gtest_filter=-benchmark.*"
;
vector
<
char
*>
argv_vector
;
argv_vector
.
push_back
(
argv
[
0
]);
argv_vector
.
push_back
(
const_cast
<
char
*>
(
exclude
));
for
(
int
i
=
1
;
i
<
argc
;
i
++
)
{
argv_vector
.
push_back
(
argv
[
i
]);
}
argc
=
argv_vector
.
size
();
::
testing
::
InitGoogleTest
(
&
argc
,
argv_vector
.
data
());
for
(
int
i
=
1
;
i
<
argc
;
i
++
)
{
if
(
cpath_flag
==
argv
[
i
]
&&
(
++
i
)
<
argc
)
{
cpath
=
argv
[
i
];
}
}
ngraph
::
runtime
::
Backend
::
set_backend_shared_library_search_directory
(
cpath
);
#ifdef NGRAPH_CPU_ENABLE
ngraph_register_cpu_backend
();
#endif
auto
start
=
std
::
chrono
::
system_clock
::
now
();
int
rc
=
RUN_ALL_TESTS
();
auto
elapsed
=
std
::
chrono
::
duration_cast
<
std
::
chrono
::
milliseconds
>
(
std
::
chrono
::
system_clock
::
now
()
-
start
);
NGRAPH_DEBUG_PRINT
(
"[MAIN] Tests finished: Time: %d ms Exit code: %d"
,
elapsed
.
count
(),
rc
);
return
rc
;
}
src/ngraph/frontend/fluid/operators/test/reduce_sum.cpp
0 → 100644
View file @
87b5baa1
This diff is collapsed.
Click to expand it.
src/ngraph/frontend/fluid/operators/test/test.manifest
0 → 100644
View file @
87b5baa1
# Add test names to disable
# This does not work for now
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment