win add sse/avx logic
This commit is contained in:
parent
4a7c87f442
commit
0a5ef19063
24
build.bat
24
build.bat
|
@ -29,8 +29,29 @@ del version.txt
|
|||
echo "======Start building MindSpore Lite %VERSION_MAJOR%.%VERSION_MINOR%.%VERSION_REVISION%======"
|
||||
|
||||
SET threads=6
|
||||
IF NOT "%2%" == "" (
|
||||
SET X86_64_SIMD=off
|
||||
|
||||
ECHO %2%|FINDSTR "^[0-9][0-9]*$"
|
||||
IF %errorlevel% == 0 (
|
||||
SET threads=%2%
|
||||
) ELSE (
|
||||
IF NOT "%2%" == "" (
|
||||
IF "%2%" == "avx" (
|
||||
SET X86_64_SIMD=avx
|
||||
) ELSE IF "%2%" == "sse" (
|
||||
SET X86_64_SIMD=sse
|
||||
) ELSE IF "%2%" == "off" (
|
||||
SET X86_64_SIMD=off
|
||||
) ELSE IF "%2%" == "avx512" (
|
||||
SET X86_64_SIMD=avx512
|
||||
) ELSE (
|
||||
echo "MindSpore_lite the second parameter must in [avx, avx512, sse, off], but now is [%2%]"
|
||||
call :run_fail
|
||||
)
|
||||
IF NOT "%3%" == "" (
|
||||
SET threads=%3%
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
SET BASE_PATH=%CD%
|
||||
|
@ -49,6 +70,7 @@ IF "%1%" == "lite" (
|
|||
-DENABLE_TOOLS=on -DENABLE_CONVERTER=on -DBUILD_TESTCASES=off ^
|
||||
-DCMAKE_BUILD_TYPE=Release -DSUPPORT_GPU=off -DBUILD_MINDDATA=off -DOFFLINE_COMPILE=off ^
|
||||
-DMS_VERSION_MAJOR=%VERSION_MAJOR% -DMS_VERSION_MINOR=%VERSION_MINOR% -DMS_VERSION_REVISION=%VERSION_REVISION% ^
|
||||
-DX86_64_SIMD=%X86_64_SIMD% ^
|
||||
-G "CodeBlocks - MinGW Makefiles" "%BASE_PATH%/mindspore/lite"
|
||||
) ELSE (
|
||||
cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_CPU=ON -DENABLE_MINDDATA=ON -DUSE_GLOG=ON ^
|
||||
|
|
|
@ -82,14 +82,18 @@ else ()
|
|||
elseif (WIN32)
|
||||
set(PARSER_NAME libconverter-parser-win-${PROCESS_UNIT})
|
||||
set(COMPONENT_NAME converter-win-${PROCESS_UNIT})
|
||||
set(WIN_RUN_X86_NAME win-runtime-x86-${PROCESS_UNIT})
|
||||
if ("${X86_64_SIMD}" STREQUAL "off")
|
||||
set(WIN_RUN_X86_NAME win-runtime-x86-${PROCESS_UNIT})
|
||||
else ()
|
||||
set(WIN_RUN_X86_NAME win-runtime-x86-${X86_64_SIMD}-${PROCESS_UNIT})
|
||||
endif()
|
||||
else ()
|
||||
set(COMPONENT_NAME converter-ubuntu)
|
||||
endif ()
|
||||
if ("${X86_64_SIMD}" STREQUAL "sse")
|
||||
set(RUN_X86_COMPONENT_NAME runtime-x86-${X86_64_SIMD}-${PROCESS_UNIT})
|
||||
else ()
|
||||
endif()
|
||||
if ("${X86_64_SIMD}" STREQUAL "off")
|
||||
set(RUN_X86_COMPONENT_NAME runtime-x86-${PROCESS_UNIT})
|
||||
else ()
|
||||
set(RUN_X86_COMPONENT_NAME runtime-x86-${X86_64_SIMD}-${PROCESS_UNIT})
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
|
|
|
@ -44,7 +44,18 @@ IF NOT %errorlevel% == 0 (
|
|||
SET RET_CODE=1
|
||||
goto run_eof
|
||||
)
|
||||
7z x -r "%TOOL_PATH%/mindspore-lite-*-win-runtime-x86-cpu.zip" -o"%BENCHMARK_BASE%"
|
||||
|
||||
SET SO_PATH=mindspore-lite-*-win-runtime-x86-cpu
|
||||
IF "%3%" == "sse" (
|
||||
SET SO_PATH=mindspore-lite-*-win-runtime-x86-sse-cpu
|
||||
)
|
||||
IF "%3%" == "avx" (
|
||||
SET SO_PATH=mindspore-lite-*-win-runtime-x86-avx-cpu
|
||||
)
|
||||
IF "%3%" == "avx512" (
|
||||
SET SO_PATH=mindspore-lite-*-win-runtime-x86-avx512-cpu
|
||||
)
|
||||
7z x -r "%TOOL_PATH%/%SO_PATH%.zip" -o"%BENCHMARK_BASE%"
|
||||
IF NOT %errorlevel% == 0 (
|
||||
echo "Decompression of runtime tool fail!"
|
||||
SET RET_CODE=1
|
||||
|
@ -87,7 +98,7 @@ for /f "tokens=1-2 delims= " %%i in (%MODEL_CONFIG%) do (
|
|||
)
|
||||
|
||||
echo "Run converted models"
|
||||
cd /d %BENCHMARK_BASE%/mindspore-lite-*-win-runtime-x86-cpu/benchmark
|
||||
cd /d %BENCHMARK_BASE%/%SO_PATH%/benchmark
|
||||
SET INPUT_BASE=%MODEL_PATH%/input_output/input
|
||||
SET OUTPUT_BASE=%MODEL_PATH%/input_output/output
|
||||
|
||||
|
|
Loading…
Reference in New Issue