[CPU] Change the location of nnacl directory

This commit is contained in:
zhanyuan 2021-04-08 16:02:36 +08:00
parent 018617a091
commit 428f45162e
944 changed files with 1439 additions and 1410 deletions

View File

@ -153,15 +153,15 @@ if(PLATFORM_ARM64)
COMPONENT ${RUNTIME_COMPONENT_NAME})
install(DIRECTORY ${TOP_DIR}/include/api/ DESTINATION ${RUNTIME_INC_DIR}/api
COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h" PATTERN "ops*" EXCLUDE)
file(GLOB NNACL_FILES GLOB ${TOP_DIR}/mindspore/lite/nnacl/*.h)
file(GLOB NNACL_FILES GLOB ${NNACL_DIR}/*.h)
install(FILES ${NNACL_FILES} DESTINATION ${CODEGEN_ROOT_DIR}/include/nnacl COMPONENT ${RUNTIME_COMPONENT_NAME})
install(DIRECTORY ${TOP_DIR}/mindspore/lite/nnacl/base DESTINATION ${CODEGEN_ROOT_DIR}/include/nnacl
install(DIRECTORY ${NNACL_DIR}/base DESTINATION ${CODEGEN_ROOT_DIR}/include/nnacl
COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h")
install(DIRECTORY ${TOP_DIR}/mindspore/lite/nnacl/int8 DESTINATION ${CODEGEN_ROOT_DIR}/include/nnacl
install(DIRECTORY ${NNACL_DIR}/int8 DESTINATION ${CODEGEN_ROOT_DIR}/include/nnacl
COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h")
install(DIRECTORY ${TOP_DIR}/mindspore/lite/nnacl/fp32 DESTINATION ${CODEGEN_ROOT_DIR}/include/nnacl
install(DIRECTORY ${NNACL_DIR}/fp32 DESTINATION ${CODEGEN_ROOT_DIR}/include/nnacl
COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h")
install(DIRECTORY ${TOP_DIR}/mindspore/lite/nnacl/intrinsics DESTINATION ${CODEGEN_ROOT_DIR}/include/nnacl
install(DIRECTORY ${NNACL_DIR}/intrinsics DESTINATION ${CODEGEN_ROOT_DIR}/include/nnacl
COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h")
install(DIRECTORY ${TOP_DIR}/mindspore/lite/micro/coder/wrapper DESTINATION ${CODEGEN_ROOT_DIR}/include
COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h")
@ -185,15 +185,15 @@ elseif(PLATFORM_ARM32)
COMPONENT ${RUNTIME_COMPONENT_NAME})
install(DIRECTORY ${TOP_DIR}/include/api/ DESTINATION ${RUNTIME_INC_DIR}/api
COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h" PATTERN "ops*" EXCLUDE)
file(GLOB NNACL_FILES GLOB ${TOP_DIR}/mindspore/lite/nnacl/*.h)
file(GLOB NNACL_FILES GLOB ${NNACL_DIR}/*.h)
install(FILES ${NNACL_FILES} DESTINATION ${CODEGEN_ROOT_DIR}/include/nnacl COMPONENT ${RUNTIME_COMPONENT_NAME})
install(DIRECTORY ${TOP_DIR}/mindspore/lite/nnacl/base DESTINATION ${CODEGEN_ROOT_DIR}/include/nnacl
install(DIRECTORY ${NNACL_DIR}/base DESTINATION ${CODEGEN_ROOT_DIR}/include/nnacl
COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h")
install(DIRECTORY ${TOP_DIR}/mindspore/lite/nnacl/int8 DESTINATION ${CODEGEN_ROOT_DIR}/include/nnacl
install(DIRECTORY ${NNACL_DIR}/int8 DESTINATION ${CODEGEN_ROOT_DIR}/include/nnacl
COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h")
install(DIRECTORY ${TOP_DIR}/mindspore/lite/nnacl/fp32 DESTINATION ${CODEGEN_ROOT_DIR}/include/nnacl
install(DIRECTORY ${NNACL_DIR}/fp32 DESTINATION ${CODEGEN_ROOT_DIR}/include/nnacl
COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h")
install(DIRECTORY ${TOP_DIR}/mindspore/lite/nnacl/intrinsics DESTINATION ${CODEGEN_ROOT_DIR}/include/nnacl
install(DIRECTORY ${NNACL_DIR}/intrinsics DESTINATION ${CODEGEN_ROOT_DIR}/include/nnacl
COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h")
install(DIRECTORY ${TOP_DIR}/mindspore/lite/micro/coder/wrapper DESTINATION ${CODEGEN_ROOT_DIR}/include
COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h")
@ -262,15 +262,15 @@ else()
install(FILES ${glog_LIBPATH}/libglog.so.0.4.0
DESTINATION ${CONVERTER_ROOT_DIR}/third_party/glog/lib RENAME libglog.so.0
COMPONENT ${RUNTIME_COMPONENT_NAME})
file(GLOB NNACL_FILES GLOB ${TOP_DIR}/mindspore/lite/nnacl/*.h)
file(GLOB NNACL_FILES GLOB ${NNACL_DIR}/*.h)
install(FILES ${NNACL_FILES} DESTINATION ${CODEGEN_ROOT_DIR}/include/nnacl COMPONENT ${RUNTIME_COMPONENT_NAME})
install(DIRECTORY ${TOP_DIR}/mindspore/lite/nnacl/base DESTINATION ${CODEGEN_ROOT_DIR}/include/nnacl
install(DIRECTORY ${NNACL_DIR}/base DESTINATION ${CODEGEN_ROOT_DIR}/include/nnacl
COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h")
install(DIRECTORY ${TOP_DIR}/mindspore/lite/nnacl/int8 DESTINATION ${CODEGEN_ROOT_DIR}/include/nnacl
install(DIRECTORY ${NNACL_DIR}/int8 DESTINATION ${CODEGEN_ROOT_DIR}/include/nnacl
COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h")
install(DIRECTORY ${TOP_DIR}/mindspore/lite/nnacl/fp32 DESTINATION ${CODEGEN_ROOT_DIR}/include/nnacl
install(DIRECTORY ${NNACL_DIR}/fp32 DESTINATION ${CODEGEN_ROOT_DIR}/include/nnacl
COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h")
install(DIRECTORY ${TOP_DIR}/mindspore/lite/nnacl/intrinsics DESTINATION ${CODEGEN_ROOT_DIR}/include/nnacl
install(DIRECTORY ${NNACL_DIR}/intrinsics DESTINATION ${CODEGEN_ROOT_DIR}/include/nnacl
COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h")
install(DIRECTORY ${TOP_DIR}/mindspore/lite/micro/coder/wrapper DESTINATION ${CODEGEN_ROOT_DIR}/include
COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h")

View File

@ -4,6 +4,7 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR})
include_directories(${CMAKE_BINARY_DIR})
if(ENABLE_CPU)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/backend/kernel_compiler/cpu)
if("${X86_64_SIMD}" STREQUAL "sse")
add_compile_definitions(ENABLE_SSE)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse4.2")
@ -12,8 +13,8 @@ if(ENABLE_CPU)
if("${X86_64_SIMD}" STREQUAL "avx")
add_compile_definitions(ENABLE_SSE)
add_compile_definitions(ENABLE_AVX)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mavx2")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mavx2")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse4.1 -mavx -mavx2")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse4.1 -mavx -mavx2")
endif()
endif()

View File

@ -29,8 +29,35 @@ if(ENABLE_D)
endif()
if(ENABLE_CPU)
file(GLOB_RECURSE CPU_SRC_LIST RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
file(GLOB NNACL_C_SRC RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
"cpu/nnacl/*.c"
"cpu/nnacl/fp32/*.c"
"cpu/nnacl/int8/*.c"
"cpu/nnacl/infer/*.c"
"cpu/nnacl/base/*.c"
)
if("${X86_64_SIMD}" STREQUAL "sse")
file(GLOB NNACL_ASM_SRC RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
"cpu/nnacl/intrinsics/sse/*.c"
)
set_property(SOURCE ${NNACL_ASM_SRC} PROPERTY LANGUAGE C)
endif()
if("${X86_64_SIMD}" STREQUAL "avx")
file(GLOB NNACL_ASM_SRC RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
"cpu/nnacl/intrinsics/sse/*.c"
"cpu/nnacl/intrinsics/avx/*.c"
"cpu/nnacl/assembly/avx/*.S"
)
set_property(SOURCE ${NNACL_ASM_SRC} PROPERTY LANGUAGE C)
endif()
set(NNACL_SRC ${NNACL_C_SRC} ${NNACL_ASM_SRC})
file(GLOB CPU_SRC_LIST RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
"cpu/*.cc"
"cpu/mkldnn/*.cc"
"cpu/ps/*.cc"
"cpu/quantum/*.cc"
)
if(NOT ENABLE_MPI)
@ -102,7 +129,7 @@ if(ENABLE_GPU)
# add_library(_mindspore_kernel_cuda_obj OBJECT ${CUDA_SRC_LIST})
endif()
set_property(SOURCE ${KERNEL_SRC_LIST} ${CPU_SRC_LIST} ${GPU_SRC_LIST} ${D_SRC_LIST}
set_property(SOURCE ${KERNEL_SRC_LIST} ${NNACL_SRC} ${CPU_SRC_LIST} ${GPU_SRC_LIST} ${D_SRC_LIST}
PROPERTY COMPILE_DEFINITIONS SUBMODULE_ID=mindspore::SubModuleId::SM_KERNEL)
add_library(_mindspore_backend_kernel_compiler_obj OBJECT ${KERNEL_SRC_LIST} ${CPU_SRC_LIST}
add_library(_mindspore_backend_kernel_compiler_obj OBJECT ${KERNEL_SRC_LIST} ${NNACL_SRC} ${CPU_SRC_LIST}
${GPU_SRC_LIST} ${D_SRC_LIST} ${QUANTUM_SRC_LIST})

View File

@ -13,8 +13,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef MINDSPORE_LITE_NNACL_ADDER_H_
#define MINDSPORE_LITE_NNACL_ADDER_H_
#ifndef MINDSPORE_NNACL_ADDER_H_
#define MINDSPORE_NNACL_ADDER_H_
#include "nnacl/op_base.h"
@ -29,4 +29,4 @@ extern "C" {
#ifdef __cplusplus
}
#endif
#endif // MINDSPORE_LITE_NNACL_ADDER_H_
#endif // MINDSPORE_NNACL_ADDER_H_

View File

@ -14,8 +14,8 @@
* limitations under the License.
*/
#ifndef MINDSPORE_LITE_NNACL_ARG_MIN_MAX_PARAMETER_H_
#define MINDSPORE_LITE_NNACL_ARG_MIN_MAX_PARAMETER_H_
#ifndef MINDSPORE_NNACL_ARG_MIN_MAX_PARAMETER_H_
#define MINDSPORE_NNACL_ARG_MIN_MAX_PARAMETER_H_
#ifdef ENABLE_ARM64
#include <arm_neon.h>
@ -51,4 +51,4 @@ typedef struct ArgMinMaxParameter {
ArgElement *arg_elements_;
} ArgMinMaxParameter;
#endif // MINDSPORE_LITE_NNACL_ARG_MIN_MAX_PARAMETER_H_
#endif // MINDSPORE_NNACL_ARG_MIN_MAX_PARAMETER_H_

View File

@ -14,8 +14,8 @@
* limitations under the License.
*/
#ifndef MINDSPORE_LITE_NNACL_ARTITHMETIC_H_
#define MINDSPORE_LITE_NNACL_ARTITHMETIC_H_
#ifndef MINDSPORE_NNACL_ARTITHMETIC_H_
#define MINDSPORE_NNACL_ARTITHMETIC_H_
#include "nnacl/op_base.h"
#include "nnacl/common_func.h"
@ -43,4 +43,4 @@ typedef struct ArithmeticParameter {
int eltwise_mode_; // eltwise need
} ArithmeticParameter;
#endif // MINDSPORE_LITE_NNACL_ARTITHMETIC_H_
#endif // MINDSPORE_NNACL_ARTITHMETIC_H_

View File

@ -14,8 +14,8 @@
* limitations under the License.
*/
#ifndef MINDSPORE_LITE_NNACL_ARITHMETIC_SELF_PARAMETER_H_
#define MINDSPORE_LITE_NNACL_ARITHMETIC_SELF_PARAMETER_H_
#ifndef MINDSPORE_NNACL_ARITHMETIC_SELF_PARAMETER_H_
#define MINDSPORE_NNACL_ARITHMETIC_SELF_PARAMETER_H_
#include "nnacl/op_base.h"
#include "nnacl/errorcode.h"
@ -27,4 +27,4 @@ typedef struct ArithmeticSelfParameter {
ArithSelfQuantArg quant_arg_;
} ArithmeticSelfParameter;
#endif // MINDSPORE_LITE_NNACL_ARITHMETIC_SELF_PARAMETER_H_
#endif // MINDSPORE_NNACL_ARITHMETIC_SELF_PARAMETER_H_

Some files were not shown because too many files have changed in this diff Show More