From b2e33f33160aab4fa76a884481087d1639e21480 Mon Sep 17 00:00:00 2001 From: yangfei Date: Wed, 10 Oct 2018 19:51:21 +0800 Subject: [PATCH] add some function --- CMakeLists.txt | 2 +- src/framework/cl/cl_image.h | 66 ++-- src/framework/executor.cpp | 146 +++++++- src/framework/executor.h | 2 + src/framework/loader.cpp | 35 +- src/framework/loader.h | 3 + src/operators/batchnorm_op.cpp | 4 + src/operators/batchnorm_op.h | 3 + src/operators/feed_op.h | 1 - src/operators/fetch_op.cpp | 3 + src/operators/fetch_op.h | 3 + src/operators/kernel/cl/conv_kernel.cpp | 9 +- .../kernel/cl/elementwise_add_kernel.cpp | 2 +- src/operators/kernel/cl/softmax_kernel.cpp | 23 +- src/operators/pool_op.cpp | 3 + src/operators/pool_op.h | 3 + src/operators/relu_op.cpp | 3 + src/operators/relu_op.h | 3 + src/operators/reshape_op.cpp | 3 + src/operators/reshape_op.h | 3 + src/operators/softmax_op.cpp | 3 + src/operators/softmax_op.h | 3 + test/CMakeLists.txt | 338 +++++++++--------- 23 files changed, 439 insertions(+), 225 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8c835e5994..d76ac16aac 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,7 +7,7 @@ option(DEBUGING "enable debug mode" ON) option(USE_EXCEPTION "use std exception" OFF) option(LOG_PROFILE "log profile" OFF) # select the platform to build -option(CPU "armv7 with neon" ON) +option(CPU "armv7 with neon" OFF) option(GPU_MALI "mali gpu" OFF) option(GPU_CL "opencl gpu" ON) option(FPGA "fpga" OFF) diff --git a/src/framework/cl/cl_image.h b/src/framework/cl/cl_image.h index 0c5e996540..f08027a7c8 100644 --- a/src/framework/cl/cl_image.h +++ b/src/framework/cl/cl_image.h @@ -27,38 +27,62 @@ class CLImage { CLImage() = default; void Init(cl_context context, float *tensorInput, DDim ddim) { + tensorDims_ = ddim; cl_image_format cf = { .image_channel_order = CL_RGBA, .image_channel_data_type = CL_HALF_FLOAT }; // NCHW -> [W * (C+3)/4, H * N] - size_t N = tensorDims_[0]; - size_t C = tensorDims_[1]; - size_t H = tensorDims_[2]; - size_t W = tensorDims_[3]; + DLOG< imageData{}; + int count = 0; if (tensorInput != nullptr) { imageData.reset(new half_t[width * height * 4]); - float *p = tensorInput; - size_t i0 = 0; - for (int n = 0; n < N; n++) { - for (int c = 0; c < C; c++) { - size_t i1 = i0; - for (int h = 0; h < H; h++) { - size_t i2 = i1 << 2 + c % 4; - for (int w = 0; w < W; w++) { - imageData[i2] = float2half(*p); - i2 += 4; - p++; - } - i1 += width; - } - } - i0 += width * H; - } + float *p = tensorInput; + size_t i0 = 0; + for (int n = 0; n < N; n++) { + for (int c = 0; c < C; c++) { + size_t i1 = i0; + for (int h = 0; h < H; h++) { + size_t i2 = (i1<<2) + c % 4; + for (int w = 0; w < W; w++) { + if (i2 >= width * height * 4) { + printf("%d > %d ----> %d, %d, %d, %d --- %d, %d, %d\n", i2, width*height*4, n, c, h, w, i0, i1, i2); + } + assert(i2 < width * height * 4); + + imageData[i2] = float2half(*p); + i2 += 4; + p++; + // count++; + // DLOG<::Predict_To(int end) { #endif #ifdef PADDLE_MOBILE_CL +template <> + void Executor::LoadMemory(const framework::VarDesc var_desc, + float *tensorInput, char **data) { + // 1. version + uint32_t version = *reinterpret_cast(*data); + + (*data) += sizeof(uint32_t); + + // 2 Lod information + uint64_t *lod_level_ptr = new uint64_t(); + memcpy(lod_level_ptr, (*data), sizeof(uint64_t)); + uint64_t lod_level = *lod_level_ptr; + delete lod_level_ptr; + (*data) += sizeof(uint64_t); + + for (uint64_t i = 0; i < lod_level; ++i) { + uint64_t size = *reinterpret_cast(*data); + (*data) += sizeof(uint64_t); + std::vector tmp(size / sizeof(size_t)); + + for (int k = 0; k < tmp.size(); ++k) { + tmp[k] = *reinterpret_cast(*data); + (*data) += sizeof(size_t); + } + } + + // 3. tensor version + uint32_t tensor_version = *reinterpret_cast(*data); + (*data) += sizeof(uint32_t); + + // 4. tensor desc + int32_t size = *reinterpret_cast(*data); + (*data) += sizeof(int32_t); + + std::unique_ptr buf(new char[size]); + for (int m = 0; m < size; ++m) { + buf.get()[m] = (*data)[m]; + } + (*data) += (sizeof(char) * size); + + const framework::TensorDesc &desc = var_desc.Tensor_desc(); + int memory_size = 1; + for (auto l : desc.Dims()) { + memory_size *= l; + } + + void *memory = nullptr; +// int type_size = 0; +// switch (desc.DataType()) { +// case framework::VARTYPE_TYPE_FP16: +// type_size = 2; +// break; +// case framework::VARTYPE_TYPE_FP32: +// type_size = 4; +// memory = tensor->mutable_data(); +// break; +// case framework::VARTYPE_TYPE_FP64: +// type_size = 8; +// break; +// case framework::VARTYPE_TYPE_INT32: +// memory = tensor->mutable_data(); +// type_size = 4; +// break; +// case framework::VARTYPE_TYPE_INT64: +// type_size = 8; +// break; +// case framework::VARTYPE_TYPE_BOOL: +// type_size = 1; +// break; +// default: +// break; +// } + int type_size = 4; + memory = tensorInput; + if (program_.quantification) { + float min_value; + float max_value; + + memcpy(&min_value, *data, sizeof(float)); + memcpy(&max_value, *data + sizeof(float), sizeof(float)); + *data += 2 * sizeof(float); + const float factor = (max_value - min_value) / 255.0; + uint8_t *uint8_data = reinterpret_cast(*data); + for (int k = 0; k < memory_size; ++k) { + static_cast(memory)[k] = uint8_data[k] * factor + min_value; + } + *data += (memory_size * sizeof(uint8_t)); + } else { + for (int n = 0; n < memory_size; n++) { + float value; + memcpy(&value, *data + n * type_size, type_size); + if (value < 1e-30 && value > -1e-30) { + static_cast(memory)[n] = 0.0; + } else { + static_cast(memory)[n] = value; + } + } + (*data) += (sizeof(char) * memory_size * type_size); + } + } template <> void Executor::InitMemory() { @@ -812,26 +912,38 @@ void Executor::InitMemory() { if (var_desc->Name() == "feed" || var_desc->Name() == "fetch") { continue; } - char *origin_data = Get_binary_data(program_.model_path + "/" + var_desc->Name()); + char *data = origin_data; cl_context context = program_.scope->GetCLScpoe()->Context(); - - float *tensorInput = (float *)origin_data; - - const framework::TensorDesc &desc = var_desc->Tensor_desc(); - framework::DDim ddim = cl_image->dims(); + const framework::TensorDesc &desc = var_desc->Tensor_desc(); + int numel = 1; + for (auto l : desc.Dims()) { + numel *= l; + } + DLOG<Name(); + float *tensorInput = static_cast( + paddle_mobile::memory::Alloc(sizeof(float) * numel)); + LoadMemory(*var_desc,tensorInput,&data); + + framework::DDim ddim = framework::make_ddim(desc.Dims()); cl_image->Init(context, tensorInput, ddim); - delete origin_data; + + delete origin_data; + paddle_mobile::memory::Free(tensorInput); }else{ - auto cl_image = var->template GetMutable(); - cl_context context = program_.scope->GetCLScpoe()->Context(); + if (var_desc->Type() == framework::VARTYPE_TYPE_LOD_TENSOR) { + auto cl_image = var->template GetMutable(); + cl_context context = program_.scope->GetCLScpoe()->Context(); - const framework::TensorDesc &desc = var_desc->Tensor_desc(); - framework::DDim ddim = cl_image->dims(); + const framework::TensorDesc &desc = var_desc->Tensor_desc(); + framework::DDim ddim = framework::make_ddim(desc.Dims()); + DLOG<Name(); - cl_image->Init(context, ddim); + cl_image->Init(context, ddim); + + } } } @@ -863,21 +975,23 @@ void Executor::InitCombineMemory() { cl_context context = program_.scope->GetCLScpoe()->Context(); const framework::TensorDesc &desc = var_desc->Tensor_desc(); - framework::DDim ddim = cl_image->dims(); + framework::DDim ddim = framework::make_ddim(desc.Dims()); int numel = 1; for (int i = 0; i < ddim.size(); i++) { numel = numel * ddim[i]; } - float *tensorInput = data; + float *tensorInput = static_cast( + paddle_mobile::memory::Alloc(sizeof(float) * numel)); + LoadMemory(*var_desc,tensorInput,&origin_data); cl_image->Init(context, tensorInput, ddim); - data += numel; + paddle_mobile::memory::Free(tensorInput); }else{ auto cl_image = var->template GetMutable(); cl_context context = program_.scope->GetCLScpoe()->Context(); const framework::TensorDesc &desc = var_desc->Tensor_desc(); - framework::DDim ddim = cl_image->dims(); + framework::DDim ddim = framework::make_ddim(desc.Dims()); cl_image->Init(context, ddim); } diff --git a/src/framework/executor.h b/src/framework/executor.h index f43cd14c29..281032647d 100644 --- a/src/framework/executor.h +++ b/src/framework/executor.h @@ -73,6 +73,8 @@ class Executor { void LoadMemory(const framework::VarDesc var_desc, framework::LoDTensor *tensor, char **data); + void LoadMemory(const framework::VarDesc var_desc, + float * tensorInput, char **data); void InitCombineMemory(); diff --git a/src/framework/loader.cpp b/src/framework/loader.cpp index 7b95f1d1bf..dbd4cc048d 100644 --- a/src/framework/loader.cpp +++ b/src/framework/loader.cpp @@ -16,6 +16,9 @@ limitations under the License. */ #include "framework/lod_tensor.h" #include "framework/program/program-optimize/program_optimize.h" +#ifdef PADDLE_MOBILE_CL +#include "framework/cl/cl_image.h" +#endif namespace paddle_mobile { namespace framework { @@ -26,7 +29,8 @@ namespace framework { * @param originProgramDesc * @param scope */ -void InitMemoryFromProgram( +template +void Loader::InitMemoryFromProgram( std::shared_ptr &originProgramDesc, std::shared_ptr &scope) { for (const auto &block : originProgramDesc.get()->Blocks()) { @@ -51,6 +55,35 @@ void InitMemoryFromProgram( } } +#ifdef PADDLE_MOBILE_CL + template<> + void Loader::InitMemoryFromProgram( + std::shared_ptr &originProgramDesc, + std::shared_ptr &scope) { + for (const auto &block : originProgramDesc.get()->Blocks()) { + for (const auto &var_desc : block->Vars()) { + auto var = scope.get()->Var(var_desc->Name()); + if (var_desc->Type() == VARTYPE_TYPE_LOD_TENSOR) { + if (var_desc->Persistable()) { + auto dim = var_desc->Tensor_desc().Dims(); +// auto tensor = var->GetMutable(); + auto cl_image = var->GetMutable(); + cl_image->Resize(make_ddim(dim)); + } else { + auto dim = var_desc->Tensor_desc().Dims(); + PADDLE_MOBILE_ENFORCE(dim.size() > 0, "dim size is 0"); + dim[0] = 1; + auto cl_image = var->GetMutable(); + cl_image->Resize(make_ddim(dim)); + } + } else { + // TODO(codeWorm): some. + } + } + } + } +#endif + /** * fusion and print someinfos * @tparam Dtype diff --git a/src/framework/loader.h b/src/framework/loader.h index fe4460f6c0..4886368232 100644 --- a/src/framework/loader.h +++ b/src/framework/loader.h @@ -53,6 +53,9 @@ class Loader { bool optimize = false, bool quantification = false, bool can_add_split = false); + + void InitMemoryFromProgram(std::shared_ptr &originProgramDesc, + std::shared_ptr &scope); }; } diff --git a/src/operators/batchnorm_op.cpp b/src/operators/batchnorm_op.cpp index f820908404..566b8438d8 100644 --- a/src/operators/batchnorm_op.cpp +++ b/src/operators/batchnorm_op.cpp @@ -40,4 +40,8 @@ REGISTER_OPERATOR_MALI_GPU(batch_norm, ops::BatchNormOp); #ifdef PADDLE_MOBILE_FPGA #endif +#ifdef PADDLE_MOBILE_CL +REGISTER_OPERATOR_CL(batch_norm, ops::BatchNormOp); +#endif + #endif diff --git a/src/operators/batchnorm_op.h b/src/operators/batchnorm_op.h index 52c423f1bb..55bc5a4a29 100644 --- a/src/operators/batchnorm_op.h +++ b/src/operators/batchnorm_op.h @@ -54,5 +54,8 @@ USE_OP_MALI_GPU(batch_norm); #endif #ifdef PADDLE_MOBILE_FPGA #endif +#ifdef PADDLE_MOBILE_CL +USE_OP_CL(batch_norm); +#endif #endif diff --git a/src/operators/feed_op.h b/src/operators/feed_op.h index 1e0192f3df..d855b27ae2 100644 --- a/src/operators/feed_op.h +++ b/src/operators/feed_op.h @@ -77,7 +77,6 @@ class FeedOp : public framework::OperatorBase { void Init() {} void RunImpl() { - } #else void Init() {} diff --git a/src/operators/fetch_op.cpp b/src/operators/fetch_op.cpp index cc96934cad..852d5c48fc 100644 --- a/src/operators/fetch_op.cpp +++ b/src/operators/fetch_op.cpp @@ -43,3 +43,6 @@ REGISTER_OPERATOR_MALI_GPU(fetch, ops::FetchOp); #ifdef PADDLE_MOBILE_FPGA REGISTER_OPERATOR_FPGA(fetch, ops::FetchOp); #endif +#ifdef PADDLE_MOBILE_CL +REGISTER_OPERATOR_CL(fetch, ops::FetchOp); +#endif diff --git a/src/operators/fetch_op.h b/src/operators/fetch_op.h index 708686c887..59b9c46ed3 100644 --- a/src/operators/fetch_op.h +++ b/src/operators/fetch_op.h @@ -54,3 +54,6 @@ USE_OP_MALI_GPU(fetch); #ifdef PADDLE_MOBILE_FPGA USE_OP_FPGA(fetch); #endif +#ifdef PADDLE_MOBILE_CL +USE_OP_CL(fetch); +#endif diff --git a/src/operators/kernel/cl/conv_kernel.cpp b/src/operators/kernel/cl/conv_kernel.cpp index 451f96447e..b0b043390a 100644 --- a/src/operators/kernel/cl/conv_kernel.cpp +++ b/src/operators/kernel/cl/conv_kernel.cpp @@ -15,22 +15,21 @@ limitations under the License. */ #ifdef CONV_OP #include "operators/kernel/conv_kernel.h" -#include "operators/kernel/central-arm-func/conv_arm_func.h" namespace paddle_mobile { namespace operators { template <> bool ConvKernel::Init(ConvParam *param) { - this->cl_helper_.AddKernel("conv_3x3", "conv_kernel.cl"); +// this->cl_helper_.AddKernel("conv_3x3", "conv_kernel.cl"); return true; } template <> void ConvKernel::Compute(const ConvParam ¶m) { - auto kernel = this->cl_helper_.KernelAt(0); - size_t global_work_size[3] = {1, 2, 3}; - clEnqueueNDRangeKernel(this->cl_helper_.CLCommandQueue(), kernel, 3, NULL, global_work_size, NULL, 0, NULL, NULL); +// auto kernel = this->cl_helper_.KernelAt(0); +// size_t global_work_size[3] = {1, 2, 3}; +// clEnqueueNDRangeKernel(this->cl_helper_.CLCommandQueue(), kernel, 3, NULL, global_work_size, NULL, 0, NULL, NULL); } template class ConvKernel; diff --git a/src/operators/kernel/cl/elementwise_add_kernel.cpp b/src/operators/kernel/cl/elementwise_add_kernel.cpp index d399e25d5e..531020255d 100644 --- a/src/operators/kernel/cl/elementwise_add_kernel.cpp +++ b/src/operators/kernel/cl/elementwise_add_kernel.cpp @@ -21,7 +21,7 @@ namespace paddle_mobile { template <> bool ElementwiseAddKernel::Init(ElementwiseAddParam *param) { - this->cl_helper_.AddKernel("elementwise_add", "elementwise_add_kernel.cl"); +// this->cl_helper_.AddKernel("elementwise_add", "elementwise_add_kernel.cl"); return true; } diff --git a/src/operators/kernel/cl/softmax_kernel.cpp b/src/operators/kernel/cl/softmax_kernel.cpp index de61592466..3bd07ccd1f 100644 --- a/src/operators/kernel/cl/softmax_kernel.cpp +++ b/src/operators/kernel/cl/softmax_kernel.cpp @@ -12,22 +12,25 @@ 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. */ +#ifdef SOFTMAX_OP -#include "operators/kernel/pool_kernel.h" +#include "operators/kernel/softmax_kernel.h" namespace paddle_mobile { -namespace operators { + namespace operators { -template <> -bool SoftmaxKernel::Init(SoftmaxParam *param) { - return true; -} + template <> + bool SoftmaxKernel::Init(SoftmaxParam *param) { + return true; + } -template <> -void SoftmaxKernel::Compute(const SoftmaxParam ¶m) {} + template <> + void SoftmaxKernel::Compute(const SoftmaxParam ¶m) {} -template class SoftmaxKernel; + template class SoftmaxKernel; -} // namespace operators + } // namespace operators } // namespace paddle_mobile +#endif + diff --git a/src/operators/pool_op.cpp b/src/operators/pool_op.cpp index dd23059ea0..74a01b5274 100644 --- a/src/operators/pool_op.cpp +++ b/src/operators/pool_op.cpp @@ -68,5 +68,8 @@ REGISTER_OPERATOR_MALI_GPU(pool2d, ops::PoolOp); #ifdef PADDLE_MOBILE_FPGA REGISTER_OPERATOR_FPGA(pool2d, ops::PoolOp); #endif +#ifdef PADDLE_MOBILE_CL +REGISTER_OPERATOR_CL(pool2d, ops::PoolOp); +#endif #endif diff --git a/src/operators/pool_op.h b/src/operators/pool_op.h index 0b43b607a2..0792582203 100644 --- a/src/operators/pool_op.h +++ b/src/operators/pool_op.h @@ -54,5 +54,8 @@ USE_OP_MALI_GPU(pool2d); #ifdef PADDLE_MOBILE_FPGA USE_OP_FPGA(pool2d); #endif +#ifdef PADDLE_MOBILE_CL +USE_OP_CL(pool2d); +#endif #endif diff --git a/src/operators/relu_op.cpp b/src/operators/relu_op.cpp index 2a771e81e7..d6d83475ee 100644 --- a/src/operators/relu_op.cpp +++ b/src/operators/relu_op.cpp @@ -41,5 +41,8 @@ REGISTER_OPERATOR_MALI_GPU(relu, ops::ReluOp); #endif #ifdef PADDLE_MOBILE_FPGA #endif +#ifdef PADDLE_MOBILE_CL +REGISTER_OPERATOR_CL(relu, ops::ReluOp); +#endif #endif diff --git a/src/operators/relu_op.h b/src/operators/relu_op.h index 403de6f361..01fe415b0e 100644 --- a/src/operators/relu_op.h +++ b/src/operators/relu_op.h @@ -57,5 +57,8 @@ USE_OP_MALI_GPU(relu); #endif #ifdef PADDLE_MOBILE_FPGA #endif +#ifdef PADDLE_MOBILE_CL +USE_OP_CL(relu); +#endif #endif diff --git a/src/operators/reshape_op.cpp b/src/operators/reshape_op.cpp index dcc15009af..9c2ed3035b 100644 --- a/src/operators/reshape_op.cpp +++ b/src/operators/reshape_op.cpp @@ -40,5 +40,8 @@ REGISTER_OPERATOR_MALI_GPU(reshape, ops::ReshapeOp); #endif #ifdef PADDLE_MOBILE_FPGA #endif +#ifdef PADDLE_MOBILE_CL +REGISTER_OPERATOR_CL(reshape, ops::ReshapeOp); +#endif #endif diff --git a/src/operators/reshape_op.h b/src/operators/reshape_op.h index 7df6890018..1b36a86909 100644 --- a/src/operators/reshape_op.h +++ b/src/operators/reshape_op.h @@ -56,5 +56,8 @@ USE_OP_MALI_GPU(reshape); #endif #ifdef PADDLE_MOBILE_FPGA #endif +#ifdef PADDLE_MOBILE_CL +USE_OP_CL(reshape); +#endif #endif diff --git a/src/operators/softmax_op.cpp b/src/operators/softmax_op.cpp index e85edc69c3..e605864706 100644 --- a/src/operators/softmax_op.cpp +++ b/src/operators/softmax_op.cpp @@ -36,5 +36,8 @@ REGISTER_OPERATOR_MALI_GPU(softmax, ops::SoftmaxOp); #ifdef PADDLE_MOBILE_FPGA REGISTER_OPERATOR_FPGA(softmax, ops::SoftmaxOp); #endif +#ifdef PADDLE_MOBILE_CL +REGISTER_OPERATOR_CL(softmax, ops::SoftmaxOp); +#endif #endif diff --git a/src/operators/softmax_op.h b/src/operators/softmax_op.h index d532332992..6ccbe713b5 100644 --- a/src/operators/softmax_op.h +++ b/src/operators/softmax_op.h @@ -52,5 +52,8 @@ USE_OP_MALI_GPU(softmax); #ifdef PADDLE_MOBILE_FPGA USE_OP_FPGA(softmax); #endif +#ifdef PADDLE_MOBILE_CL +USE_OP_CL(softmax); +#endif #endif diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 4ae006fa54..aab82a6235 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -83,175 +83,175 @@ elseif("genet" IN_LIST NET) target_link_libraries(test-genet paddle-mobile) else () - # gen test - ADD_EXECUTABLE(test-resnet net/test_resnet.cpp test_helper.h test_include.h executor_for_test.h) - target_link_libraries(test-resnet paddle-mobile) - - # gen test - ADD_EXECUTABLE(test-squeezenet net/test_squeezenet.cpp test_helper.h test_include.h executor_for_test.h) - target_link_libraries(test-squeezenet paddle-mobile) - - # gen test - ADD_EXECUTABLE(test-yolo net/test_yolo.cpp test_helper.h test_include.h executor_for_test.h) - target_link_libraries(test-yolo paddle-mobile) - - # gen test - ADD_EXECUTABLE(test-googlenet net/test_googlenet.cpp test_helper.h test_include.h executor_for_test.h) - target_link_libraries(test-googlenet paddle-mobile) - - # gen test - ADD_EXECUTABLE(test-conv-op operators/test_cov_op.cpp test_helper.h test_include.h executor_for_test.h) - target_link_libraries(test-conv-op paddle-mobile) - - # gen test - ADD_EXECUTABLE(test-mul-op operators/test_mul_op.cpp test_helper.h test_include.h) - target_link_libraries(test-mul-op paddle-mobile) - - # gen test - ADD_EXECUTABLE(test-elementwiseadd-op operators/test_elementwise_add_op.cpp test_helper.h test_include.h) - target_link_libraries(test-elementwiseadd-op paddle-mobile) - - # gen test - ADD_EXECUTABLE(test-concat-op operators/test_concat_op.cpp test_helper.h test_include.h) - target_link_libraries(test-concat-op paddle-mobile) - - # gen test - ADD_EXECUTABLE(test-lrn-op operators/test_lrn_op.cpp test_helper.h test_include.h) - target_link_libraries(test-lrn-op paddle-mobile) - - # gen test - ADD_EXECUTABLE(test-batchnorm-op operators/test_batchnorm_op.cpp test_helper.h test_include.h) - target_link_libraries(test-batchnorm-op paddle-mobile) - - # gen test - ADD_EXECUTABLE(test-priorbox-op operators/test_prior_box_op.cpp test_helper.h test_include.h) - target_link_libraries(test-priorbox-op paddle-mobile) - - # gen test - ADD_EXECUTABLE(test-boxcoder-op operators/test_box_coder_op.cpp test_helper.h test_include.h) - target_link_libraries(test-boxcoder-op paddle-mobile) - - # gen test - ADD_EXECUTABLE(test-transpose-op operators/test_transpose_op.cpp test_helper.h test_include.h) - target_link_libraries(test-transpose-op paddle-mobile) - - # gen test - ADD_EXECUTABLE(test-multiclassnms-op operators/test_multiclass_nms_op.cpp test_helper.h test_include.h) - target_link_libraries(test-multiclassnms-op paddle-mobile) - - # gen test - ADD_EXECUTABLE(test-reshape-op operators/test_reshape_op.cpp test_helper.h test_include.h) - target_link_libraries(test-reshape-op paddle-mobile) - - # gen test - ADD_EXECUTABLE(test-relu-op operators/test_relu_op.cpp test_helper.h test_include.h) - target_link_libraries(test-relu-op paddle-mobile) - - # gen test - ADD_EXECUTABLE(test-fc-op operators/test_fusion_fc_op.cpp test_helper.h test_include.h) - target_link_libraries(test-fc-op paddle-mobile) - - # gen test log - ADD_EXECUTABLE(test-log common/test_log.cpp) - target_link_libraries(test-log paddle-mobile) - - # gen test log - ADD_EXECUTABLE(test-load framework/test_load.cpp) - target_link_libraries(test-load paddle-mobile) - - # gen test log - ADD_EXECUTABLE(test-loadmemory framework/test_load_memory.cpp) - target_link_libraries(test-loadmemory paddle-mobile) - - ADD_EXECUTABLE(test-inference-api framework/test_inference_api.cpp) - target_link_libraries(test-inference-api paddle-mobile) - - - # gen test log - # gen test - ADD_EXECUTABLE(test-optimize framework/test_optimize.cpp) - target_link_libraries(test-optimize paddle-mobile) - - - #gen test - ADD_EXECUTABLE(test-pool operators/test_pool_op.cpp test_helper.h test_include.h executor_for_test.h) - target_link_libraries(test-pool paddle-mobile) - - #gen test - ADD_EXECUTABLE(test-softmax operators/test_softmax_op.cpp test_helper.h test_include.h executor_for_test.h) - target_link_libraries(test-softmax paddle-mobile) - - # gen test - ADD_EXECUTABLE(test-gemm-accuracy common/test_gemm_accuracy.cpp) - target_link_libraries(test-gemm-accuracy paddle-mobile) - - # gen test - ADD_EXECUTABLE(test-gemm-perf common/test_gemm_perf.cpp) - target_link_libraries(test-gemm-perf paddle-mobile) - - # gen test - ADD_EXECUTABLE(test-enforce common/test_enforce.cpp) - target_link_libraries(test-enforce paddle-mobile) - - # gen test - test if openmp works - ADD_EXECUTABLE(test-openmp common/test_openmp.cpp test_helper.h test_include.h executor_for_test.h) - target_link_libraries(test-openmp paddle-mobile) - - # gen test - ADD_EXECUTABLE(test-mobilenetssd net/test_mobilenet+ssd.cpp test_helper.h test_include.h executor_for_test.h) - target_link_libraries(test-mobilenetssd paddle-mobile) - - # gen test - ADD_EXECUTABLE(test-mobilenet-combine net/test_mobilenet_combine.cpp test_helper.h test_include.h executor_for_test.h) - target_link_libraries(test-mobilenet-combine paddle-mobile) - - # gen test - ADD_EXECUTABLE(test-genet net/test_genet_combine.cpp test_helper.h test_include.h executor_for_test.h) - target_link_libraries(test-genet paddle-mobile) - - # gen test - ADD_EXECUTABLE(test-sigmoid operators/test_sigmoid_op.cpp test_include.h) - target_link_libraries(test-sigmoid paddle-mobile) - - # gen test - ADD_EXECUTABLE(test-depthwise-conv-op operators/test_depthwise_conv_op.cpp test_helper.h test_include.h executor_for_test.h) - target_link_libraries(test-depthwise-conv-op paddle-mobile) - - # gen test - ADD_EXECUTABLE(test-mobilenet net/test_mobilenet.cpp test_helper.h test_include.h executor_for_test.h) - target_link_libraries(test-mobilenet paddle-mobile) - - # gen test - ADD_EXECUTABLE(test-conv-add-relu-op operators/test_conv_add_relu_op.cpp test_helper.h test_include.h executor_for_test.h) - target_link_libraries(test-conv-add-relu-op paddle-mobile) - - # gen test - ADD_EXECUTABLE(test-conv-add-bn-relu-op operators/test_fusion_conv_add_bn_relu_op.cpp test_helper.h test_include.h executor_for_test.h) - target_link_libraries(test-conv-add-bn-relu-op paddle-mobile) - - # gen test - ADD_EXECUTABLE(test-nlp net/test_nlp.cpp test_helper.h test_include.h executor_for_test.h) - target_link_libraries(test-nlp paddle-mobile) - - # gen test - ADD_EXECUTABLE(test-gru-op operators/test_gru_op.cpp test_helper.h test_include.h) - target_link_libraries(test-gru-op paddle-mobile) - - # gen test - - ADD_EXECUTABLE(test-inceptionv4 net/test_inceptionv4.cpp test_helper.h test_include.h executor_for_test.h) - target_link_libraries(test-inceptionv4 paddle-mobile) - - # gen test - ADD_EXECUTABLE(test-alexnet net/test_alexnet.cpp test_helper.h test_include.h executor_for_test.h) - target_link_libraries(test-alexnet paddle-mobile) - - ADD_EXECUTABLE(test-googlenetv1 net/test_googlenetv1_combine.cpp test_helper.h test_include.h) - target_link_libraries(test-googlenetv1 paddle-mobile) - - # gen test - ADD_EXECUTABLE(test-fssd net/test_mobilenet_025_fssd.cpp test_helper.h test_include.h) - target_link_libraries(test-fssd paddle-mobile) +# # gen test +# ADD_EXECUTABLE(test-resnet net/test_resnet.cpp test_helper.h test_include.h executor_for_test.h) +# target_link_libraries(test-resnet paddle-mobile) +# +# # gen test +# ADD_EXECUTABLE(test-squeezenet net/test_squeezenet.cpp test_helper.h test_include.h executor_for_test.h) +# target_link_libraries(test-squeezenet paddle-mobile) +# +# # gen test +# ADD_EXECUTABLE(test-yolo net/test_yolo.cpp test_helper.h test_include.h executor_for_test.h) +# target_link_libraries(test-yolo paddle-mobile) +# +# # gen test +# ADD_EXECUTABLE(test-googlenet net/test_googlenet.cpp test_helper.h test_include.h executor_for_test.h) +# target_link_libraries(test-googlenet paddle-mobile) +# +# # gen test +# ADD_EXECUTABLE(test-conv-op operators/test_cov_op.cpp test_helper.h test_include.h executor_for_test.h) +# target_link_libraries(test-conv-op paddle-mobile) +# +# # gen test +# ADD_EXECUTABLE(test-mul-op operators/test_mul_op.cpp test_helper.h test_include.h) +# target_link_libraries(test-mul-op paddle-mobile) +# +# # gen test +# ADD_EXECUTABLE(test-elementwiseadd-op operators/test_elementwise_add_op.cpp test_helper.h test_include.h) +# target_link_libraries(test-elementwiseadd-op paddle-mobile) +# +# # gen test +# ADD_EXECUTABLE(test-concat-op operators/test_concat_op.cpp test_helper.h test_include.h) +# target_link_libraries(test-concat-op paddle-mobile) +# +# # gen test +# ADD_EXECUTABLE(test-lrn-op operators/test_lrn_op.cpp test_helper.h test_include.h) +# target_link_libraries(test-lrn-op paddle-mobile) +# +# # gen test +# ADD_EXECUTABLE(test-batchnorm-op operators/test_batchnorm_op.cpp test_helper.h test_include.h) +# target_link_libraries(test-batchnorm-op paddle-mobile) +# +# # gen test +# ADD_EXECUTABLE(test-priorbox-op operators/test_prior_box_op.cpp test_helper.h test_include.h) +# target_link_libraries(test-priorbox-op paddle-mobile) +# +# # gen test +# ADD_EXECUTABLE(test-boxcoder-op operators/test_box_coder_op.cpp test_helper.h test_include.h) +# target_link_libraries(test-boxcoder-op paddle-mobile) +# +# # gen test +# ADD_EXECUTABLE(test-transpose-op operators/test_transpose_op.cpp test_helper.h test_include.h) +# target_link_libraries(test-transpose-op paddle-mobile) +# +# # gen test +# ADD_EXECUTABLE(test-multiclassnms-op operators/test_multiclass_nms_op.cpp test_helper.h test_include.h) +# target_link_libraries(test-multiclassnms-op paddle-mobile) +# +# # gen test +# ADD_EXECUTABLE(test-reshape-op operators/test_reshape_op.cpp test_helper.h test_include.h) +# target_link_libraries(test-reshape-op paddle-mobile) +# +# # gen test +# ADD_EXECUTABLE(test-relu-op operators/test_relu_op.cpp test_helper.h test_include.h) +# target_link_libraries(test-relu-op paddle-mobile) +# +# # gen test +# ADD_EXECUTABLE(test-fc-op operators/test_fusion_fc_op.cpp test_helper.h test_include.h) +# target_link_libraries(test-fc-op paddle-mobile) +# +# # gen test log +# ADD_EXECUTABLE(test-log common/test_log.cpp) +# target_link_libraries(test-log paddle-mobile) +# +# # gen test log +# ADD_EXECUTABLE(test-load framework/test_load.cpp) +# target_link_libraries(test-load paddle-mobile) +# +# # gen test log +# ADD_EXECUTABLE(test-loadmemory framework/test_load_memory.cpp) +# target_link_libraries(test-loadmemory paddle-mobile) +# +# ADD_EXECUTABLE(test-inference-api framework/test_inference_api.cpp) +# target_link_libraries(test-inference-api paddle-mobile) +# +# +# # gen test log +# # gen test +# ADD_EXECUTABLE(test-optimize framework/test_optimize.cpp) +# target_link_libraries(test-optimize paddle-mobile) +# +# +# #gen test +# ADD_EXECUTABLE(test-pool operators/test_pool_op.cpp test_helper.h test_include.h executor_for_test.h) +# target_link_libraries(test-pool paddle-mobile) +# +# #gen test +# ADD_EXECUTABLE(test-softmax operators/test_softmax_op.cpp test_helper.h test_include.h executor_for_test.h) +# target_link_libraries(test-softmax paddle-mobile) +# +# # gen test +# ADD_EXECUTABLE(test-gemm-accuracy common/test_gemm_accuracy.cpp) +# target_link_libraries(test-gemm-accuracy paddle-mobile) +# +# # gen test +# ADD_EXECUTABLE(test-gemm-perf common/test_gemm_perf.cpp) +# target_link_libraries(test-gemm-perf paddle-mobile) +# +# # gen test +# ADD_EXECUTABLE(test-enforce common/test_enforce.cpp) +# target_link_libraries(test-enforce paddle-mobile) +# +# # gen test - test if openmp works +# ADD_EXECUTABLE(test-openmp common/test_openmp.cpp test_helper.h test_include.h executor_for_test.h) +# target_link_libraries(test-openmp paddle-mobile) +# +# # gen test +# ADD_EXECUTABLE(test-mobilenetssd net/test_mobilenet+ssd.cpp test_helper.h test_include.h executor_for_test.h) +# target_link_libraries(test-mobilenetssd paddle-mobile) +# +# # gen test +# ADD_EXECUTABLE(test-mobilenet-combine net/test_mobilenet_combine.cpp test_helper.h test_include.h executor_for_test.h) +# target_link_libraries(test-mobilenet-combine paddle-mobile) +# +# # gen test +# ADD_EXECUTABLE(test-genet net/test_genet_combine.cpp test_helper.h test_include.h executor_for_test.h) +# target_link_libraries(test-genet paddle-mobile) +# +# # gen test +# ADD_EXECUTABLE(test-sigmoid operators/test_sigmoid_op.cpp test_include.h) +# target_link_libraries(test-sigmoid paddle-mobile) +# +# # gen test +# ADD_EXECUTABLE(test-depthwise-conv-op operators/test_depthwise_conv_op.cpp test_helper.h test_include.h executor_for_test.h) +# target_link_libraries(test-depthwise-conv-op paddle-mobile) +# +# # gen test +# ADD_EXECUTABLE(test-mobilenet net/test_mobilenet.cpp test_helper.h test_include.h executor_for_test.h) +# target_link_libraries(test-mobilenet paddle-mobile) +# +# # gen test +# ADD_EXECUTABLE(test-conv-add-relu-op operators/test_conv_add_relu_op.cpp test_helper.h test_include.h executor_for_test.h) +# target_link_libraries(test-conv-add-relu-op paddle-mobile) +# +# # gen test +# ADD_EXECUTABLE(test-conv-add-bn-relu-op operators/test_fusion_conv_add_bn_relu_op.cpp test_helper.h test_include.h executor_for_test.h) +# target_link_libraries(test-conv-add-bn-relu-op paddle-mobile) +# +# # gen test +# ADD_EXECUTABLE(test-nlp net/test_nlp.cpp test_helper.h test_include.h executor_for_test.h) +# target_link_libraries(test-nlp paddle-mobile) +# +# # gen test +# ADD_EXECUTABLE(test-gru-op operators/test_gru_op.cpp test_helper.h test_include.h) +# target_link_libraries(test-gru-op paddle-mobile) +# +# # gen test +# +# ADD_EXECUTABLE(test-inceptionv4 net/test_inceptionv4.cpp test_helper.h test_include.h executor_for_test.h) +# target_link_libraries(test-inceptionv4 paddle-mobile) +# +# # gen test +# ADD_EXECUTABLE(test-alexnet net/test_alexnet.cpp test_helper.h test_include.h executor_for_test.h) +# target_link_libraries(test-alexnet paddle-mobile) +# +# ADD_EXECUTABLE(test-googlenetv1 net/test_googlenetv1_combine.cpp test_helper.h test_include.h) +# target_link_libraries(test-googlenetv1 paddle-mobile) +# +# # gen test +# ADD_EXECUTABLE(test-fssd net/test_mobilenet_025_fssd.cpp test_helper.h test_include.h) +# target_link_libraries(test-fssd paddle-mobile) # gen test ADD_EXECUTABLE(test-mobilenetgpu net/test_mobilenet_GPU.cpp test_helper.h test_include.h) -- GitLab