Skip to content

Commit

Permalink
Merge pull request PaddlePaddle#49 from ChunweiYan/feature/mv_backend…
Browse files Browse the repository at this point in the history
…_out
  • Loading branch information
Superjomn authored Dec 12, 2017
2 parents 7ff1db0 + 70c808c commit f1be2fa
Show file tree
Hide file tree
Showing 27 changed files with 66 additions and 41 deletions.
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ cache:
directories:
- $HOME/.ccache
- $HOME/.cache/pip
- $TRAVIS_BUILD_DIR/build/third_party
sudo: required
dist: trusty
os:
Expand All @@ -20,6 +19,9 @@ addons:
- python-wheel
- clang-format-3.8
- ccache
script:
/bin/bash ./tests.sh

notifications:
email:
on_success: change
Expand Down
24 changes: 15 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
cmake_minimum_required(VERSION 3.5)
cmake_minimum_required(VERSION 3.2)
project(VisualDL)

find_program(CCACHE_FOUND ccache)
if(CCACHE_FOUND)
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
endif(CCACHE_FOUND)

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_FLAGS "-fPIC")
Expand All @@ -25,16 +31,16 @@ include_directories(${PROJECT_SOURCE_DIR})
include_directories(${CMAKE_CURRENT_BINARY_DIR})
include_directories(${PROJECT_SOURCE_DIR}/thirdparty/local/include)

add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/visualdl/backend/storage)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/visualdl/backend/logic)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/visualdl/storage)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/visualdl/logic)

add_executable(vl_test
${PROJECT_SOURCE_DIR}/visualdl/backend/test.cc
${PROJECT_SOURCE_DIR}/visualdl/backend/storage/storage_test.cc
${PROJECT_SOURCE_DIR}/visualdl/backend/utils/test_concurrency.cc
${PROJECT_SOURCE_DIR}/visualdl/backend/logic/im_test.cc
${PROJECT_SOURCE_DIR}/visualdl/backend/utils/concurrency.h
${PROJECT_SOURCE_DIR}/visualdl/backend/utils/filesystem.h
${PROJECT_SOURCE_DIR}/visualdl/test.cc
${PROJECT_SOURCE_DIR}/visualdl/storage/storage_test.cc
${PROJECT_SOURCE_DIR}/visualdl/utils/test_concurrency.cc
${PROJECT_SOURCE_DIR}/visualdl/logic/im_test.cc
${PROJECT_SOURCE_DIR}/visualdl/utils/concurrency.h
${PROJECT_SOURCE_DIR}/visualdl/utils/filesystem.h
)
target_link_libraries(vl_test storage im gtest glog protobuf gflags pthread)

Expand Down
13 changes: 13 additions & 0 deletions tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash
set -ex

sudo pip install numpy
#sudo apt-get install --only-upgrade cmake -y
mkdir -p build
cd build
cmake ..
make
make test

#if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then bash ./travis/run_on_pull_requests; fi
#if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then bash ./travis/run_on_non_pull_requests; fi
7 changes: 0 additions & 7 deletions visualdl/backend/logic/CMakeLists.txt

This file was deleted.

9 changes: 9 additions & 0 deletions visualdl/logic/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
add_library(sdk ${PROJECT_SOURCE_DIR}/visualdl/logic/sdk.cc)
add_library(im ${PROJECT_SOURCE_DIR}/visualdl/logic/im.cc)
add_dependencies(im storage_proto)
add_dependencies(sdk storage_proto)

## pybind
add_library(core SHARED ${PROJECT_SOURCE_DIR}/visualdl/logic/pybind.cc)
add_dependencies(core pybind python im storage sdk protobuf glog)
target_link_libraries(core PRIVATE pybind python im storage sdk protobuf glog)
2 changes: 1 addition & 1 deletion visualdl/backend/logic/im.cc → visualdl/logic/im.cc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include <glog/logging.h>
#include <ctime>

#include "visualdl/backend/logic/im.h"
#include "visualdl/logic/im.h"

