diff --git a/src/io.cpp b/src/io/io.cpp similarity index 100% rename from src/io.cpp rename to src/io/io.cpp diff --git a/src/io.h b/src/io/io.h similarity index 100% rename from src/io.h rename to src/io/io.h diff --git a/test/executor_for_test.h b/test/executor_for_test.h index ce3c84e986eb7ef5e9602209cedb3dbabbf06e85..f8c333779be4a56966ea6ca810b36a5f52c9383d 100644 --- a/test/executor_for_test.h +++ b/test/executor_for_test.h @@ -19,7 +19,7 @@ limitations under the License. */ #include "common/log.h" #include "framework/op_registry.h" -#include "io.h" +#include "io/io.h" #include "operators/conv_op.h" #include "operators/elementwise_add_op.h" #include "operators/pool_op.h" diff --git a/test/framework/test_load.cpp b/test/framework/test_load.cpp index a1f092c4d81ee09d3327a0e2d5425e20dad1ae89..060870f145865d8944bfe1ce7b59b76461176bc1 100644 --- a/test/framework/test_load.cpp +++ b/test/framework/test_load.cpp @@ -13,7 +13,7 @@ See the License for the specific language governing permissions and limitations under the License. */ #include "../test_helper.h" -#include "io.h" +#include "io/io.h" int main() { paddle_mobile::Loader loader; diff --git a/test/framework/test_optimize.cpp b/test/framework/test_optimize.cpp index 685a2eca6e090220f7c48fff036f1f84ed7c8fce..2cb920da616110b9415c494140e48e3479845851 100644 --- a/test/framework/test_optimize.cpp +++ b/test/framework/test_optimize.cpp @@ -15,7 +15,7 @@ limitations under the License. */ #include "../test_helper.h" #include "framework/program/program-optimize/node.h" #include "framework/program/program-optimize/program_optimize.h" -#include "io.h" +#include "io/io.h" int main() { paddle_mobile::Loader loader; diff --git a/test/operators/test_concat_op.cpp b/test/operators/test_concat_op.cpp index 7a106b03c44c57fa7ef0f9282434717efd602b5c..edaa4ce1ddba251886c90262895333b0a56c3a07 100644 --- a/test/operators/test_concat_op.cpp +++ b/test/operators/test_concat_op.cpp @@ -12,7 +12,6 @@ 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 "../executor_for_test.h" #include "../test_include.h" #include "operators/concat_op.h" diff --git a/test/operators/test_cov_op.cpp b/test/operators/test_cov_op.cpp index ba6a9b4800f8b2acb3a5c3b0992128bd4ea0e619..8057430309cac4da88e80518bf8ab0f5afd79ce5 100644 --- a/test/operators/test_cov_op.cpp +++ b/test/operators/test_cov_op.cpp @@ -12,8 +12,8 @@ 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 "../executor_for_test.h" #include "../test_include.h" +#include "operators/conv_op.h" int main() { paddle_mobile::Loader loader; diff --git a/test/operators/test_depthwise_conv_op.cpp b/test/operators/test_depthwise_conv_op.cpp index 648b4c5db9970804a2ca140eef13e2560e36f935..bd2aad19eda896bad3da8a47f5b70b1a923dc1a7 100644 --- a/test/operators/test_depthwise_conv_op.cpp +++ b/test/operators/test_depthwise_conv_op.cpp @@ -12,7 +12,6 @@ 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 "../executor_for_test.h" #include "../test_include.h" #include "operators/depthwise_conv_op.h" diff --git a/test/operators/test_elementwise_add_op.cpp b/test/operators/test_elementwise_add_op.cpp index c4997f2eb37730e1af38fbe8aac927e7ee2b6ee0..0a5e9f7e92701e748df51078b21eb46eec90599d 100644 --- a/test/operators/test_elementwise_add_op.cpp +++ b/test/operators/test_elementwise_add_op.cpp @@ -12,7 +12,6 @@ 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 "../executor_for_test.h" #include "../test_include.h" int main() { diff --git a/test/operators/test_lrn_op.cpp b/test/operators/test_lrn_op.cpp index cf5fd4bdf2d45abcf63eb865f1cf333eeb14eafc..d4d9f8da802fc0f5f885a3b2e81cba695776c29e 100644 --- a/test/operators/test_lrn_op.cpp +++ b/test/operators/test_lrn_op.cpp @@ -12,7 +12,6 @@ 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 "../executor_for_test.h" #include "../test_include.h" #include "operators/lrn_op.h" diff --git a/test/operators/test_mul_op.cpp b/test/operators/test_mul_op.cpp index 5412e6905b7c12782555c7271c5da17713561469..8ebf0926890497c0ed622b69f163a9f6f5c8612b 100644 --- a/test/operators/test_mul_op.cpp +++ b/test/operators/test_mul_op.cpp @@ -12,7 +12,6 @@ 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 "../executor_for_test.h" #include "../test_include.h" #include "operators/mul_op.h" diff --git a/test/operators/test_pool_op.cpp b/test/operators/test_pool_op.cpp index 62dfc20dc12006f86b16997cb6de96123e10ee9c..2daecd7b4c1a50c612bc784c801208d2e6f31482 100644 --- a/test/operators/test_pool_op.cpp +++ b/test/operators/test_pool_op.cpp @@ -12,9 +12,8 @@ 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 "../executor_for_test.h" -#include "../test_helper.h" -#include "io.h" +#include "../test_include.h" +#include "operators/pool_op.h" int main() { paddle_mobile::Loader loader; diff --git a/test/operators/test_relu_op.cpp b/test/operators/test_relu_op.cpp index 50f3b6a20b6244fcb39975c80cc6a6e14dc88d1c..fad0d0c30a126cc2730e4aa8b87364eee9fc8209 100644 --- a/test/operators/test_relu_op.cpp +++ b/test/operators/test_relu_op.cpp @@ -12,7 +12,6 @@ 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 "../executor_for_test.h" #include "../test_include.h" #include "operators/relu_op.h" diff --git a/test/operators/test_reshape_op.cpp b/test/operators/test_reshape_op.cpp index 5448aac87c23ea90f5b8beec24aee9cc6f437330..3541151d8a1a286527e715f402df381d2efc094c 100644 --- a/test/operators/test_reshape_op.cpp +++ b/test/operators/test_reshape_op.cpp @@ -12,9 +12,8 @@ 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 "../executor_for_test.h" -#include "../test_helper.h" -#include "io.h" +#include "../test_include.h" +#include "operators/reshape_op.h" int main() { paddle_mobile::Loader loader; diff --git a/test/operators/test_sigmoid_op.cpp b/test/operators/test_sigmoid_op.cpp index 289eac149fa2d3e05f65624f8a9e5f93e85c6fff..4ed3efaf28aa986f0b679729c46cb386150583e3 100644 --- a/test/operators/test_sigmoid_op.cpp +++ b/test/operators/test_sigmoid_op.cpp @@ -14,7 +14,7 @@ limitations under the License. */ #include "../../src/operators/kernel/sigmoid_kernel.h" #include "../test_helper.h" -#include "io.h" +#include "io/io.h" int main() { paddle_mobile::framework::Tensor input; diff --git a/test/operators/test_softmax_op.cpp b/test/operators/test_softmax_op.cpp index 58de5300cca0bf367652066851bc4e7e9f75389c..a0184729a8bc5e6b0ba952923eecd5242cfe36d4 100644 --- a/test/operators/test_softmax_op.cpp +++ b/test/operators/test_softmax_op.cpp @@ -12,9 +12,9 @@ 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 "../executor_for_test.h" -#include "../test_helper.h" -#include "io.h" +#include "../test_include.h" + +#include "operators/softmax_op.h" int main() { paddle_mobile::Loader loader; diff --git a/test/operators/test_transpose_op.cpp b/test/operators/test_transpose_op.cpp index 4c88df2d83dcfbc44915ced815b50f90ddb33b38..f83ee23c25d8f2588e0fe40d5fabc6114129b995 100644 --- a/test/operators/test_transpose_op.cpp +++ b/test/operators/test_transpose_op.cpp @@ -12,10 +12,9 @@ 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 "../executor_for_test.h" #include "../test_helper.h" -#include "io.h" - +#include "../test_include.h" +#include "operators/transpose_op.h" int main() { paddle_mobile::Loader loader; auto program = loader.Load(std::string(g_mobilenet_ssd)); diff --git a/test/test_include.h b/test/test_include.h index 25efbb9f4c00921495a5ab054acdde329c4ef58a..2d89dc8c9ed1de1ad49ebca07724b6649e2a12a7 100644 --- a/test/test_include.h +++ b/test/test_include.h @@ -21,6 +21,7 @@ limitations under the License. */ #include "./test_helper.h" #include "common/enforce.h" #include "common/log.h" +#include "executor_for_test.h" #include "framework/lod_tensor.h" #include "framework/operator.h" #include "framework/program/block_desc.h" @@ -29,4 +30,4 @@ limitations under the License. */ #include "framework/scope.h" #include "framework/tensor.h" #include "framework/variable.h" -#include "io.h" +#include "io/io.h" diff --git a/build.sh b/tools/build.sh similarity index 94% rename from build.sh rename to tools/build.sh index 7ef05924d94315d1c55abc944479e9a6c6f6125f..2b370b93a5b8b4ee0ba2e7d679f8b0fc4b461b8f 100755 --- a/build.sh +++ b/tools/build.sh @@ -16,13 +16,13 @@ build_for_mac() { PLATFORM="x86" MODE="Release" CXX_FLAGS="-std=c++11 -O3 -s" - BUILD_DIR=build/release/"${PLATFORM}" + BUILD_DIR=../build/release/"${PLATFORM}" mkdir -p ${BUILD_DIR}/build mkdir -p ${BUILD_DIR}/test - cp -r test/models ${BUILD_DIR}/test/models + cp -r ../test/models ${BUILD_DIR}/test/models - cmake . \ + cmake .. \ -B"${BUILD_DIR}" \ -DCMAKE_BUILD_TYPE="${MODE}" \ -DCMAKE_CXX_FLAGS="${CXX_FLAGS}" \ @@ -33,8 +33,6 @@ build_for_mac() { } build_for_android() { - - if [ -z "${ANDROID_NDK}" ]; then echo "ANDROID_NDK not found!" exit -1 @@ -77,8 +75,8 @@ build_for_android() { -D"${ARM_PLATFORM}"=true else - cmake . \ - -B"build/release/${PLATFORM}" \ + cmake .. \ + -B"../build/release/${PLATFORM}" \ -DANDROID_ABI="${ABI}" \ -DCMAKE_BUILD_TYPE="${MODE}" \ -DCMAKE_TOOLCHAIN_FILE="${TOOLCHAIN_FILE}" \ @@ -88,7 +86,7 @@ build_for_android() { -DANDROID=true \ -D"${ARM_PLATFORM}"=true fi - cd "./build/release/${PLATFORM}" + cd "../build/release/${PLATFORM}" make -j 8 } @@ -96,13 +94,13 @@ build_for_android() { build_for_ios() { PLATFORM="ios" MODE="Release" - BUILD_DIR=build/release/"${PLATFORM}" + BUILD_DIR=../build/release/"${PLATFORM}" TOOLCHAIN_FILE="./tools/ios-cmake/ios.toolchain.cmake" C_FLAGS="-fobjc-abi-version=2 -fobjc-arc -isysroot ${CMAKE_OSX_SYSROOT}" CXX_FLAGS="-fobjc-abi-version=2 -fobjc-arc -std=gnu++11 -stdlib=libc++ -isysroot ${CMAKE_OSX_SYSROOT}" mkdir -p "${BUILD_DIR}" - cmake . \ + cmake .. \ -B"${BUILD_DIR}" \ -DCMAKE_BUILD_TYPE="${MODE}" \ -DCMAKE_TOOLCHAIN_FILE="${TOOLCHAIN_FILE}" \ @@ -125,7 +123,7 @@ if [ $# -lt 1 ]; then echo "sample usage: ./build.sh mac" else if [ $# -eq 2 ]; then - + if [[$2 != "googlenet"]] -a [[$2 != "mobilenet"]] -a [[$2 != "yolo"]] -a [[$2 != "squeezenet"]] -a [[$2 != "resnet"]]; then if [ $1 = "mac" ]; then build_for_mac