Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions test/cpp/inference/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
add_definitions(-DPADDLE_DLL_EXPORT)
if(WITH_TESTING)
include(test.cmake) # some generic cmake function for inference
include(test_cases.cmake)
endif()

add_subdirectory(analysis)
Expand Down
29 changes: 0 additions & 29 deletions test/cpp/inference/test.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -73,35 +73,6 @@ function(inference_download_and_uncompress_without_verify INSTALL_DIR URL
INSTALL_COMMAND "")
endfunction()

set(WORD2VEC_INSTALL_DIR "${INFERENCE_DEMO_INSTALL_DIR}/word2vec")
if(NOT EXISTS ${WORD2VEC_INSTALL_DIR}/word2vec.inference.model.tar.gz)
inference_download_and_uncompress_without_verify(
${WORD2VEC_INSTALL_DIR} ${INFERENCE_URL} "word2vec.inference.model.tar.gz")
endif()
set(WORD2VEC_MODEL_DIR "${WORD2VEC_INSTALL_DIR}/word2vec.inference.model")

set(IMG_CLS_RESNET_INSTALL_DIR
"${INFERENCE_DEMO_INSTALL_DIR}/image_classification_resnet")
if(NOT EXISTS
${IMG_CLS_RESNET_INSTALL_DIR}/image_classification_resnet.inference.model.tgz
)
inference_download_and_uncompress_without_verify(
${IMG_CLS_RESNET_INSTALL_DIR} ${INFERENCE_URL}
"image_classification_resnet.inference.model.tgz")
endif()
set(IMG_CLS_RESNET_MODEL_DIR
"${IMG_CLS_RESNET_INSTALL_DIR}/image_classification_resnet.inference.model")

if(WITH_ONNXRUNTIME)
set(MOBILENETV2_INSTALL_DIR "${INFERENCE_DEMO_INSTALL_DIR}/MobileNetV2")
if(NOT EXISTS ${MOBILENETV2_INSTALL_DIR}/MobileNetV2.inference.model.tar.gz)
inference_download_and_uncompress_without_verify(
${MOBILENETV2_INSTALL_DIR} ${INFERENCE_URL}
"MobileNetV2.inference.model.tar.gz")
endif()
set(MOBILENETV2_MODEL_DIR "${MOBILENETV2_INSTALL_DIR}/MobileNetV2")
endif()

function(inference_base_test_build TARGET)
set(options "")
set(oneValueArgs "")
Expand Down
34 changes: 34 additions & 0 deletions test/cpp/inference/test_cases.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
include(test.cmake) # some generic cmake function for inference

set(WORD2VEC_INSTALL_DIR "${INFERENCE_DEMO_INSTALL_DIR}/word2vec")

if(NOT EXISTS ${WORD2VEC_INSTALL_DIR}/word2vec.inference.model.tar.gz)
inference_download_and_uncompress_without_verify(
${WORD2VEC_INSTALL_DIR} ${INFERENCE_URL} "word2vec.inference.model.tar.gz")
endif()

set(WORD2VEC_MODEL_DIR "${WORD2VEC_INSTALL_DIR}/word2vec.inference.model")

set(IMG_CLS_RESNET_INSTALL_DIR
"${INFERENCE_DEMO_INSTALL_DIR}/image_classification_resnet")

if(NOT EXISTS
${IMG_CLS_RESNET_INSTALL_DIR}/image_classification_resnet.inference.model.tgz
)
inference_download_and_uncompress_without_verify(
${IMG_CLS_RESNET_INSTALL_DIR} ${INFERENCE_URL}
"image_classification_resnet.inference.model.tgz")
endif()

set(IMG_CLS_RESNET_MODEL_DIR
"${IMG_CLS_RESNET_INSTALL_DIR}/image_classification_resnet.inference.model")

if(WITH_ONNXRUNTIME)
set(MOBILENETV2_INSTALL_DIR "${INFERENCE_DEMO_INSTALL_DIR}/MobileNetV2")
if(NOT EXISTS ${MOBILENETV2_INSTALL_DIR}/MobileNetV2.inference.model.tar.gz)
inference_download_and_uncompress_without_verify(
${MOBILENETV2_INSTALL_DIR} ${INFERENCE_URL}
"MobileNetV2.inference.model.tar.gz")
endif()
set(MOBILENETV2_MODEL_DIR "${MOBILENETV2_INSTALL_DIR}/MobileNetV2")
endif()
4 changes: 1 addition & 3 deletions test/quantization/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
if(ON_INFER)
include(../cpp/inference/test.cmake)
endif()
include(../cpp/inference/test.cmake)
file(
GLOB TEST_OPS
RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}"
Expand Down