namespace visualdl {

Expand Down
8 changes: 4 additions & 4 deletions visualdl/backend/logic/im.h → visualdl/logic/im.h
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#ifndef VISUALDL_BACKEND_LOGIC_IM_H
#define VISUALDL_BACKEND_LOGIC_IM_H
#ifndef VISUALDL_LOGIC_IM_H
#define VISUALDL_LOGIC_IM_H

#include <glog/logging.h>
#include <visualdl/backend/utils/concurrency.h>
#include <memory>
#include <string>

#include "visualdl/backend/storage/storage.h"
#include "visualdl/storage/storage.h"
#include "visualdl/utils/concurrency.h"

namespace visualdl {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "visualdl/backend/logic/im.h"
#include "visualdl/logic/im.h"

#include "gtest/gtest.h"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>

#include "visualdl/backend/logic/sdk.h"
#include "visualdl/logic/sdk.h"

namespace py = pybind11;
namespace vs = visualdl;
Expand Down
3 changes: 2 additions & 1 deletion visualdl/backend/logic/sdk.cc → visualdl/logic/sdk.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "visualdl/backend/logic/sdk.h"
#include "visualdl/logic/sdk.h"

#include <google/protobuf/text_format.h>

namespace visualdl {
Expand Down
6 changes: 3 additions & 3 deletions visualdl/backend/logic/sdk.h → visualdl/logic/sdk.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#ifndef VISUALDL_BACKEND_LOGIC_SDK_H
#define VISUALDL_BACKEND_LOGIC_SDK_H
#ifndef VISUALDL_LOGIC_SDK_H
#define VISUALDL_LOGIC_SDK_H

#include <glog/logging.h>
#include <time.h>
#include <map>

#include "visualdl/backend/logic/im.h"
#include "visualdl/logic/im.h"

namespace visualdl {

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#include <glog/logging.h>
#include <visualdl/backend/utils/concurrency.h>
#include <fstream>

#include "visualdl/backend/storage/storage.h"
#include "visualdl/backend/utils/filesystem.h"
#include "visualdl/storage/storage.h"
#include "visualdl/utils/concurrency.h"
#include "visualdl/utils/filesystem.h"

namespace visualdl {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <map>
#include <string>

#include "visualdl/backend/storage/storage.pb.h"
#include "visualdl/storage/storage.pb.h"

namespace visualdl {

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "visualdl/backend/storage/storage.h"
#include "visualdl/storage/storage.h"

#include <glog/logging.h>
#include <gtest/gtest.h>
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef VISUALDL_BACKEND_UTILS_CONCURRENCY_H
#define VISUALDL_BACKEND_UTILS_CONCURRENCY_H
#ifndef VISUALDL_UTILS_CONCURRENCY_H
#define VISUALDL_UTILS_CONCURRENCY_H

#include <glog/logging.h>
#include <chrono>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef VISUALDL_BACKEND_UTILS_FILESYSTEM_H
#define VISUALDL_BACKEND_UTILS_FILESYSTEM_H
#ifndef VISUALDL_UTILS_FILESYSTEM_H
#define VISUALDL_UTILS_FILESYSTEM_H

#include <google/protobuf/text_format.h>
#include <sys/stat.h>
Expand Down
5 changes: 3 additions & 2 deletions visualdl/backend/utils/log.h → visualdl/utils/log.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#ifndef VISUALDL_BACKEND_UTILS_LOG_H
#define VISUALDL_BACKEND_UTILS_LOG_H
#ifndef VISUALDL_UTILS_LOG_H
#define VISUALDL_UTILS_LOG_H

#include <stdexcept>

namespace visualdl {

namespace log {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "visualdl/backend/utils/concurrency.h"
#include "visualdl/utils/concurrency.h"

#include <glog/logging.h>
#include <gtest/gtest.h>
Expand All @@ -16,4 +16,4 @@ TEST(concurrency, test) {
cc::PeriodExector::Global()(std::move(task), 200);
}

} // namespace visualdl
} // namespace visualdl

0 comments on commit f1be2fa

Please sign in to comment.