diff --git a/cmake/package_micro.cmake b/cmake/package_micro.cmake index 7c8fbff4197..2f72f93fa7d 100644 --- a/cmake/package_micro.cmake +++ b/cmake/package_micro.cmake @@ -10,7 +10,7 @@ function(__install_micro_wrapper) COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h") install(DIRECTORY ${NNACL_DIR}/fp32 DESTINATION ${CODEGEN_ROOT_DIR}/include/nnacl COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h") - install(FILES ${NNACL_DIR}/fp32_grad/activation_grad.h DESTINATION + install(FILES ${NNACL_DIR}/fp32_grad/activation_grad_fp32.h DESTINATION ${CODEGEN_ROOT_DIR}/include/nnacl/fp32_grad COMPONENT ${RUNTIME_COMPONENT_NAME}) install(FILES ${NNACL_DIR}/fp32_grad/softmax_cross_entropy_with_logits.h DESTINATION ${CODEGEN_ROOT_DIR}/include/nnacl/fp32_grad COMPONENT ${RUNTIME_COMPONENT_NAME}) diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/eltwise_grad_cpu_kernel.cc b/mindspore/ccsrc/plugin/device/cpu/kernel/eltwise_grad_cpu_kernel.cc index 726ad70a3ff..bad5b1c3e5f 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/eltwise_grad_cpu_kernel.cc +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/eltwise_grad_cpu_kernel.cc @@ -21,7 +21,7 @@ #include #include "include/common/thread_pool.h" #include "plugin/device/cpu/hal/device/cpu_device_address.h" -#include "nnacl/fp32_grad/activation_grad.h" +#include "nnacl/fp32_grad/activation_grad_fp32.h" #include "nnacl/fp32_grad/arithmetic_grad.h" #include "nnacl/errorcode.h" diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/hshrink_grad_cpu_kernel.cc b/mindspore/ccsrc/plugin/device/cpu/kernel/hshrink_grad_cpu_kernel.cc index 6bbc646046c..7d19391b570 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/hshrink_grad_cpu_kernel.cc +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/hshrink_grad_cpu_kernel.cc @@ -18,7 +18,7 @@ #include #include "mindspore/core/ops/grad/hshrink_grad.h" #include "plugin/factory/ms_factory.h" -#include "plugin/device/cpu/kernel/nnacl/fp32_grad/activation_grad.h" +#include "plugin/device/cpu/kernel/nnacl/fp32_grad/activation_grad_fp32.h" namespace mindspore { namespace kernel { diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/fp16_grad/activation_grad.c b/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/fp16_grad/activation_grad_fp16.c similarity index 98% rename from mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/fp16_grad/activation_grad.c rename to mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/fp16_grad/activation_grad_fp16.c index fd5853a4fca..11499071413 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/fp16_grad/activation_grad.c +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/fp16_grad/activation_grad_fp16.c @@ -1,5 +1,5 @@ /** - * Copyright 2021 Huawei Technologies Co., Ltd + * Copyright 2021-2022 Huawei Technologies Co., Ltd * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "nnacl/fp16_grad/activation_grad.h" +#include "nnacl/fp16_grad/activation_grad_fp16.h" #include #include #ifdef ENABLE_NEON diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/fp16_grad/activation_grad.h b/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/fp16_grad/activation_grad_fp16.h similarity index 86% rename from mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/fp16_grad/activation_grad.h rename to mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/fp16_grad/activation_grad_fp16.h index d787b5fc20e..5923898f80e 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/fp16_grad/activation_grad.h +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/fp16_grad/activation_grad_fp16.h @@ -13,8 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#ifndef MINDSPORE_CCSRC_BACKEND_KERNEL_COMPILER_CPU_NNACL_FP16_GRAD_ACTIVATION_GRAD_H_ -#define MINDSPORE_CCSRC_BACKEND_KERNEL_COMPILER_CPU_NNACL_FP16_GRAD_ACTIVATION_GRAD_H_ +#ifndef MINDSPORE_CCSRC_PLUGIN_DEVICE_CPU_KERNEL_NNACL_FP16_GRAD_ACTIVATION_GRAD_FP16_H_ +#define MINDSPORE_CCSRC_PLUGIN_DEVICE_CPU_KERNEL_NNACL_FP16_GRAD_ACTIVATION_GRAD_FP16_H_ #ifdef ENABLE_NEON #include @@ -41,4 +41,4 @@ int GeluFp16Grad(const float16_t *src0, const float16_t *src1, int length, float } #endif -#endif // MINDSPORE_CCSRC_BACKEND_KERNEL_COMPILER_CPU_NNACL_FP16_GRAD_ACTIVATION_GRAD_H_ +#endif // MINDSPORE_CCSRC_PLUGIN_DEVICE_CPU_KERNEL_NNACL_FP16_GRAD_ACTIVATION_GRAD_FP16_H_ diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/fp32_grad/activation_grad.c b/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/fp32_grad/activation_grad_fp32.c similarity index 99% rename from mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/fp32_grad/activation_grad.c rename to mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/fp32_grad/activation_grad_fp32.c index f7e2f24b6a1..6f68d159c1f 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/fp32_grad/activation_grad.c +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/fp32_grad/activation_grad_fp32.c @@ -18,7 +18,7 @@ #include "nnacl/op_base.h" #include "nnacl/fp32/arithmetic_fp32.h" #include "nnacl/fp32/exp_fp32.h" -#include "nnacl/fp32_grad/activation_grad.h" +#include "nnacl/fp32_grad/activation_grad_fp32.h" #include "nnacl/errorcode.h" #include "nnacl/intrinsics/ms_simd_instructions.h" #include "nnacl/activation_grad_simd.h" diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/fp32_grad/activation_grad.h b/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/fp32_grad/activation_grad_fp32.h similarity index 87% rename from mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/fp32_grad/activation_grad.h rename to mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/fp32_grad/activation_grad_fp32.h index da00c3e4beb..423e606b026 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/fp32_grad/activation_grad.h +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/fp32_grad/activation_grad_fp32.h @@ -13,8 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#ifndef MINDSPORE_NNACL_FP32_GRAD_ACTIVATION_GRAD_H_ -#define MINDSPORE_NNACL_FP32_GRAD_ACTIVATION_GRAD_H_ +#ifndef MINDSPORE_CCSRC_PLUGIN_DEVICE_CPU_KERNEL_NNACL_FP32_GRAD_ACTIVATION_GRAD_FP32_H_ +#define MINDSPORE_CCSRC_PLUGIN_DEVICE_CPU_KERNEL_NNACL_FP32_GRAD_ACTIVATION_GRAD_FP32_H_ #include #include "nnacl/op_base.h" @@ -46,4 +46,4 @@ int SoftShrinkGrad(const float *src0, const float *src1, int length, float *dst, } #endif -#endif // MINDSPORE_NNACL_FP32_GRAD_ACTIVATION_GRAD_H_ +#endif // MINDSPORE_CCSRC_PLUGIN_DEVICE_CPU_KERNEL_NNACL_FP32_GRAD_ACTIVATION_GRAD_FP32_H_ diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/soft_shrink_grad_cpu_kernel.cc b/mindspore/ccsrc/plugin/device/cpu/kernel/soft_shrink_grad_cpu_kernel.cc index 9af68457535..f9674c9de0b 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/soft_shrink_grad_cpu_kernel.cc +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/soft_shrink_grad_cpu_kernel.cc @@ -16,7 +16,7 @@ #include "plugin/device/cpu/kernel/soft_shrink_grad_cpu_kernel.h" #include "mindspore/core/ops/grad/soft_shrink_grad.h" -#include "plugin/device/cpu/kernel/nnacl/fp32_grad/activation_grad.h" +#include "plugin/device/cpu/kernel/nnacl/fp32_grad/activation_grad_fp32.h" namespace mindspore { namespace kernel { diff --git a/mindspore/lite/src/common/ops/populate/activation_grad_populate.cc b/mindspore/lite/src/common/ops/populate/activation_grad_populate.cc index ce75379adc0..59a8c297015 100644 --- a/mindspore/lite/src/common/ops/populate/activation_grad_populate.cc +++ b/mindspore/lite/src/common/ops/populate/activation_grad_populate.cc @@ -14,7 +14,7 @@ * limitations under the License. */ #include "src/common/ops/populate/populate_register.h" -#include "nnacl/fp32_grad/activation_grad.h" +#include "nnacl/fp32_grad/activation_grad_fp32.h" using mindspore::schema::PrimitiveType_ActivationGrad; namespace mindspore { diff --git a/mindspore/lite/src/litert/kernel/cpu/fp16_grad/activation_fp16_grad.cc b/mindspore/lite/src/litert/kernel/cpu/fp16_grad/activation_fp16_grad.cc index a444ccd5941..8cbb791a846 100644 --- a/mindspore/lite/src/litert/kernel/cpu/fp16_grad/activation_fp16_grad.cc +++ b/mindspore/lite/src/litert/kernel/cpu/fp16_grad/activation_fp16_grad.cc @@ -15,7 +15,7 @@ */ #include "src/litert/kernel/cpu/fp16_grad/activation_fp16_grad.h" -#include "nnacl/fp16_grad/activation_grad.h" +#include "nnacl/fp16_grad/activation_grad_fp16.h" #include "schema/model_generated.h" #include "src/litert/kernel_registry.h" #include "include/errorcode.h" diff --git a/mindspore/lite/src/litert/kernel/cpu/fp16_grad/activation_fp16_grad.h b/mindspore/lite/src/litert/kernel/cpu/fp16_grad/activation_fp16_grad.h index cd1b116d4d5..0b81bd699e1 100644 --- a/mindspore/lite/src/litert/kernel/cpu/fp16_grad/activation_fp16_grad.h +++ b/mindspore/lite/src/litert/kernel/cpu/fp16_grad/activation_fp16_grad.h @@ -19,8 +19,8 @@ #include #include "src/litert/lite_kernel.h" -#include "nnacl/fp16_grad/activation_grad.h" -#include "nnacl/fp32_grad/activation_grad.h" +#include "nnacl/fp16_grad/activation_grad_fp16.h" +#include "nnacl/fp32_grad/activation_grad_fp32.h" namespace mindspore::kernel { class ActivationGradCPUKernelFp16 : public LiteKernel { diff --git a/mindspore/lite/src/litert/kernel/cpu/fp32_grad/activation_grad.cc b/mindspore/lite/src/litert/kernel/cpu/fp32_grad/activation_grad.cc index 1304df72478..da6c0cccbcf 100644 --- a/mindspore/lite/src/litert/kernel/cpu/fp32_grad/activation_grad.cc +++ b/mindspore/lite/src/litert/kernel/cpu/fp32_grad/activation_grad.cc @@ -15,7 +15,7 @@ */ #include "src/litert/kernel/cpu/fp32_grad/activation_grad.h" -#include "nnacl/fp32_grad/activation_grad.h" +#include "nnacl/fp32_grad/activation_grad_fp32.h" #include "schema/model_generated.h" #include "src/litert/kernel_registry.h" #include "include/errorcode.h" diff --git a/mindspore/lite/test/ut/src/runtime/kernel/arm/fp16_grad/activation_grad_fp16_test.cc b/mindspore/lite/test/ut/src/runtime/kernel/arm/fp16_grad/activation_grad_fp16_test.cc index 9f97ddf3fc5..2b671b7cc1b 100644 --- a/mindspore/lite/test/ut/src/runtime/kernel/arm/fp16_grad/activation_grad_fp16_test.cc +++ b/mindspore/lite/test/ut/src/runtime/kernel/arm/fp16_grad/activation_grad_fp16_test.cc @@ -21,7 +21,7 @@ #include "src/common/log_adapter.h" #include "common/common_test.h" #include "src/common/file_utils.h" -#include "nnacl/fp16_grad/activation_grad.h" +#include "nnacl/fp16_grad/activation_grad_fp16.h" namespace mindspore { class TestActGradFp16 : public mindspore::CommonTest { diff --git a/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32_grad/activation_grad_fp32_tests.cc b/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32_grad/activation_grad_fp32_tests.cc index eb18356d4b3..28a19cf9ecd 100644 --- a/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32_grad/activation_grad_fp32_tests.cc +++ b/mindspore/lite/test/ut/src/runtime/kernel/arm/fp32_grad/activation_grad_fp32_tests.cc @@ -25,7 +25,7 @@ #include "mindspore/lite/src/tensor.h" #include "mindspore/lite/src/litert/kernel_exec.h" #include "mindspore/lite/src/litert/kernel/cpu/fp32_grad/activation_grad.h" -#include "nnacl/fp32_grad/activation_grad.h" +#include "nnacl/fp32_grad/activation_grad_fp32.h" namespace mindspore { class TestActGradFp32 : public mindspore::CommonTest { diff --git a/mindspore/lite/tools/converter/micro/coder/opcoders/nnacl/fp32_grad/activation_grad_coder.cc b/mindspore/lite/tools/converter/micro/coder/opcoders/nnacl/fp32_grad/activation_grad_coder.cc index 6aaf79550f7..b9d940d35e1 100644 --- a/mindspore/lite/tools/converter/micro/coder/opcoders/nnacl/fp32_grad/activation_grad_coder.cc +++ b/mindspore/lite/tools/converter/micro/coder/opcoders/nnacl/fp32_grad/activation_grad_coder.cc @@ -15,7 +15,7 @@ */ #include "coder/opcoders/nnacl/fp32_grad/activation_grad_coder.h" -#include "nnacl/fp32_grad/activation_grad.h" +#include "nnacl/fp32_grad/activation_grad_fp32.h" #include "coder/opcoders/serializers/nnacl_serializer/nnacl_fp32_serializer.h" #include "coder/opcoders/file_collector.h" @@ -31,10 +31,10 @@ int ActivationGradCoder::DoCode(CoderContext *const context) { int count = input_tensor_->ElementsNum(); Collect(context, { - "nnacl/fp32_grad/activation_grad.h", + "nnacl/fp32_grad/activation_grad_fp32.h", }, { - "activation_grad.c", + "activation_grad_fp32.c", }); NNaclFp32Serializer code;