forked from mindspore-Ecosystem/mindspore
fix win32 build
This commit is contained in:
parent
0af22f071a
commit
4f70145b43
20
build.bat
20
build.bat
|
@ -21,16 +21,8 @@ SET BUILD_PATH=%BASE_PATH%/build
|
||||||
SET threads=8
|
SET threads=8
|
||||||
SET ENABLE_GITEE=OFF
|
SET ENABLE_GITEE=OFF
|
||||||
|
|
||||||
set VERSION_MAJOR=''
|
set VERSION_STR=''
|
||||||
set VERSION_MINOR=''
|
for /f "tokens=1" %%a in (version.txt) do (set VERSION_STR=%%a)
|
||||||
set ERSION_REVISION=''
|
|
||||||
|
|
||||||
for /f "delims=\= tokens=2" %%a in ('findstr /C:"const int ms_version_major = " mindspore\lite\include\version.h') do (set x=%%a)
|
|
||||||
set VERSION_MAJOR=%x:~1,1%
|
|
||||||
for /f "delims=\= tokens=2" %%b in ('findstr /C:"const int ms_version_minor = " mindspore\lite\include\version.h') do (set y=%%b)
|
|
||||||
set VERSION_MINOR=%y:~1,1%
|
|
||||||
for /f "delims=\= tokens=2" %%c in ('findstr /C:"const int ms_version_revision = " mindspore\lite\include\version.h') do (set z=%%c)
|
|
||||||
set VERSION_REVISION=%z:~1,1%
|
|
||||||
|
|
||||||
ECHO %2%|FINDSTR "^[0-9][0-9]*$"
|
ECHO %2%|FINDSTR "^[0-9][0-9]*$"
|
||||||
IF %errorlevel% == 0 (
|
IF %errorlevel% == 0 (
|
||||||
|
@ -52,16 +44,14 @@ IF NOT EXIST "%BUILD_PATH%/mindspore" (
|
||||||
|
|
||||||
cd %BUILD_PATH%/mindspore
|
cd %BUILD_PATH%/mindspore
|
||||||
IF "%1%" == "lite" (
|
IF "%1%" == "lite" (
|
||||||
echo "======Start building MindSpore Lite %VERSION_MAJOR%.%VERSION_MINOR%.%VERSION_REVISION%======"
|
echo "======Start building MindSpore Lite %VERSION_STR%======"
|
||||||
rd /s /q "%BASE_PATH%\output"
|
rd /s /q "%BASE_PATH%\output"
|
||||||
(git log -1 | findstr "^commit") > %BUILD_PATH%\.commit_id
|
(git log -1 | findstr "^commit") > %BUILD_PATH%\.commit_id
|
||||||
IF defined VisualStudioVersion (
|
IF defined VisualStudioVersion (
|
||||||
cmake -DMSLITE_MINDDATA_IMPLEMENT=off -DMSLITE_ENABLE_TRAIN=off ^
|
cmake -DMSLITE_MINDDATA_IMPLEMENT=off -DMSLITE_ENABLE_TRAIN=off -DVERSION_STR=%VERSION_STR% ^
|
||||||
-DMS_VERSION_MAJOR=%VERSION_MAJOR% -DMS_VERSION_MINOR=%VERSION_MINOR% -DMS_VERSION_REVISION=%VERSION_REVISION% ^
|
|
||||||
-DCMAKE_BUILD_TYPE=Release -G "Ninja" "%BASE_PATH%/mindspore/lite"
|
-DCMAKE_BUILD_TYPE=Release -G "Ninja" "%BASE_PATH%/mindspore/lite"
|
||||||
) ELSE (
|
) ELSE (
|
||||||
cmake -DMSLITE_MINDDATA_IMPLEMENT=off -DMSLITE_ENABLE_TRAIN=off ^
|
cmake -DMSLITE_MINDDATA_IMPLEMENT=off -DMSLITE_ENABLE_TRAIN=off -DVERSION_STR=%VERSION_STR% ^
|
||||||
-DMS_VERSION_MAJOR=%VERSION_MAJOR% -DMS_VERSION_MINOR=%VERSION_MINOR% -DMS_VERSION_REVISION=%VERSION_REVISION% ^
|
|
||||||
-DCMAKE_BUILD_TYPE=Release -G "CodeBlocks - MinGW Makefiles" "%BASE_PATH%/mindspore/lite"
|
-DCMAKE_BUILD_TYPE=Release -G "CodeBlocks - MinGW Makefiles" "%BASE_PATH%/mindspore/lite"
|
||||||
)
|
)
|
||||||
) ELSE (
|
) ELSE (
|
||||||
|
|
|
@ -105,8 +105,7 @@ if(PLATFORM_ARM32)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if("${X86_64_SIMD}" STREQUAL "sse")
|
if("${X86_64_SIMD}" STREQUAL "sse")
|
||||||
file(GLOB ASSEMBLY_SRC ${NNACL_DIR}/intrinsics/sse/*.c
|
file(GLOB ASSEMBLY_SRC ${NNACL_DIR}/intrinsics/sse/*.c)
|
||||||
${NNACL_DIR}/intrinsics/ms_simd_cpu_info.c)
|
|
||||||
set_property(SOURCE ${ASSEMBLY_SRC} PROPERTY LANGUAGE C)
|
set_property(SOURCE ${ASSEMBLY_SRC} PROPERTY LANGUAGE C)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
|
@ -17,14 +17,14 @@
|
||||||
#ifndef MINDSPORE_LITE_SRC_CPU_INFO_H
|
#ifndef MINDSPORE_LITE_SRC_CPU_INFO_H
|
||||||
#define MINDSPORE_LITE_SRC_CPU_INFO_H
|
#define MINDSPORE_LITE_SRC_CPU_INFO_H
|
||||||
|
|
||||||
#if defined(ENABLE_AVX512) || defined(ENABLE_AVX) || defined(ENABLE_SSE)
|
#if defined(ENABLE_AVX512) || defined(ENABLE_AVX)
|
||||||
#include "nnacl/intrinsics/ms_simd_cpu_info.h"
|
#include "nnacl/intrinsics/ms_simd_cpu_info.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
inline bool PlatformInstructionSetSupportCheck() {
|
inline bool PlatformInstructionSetSupportCheck() {
|
||||||
bool flag = true;
|
bool flag = true;
|
||||||
|
|
||||||
#if defined(ENABLE_AVX512) || defined(ENABLE_AVX) || defined(ENABLE_SSE)
|
#if defined(ENABLE_AVX512) || defined(ENABLE_AVX)
|
||||||
flag = IntelX86InstructionSetSupportCheck();
|
flag = IntelX86InstructionSetSupportCheck();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue