diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/embedding_look_up_comm_grad_cpu_kernel.h b/mindspore/ccsrc/plugin/device/cpu/kernel/embedding_look_up_comm_grad_cpu_kernel.h index d8e0c97a54..d64d5e63d3 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/embedding_look_up_comm_grad_cpu_kernel.h +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/embedding_look_up_comm_grad_cpu_kernel.h @@ -44,8 +44,6 @@ class EmbeddingLookUpCommGradCpuKernelMod : public NativeCpuKernelMod { private: int64_t split_num_; }; - -MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, EmbeddingLookupCommGrad, EmbeddingLookUpCommGradCpuKernelMod); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/embedding_look_up_cpu_kernel.cc b/mindspore/ccsrc/plugin/device/cpu/kernel/embedding_look_up_cpu_kernel.cc index 01e3e30e02..144adf8043 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/embedding_look_up_cpu_kernel.cc +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/embedding_look_up_cpu_kernel.cc @@ -126,5 +126,7 @@ bool EmbeddingLookUpCpuKernelMod::Launch(const std::vector & } return true; } + +MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, EmbeddingLookup, EmbeddingLookUpCpuKernelMod); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/embedding_look_up_cpu_kernel.h b/mindspore/ccsrc/plugin/device/cpu/kernel/embedding_look_up_cpu_kernel.h index b7b8e92d84..3e5a509b8f 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/embedding_look_up_cpu_kernel.h +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/embedding_look_up_cpu_kernel.h @@ -55,8 +55,6 @@ class EmbeddingLookUpCpuKernelMod : public NativeCpuKernelMod { TypeId indices_data_type_{kNumberTypeInt32}; CNodeWeakPtr node_wpt_; }; - -MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, EmbeddingLookup, EmbeddingLookUpCpuKernelMod); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/environ/environ_cpu_create.cc b/mindspore/ccsrc/plugin/device/cpu/kernel/environ/environ_cpu_create.cc index 097f32ce8a..b9fd9d2a33 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/environ/environ_cpu_create.cc +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/environ/environ_cpu_create.cc @@ -44,5 +44,7 @@ bool EnvironCreateCpuKernelMod::Launch(const std::vector &, const st return true; } + +MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, EnvironCreate, EnvironCreateCpuKernelMod); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/environ/environ_cpu_create.h b/mindspore/ccsrc/plugin/device/cpu/kernel/environ/environ_cpu_create.h index 5d6f99d758..da967d8e34 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/environ/environ_cpu_create.h +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/environ/environ_cpu_create.h @@ -41,8 +41,6 @@ class EnvironCreateCpuKernelMod : public NativeCpuKernelMod { private: size_t handle_size_; }; - -MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, EnvironCreate, EnvironCreateCpuKernelMod); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/environ/environ_cpu_destroy_all.cc b/mindspore/ccsrc/plugin/device/cpu/kernel/environ/environ_cpu_destroy_all.cc index 6a0cb2a718..a0bad28124 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/environ/environ_cpu_destroy_all.cc +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/environ/environ_cpu_destroy_all.cc @@ -38,5 +38,7 @@ bool EnvironDestroyAllCpuKernelMod::Launch(const std::vector &, cons return true; } + +MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, EnvironDestroyAll, EnvironDestroyAllCpuKernelMod); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/environ/environ_cpu_destroy_all.h b/mindspore/ccsrc/plugin/device/cpu/kernel/environ/environ_cpu_destroy_all.h index 4c2a5f8de7..d2d33cdf94 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/environ/environ_cpu_destroy_all.h +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/environ/environ_cpu_destroy_all.h @@ -38,8 +38,6 @@ class EnvironDestroyAllCpuKernelMod : public NativeCpuKernelMod { return support_list; } }; - -MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, EnvironDestroyAll, EnvironDestroyAllCpuKernelMod); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/environ/environ_cpu_get.cc b/mindspore/ccsrc/plugin/device/cpu/kernel/environ/environ_cpu_get.cc index 412b0e6e59..c8adecbda7 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/environ/environ_cpu_get.cc +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/environ/environ_cpu_get.cc @@ -95,5 +95,7 @@ bool EnvironGetCpuKernelMod::Launch(const std::vector &inputs, const } return true; } + +MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, EnvironGet, EnvironGetCpuKernelMod); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/environ/environ_cpu_get.h b/mindspore/ccsrc/plugin/device/cpu/kernel/environ/environ_cpu_get.h index 2744afd075..f4f3bab0c1 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/environ/environ_cpu_get.h +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/environ/environ_cpu_get.h @@ -95,8 +95,6 @@ class EnvironGetCpuKernelMod : public NativeCpuKernelMod { size_t key_size_; size_t value_size_; }; - -MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, EnvironGet, EnvironGetCpuKernelMod); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/environ/environ_cpu_set.cc b/mindspore/ccsrc/plugin/device/cpu/kernel/environ/environ_cpu_set.cc index 9d764e5ada..85b696ef06 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/environ/environ_cpu_set.cc +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/environ/environ_cpu_set.cc @@ -85,5 +85,7 @@ bool EnvironSetCpuKernelMod::Launch(const std::vector &inputs, const return true; } + +MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, EnvironSet, EnvironSetCpuKernelMod); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/environ/environ_cpu_set.h b/mindspore/ccsrc/plugin/device/cpu/kernel/environ/environ_cpu_set.h index ade12b59f9..bb44f87a84 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/environ/environ_cpu_set.h +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/environ/environ_cpu_set.h @@ -96,8 +96,6 @@ class EnvironSetCpuKernelMod : public NativeCpuKernelMod { size_t key_size_; size_t value_size_; }; - -MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, EnvironSet, EnvironSetCpuKernelMod); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/equal_count_cpu_kernel.cc b/mindspore/ccsrc/plugin/device/cpu/kernel/equal_count_cpu_kernel.cc index 115538afc3..e3c599447a 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/equal_count_cpu_kernel.cc +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/equal_count_cpu_kernel.cc @@ -52,5 +52,7 @@ bool EqualCountCpuKernelMod::Launch(const std::vector &input output[0] = count; return true; } + +MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, EqualCount, EqualCountCpuKernelMod); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/equal_count_cpu_kernel.h b/mindspore/ccsrc/plugin/device/cpu/kernel/equal_count_cpu_kernel.h index de00eeeee4..99a20c0752 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/equal_count_cpu_kernel.h +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/equal_count_cpu_kernel.h @@ -34,8 +34,6 @@ class EqualCountCpuKernelMod : public NativeCpuKernelMod { bool Launch(const std::vector &inputs, const std::vector &workspace, const std::vector &outputs) override; }; - -MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, EqualCount, EqualCountCpuKernelMod); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/expm1_cpu_kernel.cc b/mindspore/ccsrc/plugin/device/cpu/kernel/expm1_cpu_kernel.cc index a4fab926d5..a75821df86 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/expm1_cpu_kernel.cc +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/expm1_cpu_kernel.cc @@ -60,5 +60,7 @@ void Expm1CpuKernelMod::LaunchKernel(const std::vector &inputs, output[i] = exp(input[i]) - T(1); } } + +MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, Expm1, Expm1CpuKernelMod); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/expm1_cpu_kernel.h b/mindspore/ccsrc/plugin/device/cpu/kernel/expm1_cpu_kernel.h index 499d4f8f8c..9ddc134ad2 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/expm1_cpu_kernel.h +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/expm1_cpu_kernel.h @@ -48,8 +48,6 @@ class Expm1CpuKernelMod : public NativeCpuKernelMod { private: TypeId input_dtype_{kTypeUnknown}; }; - -MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, Expm1, Expm1CpuKernelMod); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/fused_cast_adam_weight_decay_cpu_kernel.cc b/mindspore/ccsrc/plugin/device/cpu/kernel/fused_cast_adam_weight_decay_cpu_kernel.cc index 0432244252..8eb2da248b 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/fused_cast_adam_weight_decay_cpu_kernel.cc +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/fused_cast_adam_weight_decay_cpu_kernel.cc @@ -198,5 +198,7 @@ bool FusedCastAdamWeightDecayCpuKernelMod::Launch(const std::vector= 0 && d < D && h >= 0 && h < H && w >= 0 && w < W; } + +MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, GridSampler3D, GridSampler3DCpuKernelMod); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/grid_sampler_3d_cpu_kernel.h b/mindspore/ccsrc/plugin/device/cpu/kernel/grid_sampler_3d_cpu_kernel.h index 15cedd3b62..99b6aa483c 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/grid_sampler_3d_cpu_kernel.h +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/grid_sampler_3d_cpu_kernel.h @@ -68,8 +68,6 @@ class GridSampler3DCpuKernelMod : public NativeCpuKernelMod { bool within_bounds_3d(int64_t d, int64_t h, int64_t w, int64_t D, int64_t H, int64_t W); }; - -MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, GridSampler3D, GridSampler3DCpuKernelMod); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/grid_sampler_3d_grad_cpu_kernel.cc b/mindspore/ccsrc/plugin/device/cpu/kernel/grid_sampler_3d_grad_cpu_kernel.cc index c7cb481dee..79a1763fd1 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/grid_sampler_3d_grad_cpu_kernel.cc +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/grid_sampler_3d_grad_cpu_kernel.cc @@ -323,5 +323,7 @@ bool GridSampler3DGradCpuKernelMod::within_bounds_3d(int64_t d, int64_t h, int64 int64_t iW = static_cast(W); return d >= 0 && d < iD && h >= 0 && h < iH && w >= 0 && w < iW; } + +MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, GridSampler3DGrad, GridSampler3DGradCpuKernelMod); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/grid_sampler_3d_grad_cpu_kernel.h b/mindspore/ccsrc/plugin/device/cpu/kernel/grid_sampler_3d_grad_cpu_kernel.h index 23d29bd3e3..cf02271642 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/grid_sampler_3d_grad_cpu_kernel.h +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/grid_sampler_3d_grad_cpu_kernel.h @@ -92,8 +92,6 @@ class GridSampler3DGradCpuKernelMod : public NativeCpuKernelMod { bool within_bounds_3d(int64_t d, int64_t h, int64_t w, size_t D, size_t H, size_t W); }; - -MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, GridSampler3DGrad, GridSampler3DGradCpuKernelMod); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/hsv_to_rgb_cpu_kernel.cc b/mindspore/ccsrc/plugin/device/cpu/kernel/hsv_to_rgb_cpu_kernel.cc index b919587330..449916dfe4 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/hsv_to_rgb_cpu_kernel.cc +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/hsv_to_rgb_cpu_kernel.cc @@ -165,5 +165,7 @@ bool HSVToRGBCpuKernelMod::Launch(const std::vector &inputs, const s } return true; } + +MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, HSVToRGB, HSVToRGBCpuKernelMod); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/hsv_to_rgb_cpu_kernel.h b/mindspore/ccsrc/plugin/device/cpu/kernel/hsv_to_rgb_cpu_kernel.h index b66c9e6c7f..1eb4d2f8c8 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/hsv_to_rgb_cpu_kernel.h +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/hsv_to_rgb_cpu_kernel.h @@ -51,8 +51,6 @@ class HSVToRGBCpuKernelMod : public NativeCpuKernelMod { const size_t kInputNum = 1; const size_t kOutputNum = 1; }; - -MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, HSVToRGB, HSVToRGBCpuKernelMod); } // namespace kernel } // namespace mindspore #endif diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/isfinite_cpu_kernel.cc b/mindspore/ccsrc/plugin/device/cpu/kernel/isfinite_cpu_kernel.cc index c6078145fb..a9ef68a48c 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/isfinite_cpu_kernel.cc +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/isfinite_cpu_kernel.cc @@ -88,5 +88,7 @@ void IsFiniteCpuKernelMod::LaunchKernelOther(const std::vector &inpu output[i] = true; } } + +MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, IsFinite, IsFiniteCpuKernelMod); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/isfinite_cpu_kernel.h b/mindspore/ccsrc/plugin/device/cpu/kernel/isfinite_cpu_kernel.h index c96378e98f..2222445fdc 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/isfinite_cpu_kernel.h +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/isfinite_cpu_kernel.h @@ -51,8 +51,6 @@ class IsFiniteCpuKernelMod : public NativeCpuKernelMod { {kNumberTypeUInt32, sizeof(uint32_t)}, {kNumberTypeUInt64, sizeof(uint64_t)}}; TypeId input_dtype_{kTypeUnknown}; }; - -MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, IsFinite, IsFiniteCpuKernelMod); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/isinf_cpu_kernel.cc b/mindspore/ccsrc/plugin/device/cpu/kernel/isinf_cpu_kernel.cc index 6b695ae1ac..d9cedca17d 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/isinf_cpu_kernel.cc +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/isinf_cpu_kernel.cc @@ -80,5 +80,6 @@ void IsInfCpuKernelMod::LaunchKernelFloat(const std::vector &inputs, } } +MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, IsInf, IsInfCpuKernelMod); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/isinf_cpu_kernel.h b/mindspore/ccsrc/plugin/device/cpu/kernel/isinf_cpu_kernel.h index dd1500fa99..c8426b17cc 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/isinf_cpu_kernel.h +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/isinf_cpu_kernel.h @@ -54,8 +54,6 @@ class IsInfCpuKernelMod : public NativeCpuKernelMod { TypeId input_dtype_{kTypeUnknown}; }; - -MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, IsInf, IsInfCpuKernelMod); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/isnan_cpu_kernel.cc b/mindspore/ccsrc/plugin/device/cpu/kernel/isnan_cpu_kernel.cc index 904dff09b1..f7bb6063cb 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/isnan_cpu_kernel.cc +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/isnan_cpu_kernel.cc @@ -87,5 +87,7 @@ void IsNanCpuKernelMod::LaunchKernelOther(const std::vector &inputs, output[i] = false; } } + +MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, IsNan, IsNanCpuKernelMod); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/isnan_cpu_kernel.h b/mindspore/ccsrc/plugin/device/cpu/kernel/isnan_cpu_kernel.h index 28a165a5d2..13ee054ad9 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/isnan_cpu_kernel.h +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/isnan_cpu_kernel.h @@ -69,8 +69,6 @@ class IsNanCpuKernelMod : public NativeCpuKernelMod { {kNumberTypeUInt32, sizeof(uint32_t)}, {kNumberTypeUInt64, sizeof(uint64_t)}}; TypeId input_dtype_{kTypeUnknown}; }; - -MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, IsNan, IsNanCpuKernelMod); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/layer_norm_cpu_kernel.cc b/mindspore/ccsrc/plugin/device/cpu/kernel/layer_norm_cpu_kernel.cc index 623a0c162d..ebecda4e79 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/layer_norm_cpu_kernel.cc +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/layer_norm_cpu_kernel.cc @@ -124,5 +124,7 @@ void LayerNormCpuKernelMod::LaunchKernel(const std::vector &inputs, } ParallelLaunch(tasks); } + +MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, LayerNorm, LayerNormCpuKernelMod); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/layer_norm_cpu_kernel.h b/mindspore/ccsrc/plugin/device/cpu/kernel/layer_norm_cpu_kernel.h index 4e23ec0edb..e4ede68c5f 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/layer_norm_cpu_kernel.h +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/layer_norm_cpu_kernel.h @@ -45,8 +45,6 @@ class LayerNormCpuKernelMod : public NativeCpuKernelMod { size_t block_size_{1}; size_t param_num_{1}; }; - -MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, LayerNorm, LayerNormCpuKernelMod); } // namespace kernel } // namespace mindspore #endif // MINDSPORE_CCSRC_BACKEND_KERNEL_COMPILER_CPU_LAYER_NORM_CPU_KERNEL_H_ diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/layer_norm_grad_cpu_kernel.cc b/mindspore/ccsrc/plugin/device/cpu/kernel/layer_norm_grad_cpu_kernel.cc index 95d33b702e..308d2de4cb 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/layer_norm_grad_cpu_kernel.cc +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/layer_norm_grad_cpu_kernel.cc @@ -154,5 +154,7 @@ void LayerNormGradCpuKernelMod::LaunchKernel(const std::vector &inpu } ParallelLaunch(tasks2); } + +MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, LayerNormGrad, LayerNormGradCpuKernelMod); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/layer_norm_grad_cpu_kernel.h b/mindspore/ccsrc/plugin/device/cpu/kernel/layer_norm_grad_cpu_kernel.h index 704cb648d7..68bd1ec531 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/layer_norm_grad_cpu_kernel.h +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/layer_norm_grad_cpu_kernel.h @@ -46,8 +46,6 @@ class LayerNormGradCpuKernelMod : public NativeCpuKernelMod { size_t param_num_{1}; size_t param_size_{1}; }; - -MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, LayerNormGrad, LayerNormGradCpuKernelMod); } // namespace kernel } // namespace mindspore #endif // MINDSPORE_CCSRC_BACKEND_KERNEL_COMPILER_CPU_LAYER_NORM_GRAD_CPU_KERNEL_H_ diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/log_matrix_determinant_cpu_kernel.cc b/mindspore/ccsrc/plugin/device/cpu/kernel/log_matrix_determinant_cpu_kernel.cc index 822c5b1b06..c2e0238e33 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/log_matrix_determinant_cpu_kernel.cc +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/log_matrix_determinant_cpu_kernel.cc @@ -162,5 +162,7 @@ void LogMatrixDeterminantCpuKernelMod::LaunchLogMatrixDeterminant(const std::vec } } } + +MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, LogMatrixDeterminant, LogMatrixDeterminantCpuKernelMod); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/log_matrix_determinant_cpu_kernel.h b/mindspore/ccsrc/plugin/device/cpu/kernel/log_matrix_determinant_cpu_kernel.h index bdd4cbf3e9..d8a281c6f7 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/log_matrix_determinant_cpu_kernel.h +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/log_matrix_determinant_cpu_kernel.h @@ -56,8 +56,6 @@ class LogMatrixDeterminantCpuKernelMod : public NativeCpuKernelMod { template void LaunchLogMatrixDeterminant(const std::vector &inputs, const std::vector &outputs); }; // namespace kernel - -MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, LogMatrixDeterminant, LogMatrixDeterminantCpuKernelMod); } // namespace kernel } // namespace mindspore #endif // MINDSPORE_CCSRC_BACKEND_KERNEL_COMPILER_CPU_LOG_MATRIX_DETERMINANT_CPU_KERNEL_H_ diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/lstsq_cpu_kernel.cc b/mindspore/ccsrc/plugin/device/cpu/kernel/lstsq_cpu_kernel.cc index 50c803ef9e..5ad8cf306d 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/lstsq_cpu_kernel.cc +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/lstsq_cpu_kernel.cc @@ -107,5 +107,7 @@ void LstsqCpuKernelMod::LaunchKernel(const std::vector &inputs, cons *(output_addr + i * k + j) = static_cast(result(i, j)); } } + +MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, Lstsq, LstsqCpuKernelMod); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/lstsq_cpu_kernel.h b/mindspore/ccsrc/plugin/device/cpu/kernel/lstsq_cpu_kernel.h index fdc8c868a1..703fbdb2fa 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/lstsq_cpu_kernel.h +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/lstsq_cpu_kernel.h @@ -52,8 +52,6 @@ class LstsqCpuKernelMod : public NativeCpuKernelMod { TypeId dtype_0_{kTypeUnknown}; TypeId dtype_1_{kTypeUnknown}; }; - -MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, Lstsq, LstsqCpuKernelMod); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/map_cache_idx_cpu_kernel.cc b/mindspore/ccsrc/plugin/device/cpu/kernel/map_cache_idx_cpu_kernel.cc index 6a9b11e753..12c69ebb66 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/map_cache_idx_cpu_kernel.cc +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/map_cache_idx_cpu_kernel.cc @@ -203,5 +203,7 @@ void MapCacheIdxCpuKernelMod::LaunchKernel(const std::vector &inputs } UpdateShape(miss_count, node); } + +MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, MapCacheIdx, MapCacheIdxCpuKernelMod); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/map_cache_idx_cpu_kernel.h b/mindspore/ccsrc/plugin/device/cpu/kernel/map_cache_idx_cpu_kernel.h index e6699b4445..5bfc66f360 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/map_cache_idx_cpu_kernel.h +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/map_cache_idx_cpu_kernel.h @@ -90,8 +90,6 @@ class MapCacheIdxCpuKernelMod : public NativeCpuKernelMod { TypeId dtype_{kTypeUnknown}; CNodeWeakPtr node_wpt_; }; - -MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, MapCacheIdx, MapCacheIdxCpuKernelMod); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/map_uniform_cpu_kernel.cc b/mindspore/ccsrc/plugin/device/cpu/kernel/map_uniform_cpu_kernel.cc index 395fac5a8b..d547de544f 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/map_uniform_cpu_kernel.cc +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/map_uniform_cpu_kernel.cc @@ -80,5 +80,7 @@ void MapUniformCpuKernelMod::LaunchKernel(const std::vector &inputs, } } } + +MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, MapUniform, MapUniformCpuKernelMod); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/map_uniform_cpu_kernel.h b/mindspore/ccsrc/plugin/device/cpu/kernel/map_uniform_cpu_kernel.h index b77aead04a..58b272a47b 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/map_uniform_cpu_kernel.h +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/map_uniform_cpu_kernel.h @@ -59,8 +59,6 @@ class MapUniformCpuKernelMod : public NativeCpuKernelMod { TypeId dtype_{kTypeUnknown}; CNodeWeakPtr node_wpt_; }; - -MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, MapUniform, MapUniformCpuKernelMod); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/matrix_determinant_cpu_kernel.cc b/mindspore/ccsrc/plugin/device/cpu/kernel/matrix_determinant_cpu_kernel.cc index 7872cfc71e..5c1ba1c259 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/matrix_determinant_cpu_kernel.cc +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/matrix_determinant_cpu_kernel.cc @@ -96,5 +96,7 @@ void MatrixDeterminantCpuKernelMod::LaunchMatrixDeterminant(const std::vector void LaunchMatrixDeterminant(const std::vector &inputs, const std::vector &outputs); }; - -MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, MatrixDeterminant, MatrixDeterminantCpuKernelMod); } // namespace kernel } // namespace mindspore #endif // MINDSPORE_CCSRC_BACKEND_KERNEL_COMPILER_CPU_MATRIX_DETERMINANT_CPU_KERNEL_H_ diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/matrix_inverse_cpu_kernel.cc b/mindspore/ccsrc/plugin/device/cpu/kernel/matrix_inverse_cpu_kernel.cc index 41d449e015..286de8bc46 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/matrix_inverse_cpu_kernel.cc +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/matrix_inverse_cpu_kernel.cc @@ -124,5 +124,7 @@ void MatrixInverseCpuKernelMod::LaunchMatrixInverse(const std::vector void LaunchMatrixInverse(const std::vector &inputs, const std::vector &outputs); }; - -MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, MatrixInverse, MatrixInverseCpuKernelMod); } // namespace kernel } // namespace mindspore #endif // MINDSPORE_CCSRC_BACKEND_KERNEL_COMPILER_CPU_MATRIX_INVERSE_CPU_KERNEL_H_ diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/matrix_set_diag_cpu_kernel.cc b/mindspore/ccsrc/plugin/device/cpu/kernel/matrix_set_diag_cpu_kernel.cc index 85b5573db5..a2a2466aad 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/matrix_set_diag_cpu_kernel.cc +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/matrix_set_diag_cpu_kernel.cc @@ -176,5 +176,7 @@ void MatrixSetDiagCpuKernelMod::LaunchKernel(const std::vector &inpu }; CPUKernelUtils::ParallelFor(task, max_index); } + +MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, MatrixSetDiag, MatrixSetDiagCpuKernelMod); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/matrix_set_diag_cpu_kernel.h b/mindspore/ccsrc/plugin/device/cpu/kernel/matrix_set_diag_cpu_kernel.h index 9c3e1f389d..2e3a7bbc20 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/matrix_set_diag_cpu_kernel.h +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/matrix_set_diag_cpu_kernel.h @@ -78,8 +78,6 @@ class MatrixSetDiagCpuKernelMod : public NativeCpuKernelMod { std::pair alignment_{MatrixDiag::RIGHT, MatrixDiag::LEFT}; TypeId data_type_{0}; }; - -MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, MatrixSetDiag, MatrixSetDiagCpuKernelMod); } // namespace kernel } // namespace mindspore #endif // MINDSPORE_CCSRC_BACKEND_KERNEL_COMPILER_CPU_MATRIX_SET_DIAG_KERNEL_H_ diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/maximum_grad_cpu_kernel.cc b/mindspore/ccsrc/plugin/device/cpu/kernel/maximum_grad_cpu_kernel.cc index 9bbf826c41..795b53740a 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/maximum_grad_cpu_kernel.cc +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/maximum_grad_cpu_kernel.cc @@ -155,5 +155,7 @@ void MaximumGradCpuKernelMod::LaunchKernel(const std::vector &inputs MaximumGradRecTask(x_addr, y_addr, dout_addr, dx_addr, dy_addr, 0, 0, 0, 0, x_cargo, y_cargo, dout_cargo, x_shape, y_shape, dout_shape); } + +MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, MaximumGrad, MaximumGradCpuKernelMod); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/maximum_grad_cpu_kernel.h b/mindspore/ccsrc/plugin/device/cpu/kernel/maximum_grad_cpu_kernel.h index 39447c1a3b..26586ab1bb 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/maximum_grad_cpu_kernel.h +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/maximum_grad_cpu_kernel.h @@ -46,8 +46,6 @@ class MaximumGradCpuKernelMod : public NativeCpuKernelMod { std::vector dy_shape; TypeId dtype_{kTypeUnknown}; }; - -MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, MaximumGrad, MaximumGradCpuKernelMod); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/minimum_grad_cpu_kernel.cc b/mindspore/ccsrc/plugin/device/cpu/kernel/minimum_grad_cpu_kernel.cc index aa67c7273a..fa86e0be93 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/minimum_grad_cpu_kernel.cc +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/minimum_grad_cpu_kernel.cc @@ -155,5 +155,7 @@ void MinimumGradCpuKernelMod::LaunchKernel(const std::vector &inputs MinimumGradRecTask(x_addr, y_addr, dout_addr, dx_addr, dy_addr, 0, 0, 0, 0, x_cargo, y_cargo, dout_cargo, x_shape, y_shape, dout_shape); } + +MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, MinimumGrad, MinimumGradCpuKernelMod); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/minimum_grad_cpu_kernel.h b/mindspore/ccsrc/plugin/device/cpu/kernel/minimum_grad_cpu_kernel.h index 3598128e91..98eed8dd27 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/minimum_grad_cpu_kernel.h +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/minimum_grad_cpu_kernel.h @@ -46,8 +46,6 @@ class MinimumGradCpuKernelMod : public NativeCpuKernelMod { std::vector dy_shape; TypeId dtype_{kTypeUnknown}; }; - -MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, MinimumGrad, MinimumGradCpuKernelMod); } // namespace kernel } // namespace mindspore #endif // MINDSPORE_CCSRC_BACKEND_KERNEL_COMPILER_CPU_MINIMUMGRAD_CPU_KERNEL_H_ diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/mirror_pad_cpu_kernel.cc b/mindspore/ccsrc/plugin/device/cpu/kernel/mirror_pad_cpu_kernel.cc index 3a899c3c97..2e0010881f 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/mirror_pad_cpu_kernel.cc +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/mirror_pad_cpu_kernel.cc @@ -210,5 +210,7 @@ void MirrorPadCpuKernelMod::LaunchKernel(const std::vector &inputs, outputs_addr[pos] = inputs_addr[pos_index]; } } + +MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, MirrorPad, MirrorPadCpuKernelMod); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/mirror_pad_cpu_kernel.h b/mindspore/ccsrc/plugin/device/cpu/kernel/mirror_pad_cpu_kernel.h index 0fa8550371..a48b198efc 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/mirror_pad_cpu_kernel.h +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/mirror_pad_cpu_kernel.h @@ -64,8 +64,6 @@ class MirrorPadCpuKernelMod : public NativeCpuKernelMod { std::vector input_shape_; std::vector output_shape_; }; - -MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, MirrorPad, MirrorPadCpuKernelMod); } // namespace kernel } // namespace mindspore #endif // MINDSPORE_CCSRC_BACKEND_KERNEL_COMPILER_CPU_MIRROR_PAD_CPU_KERNEL_H_ diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/mirror_pad_grad_cpu_kernel.cc b/mindspore/ccsrc/plugin/device/cpu/kernel/mirror_pad_grad_cpu_kernel.cc index d34659a664..37bd23a7e3 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/mirror_pad_grad_cpu_kernel.cc +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/mirror_pad_grad_cpu_kernel.cc @@ -311,5 +311,7 @@ void MirrorPadGradCpuKernelMod::LaunchKernel(const std::vector &inpu MirrorPadGrad_Width_Height(output_size_, interim, output_shape_[2], output_shape_[3], input_shape_[2], input_shape_[3], num_paddings_, paddings, mode_, outputs_addr); } + +MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, MirrorPadGrad, MirrorPadGradCpuKernelMod); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/mirror_pad_grad_cpu_kernel.h b/mindspore/ccsrc/plugin/device/cpu/kernel/mirror_pad_grad_cpu_kernel.h index 7a708753a5..680a49967a 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/mirror_pad_grad_cpu_kernel.h +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/mirror_pad_grad_cpu_kernel.h @@ -78,8 +78,6 @@ class MirrorPadGradCpuKernelMod : public NativeCpuKernelMod { std::vector input_shape_; std::vector output_shape_; }; - -MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, MirrorPadGrad, MirrorPadGradCpuKernelMod); } // namespace kernel } // namespace mindspore #endif // MINDSPORE_CCSRC_BACKEND_KERNEL_COMPILER_CPU_MIRROR_PAD_CPU_KERNEL_H_ diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/mkldnn/assignadd_cpu_kernel.cc b/mindspore/ccsrc/plugin/device/cpu/kernel/mkldnn/assignadd_cpu_kernel.cc deleted file mode 100644 index af5069e684..0000000000 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/mkldnn/assignadd_cpu_kernel.cc +++ /dev/null @@ -1,72 +0,0 @@ -/** - * Copyright 2020-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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "plugin/device/cpu/kernel/mkldnn/assignadd_cpu_kernel.h" -#include "plugin/device/cpu/hal/device/cpu_device_address.h" -#include "utils/ms_utils.h" - -namespace mindspore { -namespace kernel { -namespace { -constexpr size_t kAssignAddInputsNum = 2; -constexpr size_t kAssignAddOutputsNum = 1; -} // namespace - -void AssignAddCpuKernelMod::InitKernel(const CNodePtr &kernel_node) { - MS_EXCEPTION_IF_NULL(kernel_node); - kernel_name_ = common::AnfAlgo::GetCNodeName(kernel_node); - std::vector src0_shape = AnfAlgo::GetInputDeviceShape(kernel_node, 0); - std::vector src1_shape = AnfAlgo::GetInputDeviceShape(kernel_node, 1); - if (src1_shape.size() == 0 && src0_shape.size() == 0) { - (void)src0_shape.insert(src0_shape.begin(), 1); - (void)src1_shape.insert(src1_shape.begin(), 1); - } - if (src0_shape.size() != src1_shape.size() && src1_shape.size() > 1) { - MS_LOG(EXCEPTION) << "AssignAdd only support same dim input or tensor * scalar " << src0_shape.size() << " vs " - << src1_shape.size(); - } - if (src1_shape.size() < src0_shape.size()) { - for (size_t i = src1_shape.size(); i < src0_shape.size(); ++i) { - (void)src1_shape.emplace_back(1); - } - } - dnnl::memory::desc src0_desc = GetDefaultMemDesc(src0_shape); - dnnl::memory::desc src1_desc = GetDefaultMemDesc(src1_shape); - auto desc = CreateDesc(dnnl::algorithm::binary_add, src0_desc, src1_desc, src0_desc); - auto prim_desc = CreateDesc(desc, engine_); - primitive_ = CreatePrimitive(prim_desc); - AddArgument(DNNL_ARG_SRC_0, src0_desc); - AddArgument(DNNL_ARG_SRC_1, src1_desc); - AddArgument(DNNL_ARG_DST, src0_desc); -} - -bool AssignAddCpuKernelMod::Launch(const std::vector &inputs, - const std::vector &, - const std::vector &outputs) { - CHECK_KERNEL_INPUTS_NUM(inputs.size(), kAssignAddInputsNum, kernel_name_); - CHECK_KERNEL_OUTPUTS_NUM(outputs.size(), kAssignAddOutputsNum, kernel_name_); - SetArgumentHandle(DNNL_ARG_SRC_0, inputs[0]->addr); - SetArgumentHandle(DNNL_ARG_SRC_1, inputs[1]->addr); - SetArgumentHandle(DNNL_ARG_DST, outputs[0]->addr); - ExecutePrimitive(); - auto ret = memcpy_s(inputs[0]->addr, inputs[0]->size, outputs[0]->addr, outputs[0]->size); - if (ret != 0) { - MS_LOG(EXCEPTION) << "Memcpy_s error, errorno " << ret; - } - return true; -} -} // namespace kernel -} // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/mkldnn/assignadd_cpu_kernel.h b/mindspore/ccsrc/plugin/device/cpu/kernel/mkldnn/assignadd_cpu_kernel.h deleted file mode 100644 index 356b69704a..0000000000 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/mkldnn/assignadd_cpu_kernel.h +++ /dev/null @@ -1,47 +0,0 @@ -/** - * Copyright 2020-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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#ifndef MINDSPORE_CCSRC_BACKEND_KERNEL_COMPILER_CPU_ASSIGNADD_CPU_KERNEL_H_ -#define MINDSPORE_CCSRC_BACKEND_KERNEL_COMPILER_CPU_ASSIGNADD_CPU_KERNEL_H_ - -#include -#include -#include "plugin/device/cpu/kernel/mkldnn/mkl_cpu_kernel.h" - -namespace mindspore { -namespace kernel { -class AssignAddCpuKernelMod : public MKLCpuKernelMod { - public: - AssignAddCpuKernelMod() = default; - ~AssignAddCpuKernelMod() override = default; - - void InitKernel(const CNodePtr &kernel_node) override; - - bool Launch(const std::vector &inputs, const std::vector &workspace, - const std::vector &outputs) override; - - protected: - std::vector GetOpSupport() override { - static std::vector support_list = { - KernelAttr().AddInputAttr(kNumberTypeFloat32).AddInputAttr(kNumberTypeFloat32).AddOutputAttr(kNumberTypeFloat32)}; - return support_list; - } -}; - -MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, AssignAdd, AssignAddCpuKernelMod); -} // namespace kernel -} // namespace mindspore - -#endif // MINDSPORE_CCSRC_BACKEND_KERNEL_COMPILER_CPU_ASSIGNADD_CPU_KERNEL_H_ diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/mkldnn/batch_norm_cpu_kernel.cc b/mindspore/ccsrc/plugin/device/cpu/kernel/mkldnn/batch_norm_cpu_kernel.cc index 0acb5b9175..abeb1ab34b 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/mkldnn/batch_norm_cpu_kernel.cc +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/mkldnn/batch_norm_cpu_kernel.cc @@ -112,5 +112,7 @@ bool BatchNormCpuKernelMod::Launch(const std::vector &inputs } return true; } + +MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, BatchNorm, BatchNormCpuKernelMod); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/mkldnn/batch_norm_cpu_kernel.h b/mindspore/ccsrc/plugin/device/cpu/kernel/mkldnn/batch_norm_cpu_kernel.h index ee23cacd39..38243f0b0b 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/mkldnn/batch_norm_cpu_kernel.h +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/mkldnn/batch_norm_cpu_kernel.h @@ -56,8 +56,6 @@ class BatchNormCpuKernelMod : public MKLCpuKernelMod { size_t hw_size{0}; size_t nhw_size{0}; }; - -MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, BatchNorm, BatchNormCpuKernelMod); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/mkldnn/batch_norm_grad_cpu_kernel.cc b/mindspore/ccsrc/plugin/device/cpu/kernel/mkldnn/batch_norm_grad_cpu_kernel.cc index a1c3ea87fb..08e20e6b52 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/mkldnn/batch_norm_grad_cpu_kernel.cc +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/mkldnn/batch_norm_grad_cpu_kernel.cc @@ -126,5 +126,7 @@ bool BatchNormGradCpuKernelMod::Launch(const std::vector &in } return true; } + +MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, BatchNormGrad, BatchNormGradCpuKernelMod); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/mkldnn/batch_norm_grad_cpu_kernel.h b/mindspore/ccsrc/plugin/device/cpu/kernel/mkldnn/batch_norm_grad_cpu_kernel.h index 62aecebfc3..5e4f73b94f 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/mkldnn/batch_norm_grad_cpu_kernel.h +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/mkldnn/batch_norm_grad_cpu_kernel.h @@ -58,8 +58,6 @@ class BatchNormGradCpuKernelMod : public MKLCpuKernelMod { enum workspace_list_ { SCALE_BIAS, DIFF_SCALE_BIAS }; enum output_list_ { DX, DSCALE, DBIAS }; }; - -MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, BatchNormGrad, BatchNormGradCpuKernelMod); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/mkldnn/conv_cpu_kernel.cc b/mindspore/ccsrc/plugin/device/cpu/kernel/mkldnn/conv_cpu_kernel.cc index 60f73cf4e3..101556628c 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/mkldnn/conv_cpu_kernel.cc +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/mkldnn/conv_cpu_kernel.cc @@ -102,5 +102,8 @@ bool ConvCpuKernelMod::Launch(const std::vector &inputs, con ExecutePrimitive(); return true; } + +MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, Conv2D, ConvCpuKernelMod); +MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, Conv3D, ConvCpuKernelMod); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/mkldnn/conv_cpu_kernel.h b/mindspore/ccsrc/plugin/device/cpu/kernel/mkldnn/conv_cpu_kernel.h index 7a61f23f49..cc23647a64 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/mkldnn/conv_cpu_kernel.h +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/mkldnn/conv_cpu_kernel.h @@ -34,9 +34,6 @@ class ConvCpuKernelMod : public MKLCpuKernelMod { bool Launch(const std::vector &inputs, const std::vector &workspace, const std::vector &outputs) override; }; - -MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, Conv2D, ConvCpuKernelMod); -MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, Conv3D, ConvCpuKernelMod); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/mkldnn/eltwise_cpu_kernel.cc b/mindspore/ccsrc/plugin/device/cpu/kernel/mkldnn/eltwise_cpu_kernel.cc index f233d91bb4..5a014c8312 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/mkldnn/eltwise_cpu_kernel.cc +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/mkldnn/eltwise_cpu_kernel.cc @@ -80,5 +80,19 @@ bool EltWiseCpuKernelMod::Launch(const std::vector &inputs, ExecutePrimitive(); return true; } + +MS_KERNEL_FACTORY_REG_BY_CREATOR(NativeCpuKernelMod, Elu, []() { return std::make_shared(kElu); }); +MS_KERNEL_FACTORY_REG_BY_CREATOR(NativeCpuKernelMod, ReLU, + []() { return std::make_shared(kReLU); }); +MS_KERNEL_FACTORY_REG_BY_CREATOR(NativeCpuKernelMod, ReLU6, + []() { return std::make_shared(kReLU6); }); +MS_KERNEL_FACTORY_REG_BY_CREATOR(NativeCpuKernelMod, Exp, []() { return std::make_shared(kExp); }); +MS_KERNEL_FACTORY_REG_BY_CREATOR(NativeCpuKernelMod, Log, []() { return std::make_shared(kLog); }); +MS_KERNEL_FACTORY_REG_BY_CREATOR(NativeCpuKernelMod, Sigmoid, + []() { return std::make_shared(kSigmoid); }); +MS_KERNEL_FACTORY_REG_BY_CREATOR(NativeCpuKernelMod, Tanh, + []() { return std::make_shared(kTanh); }); +MS_KERNEL_FACTORY_REG_BY_CREATOR(NativeCpuKernelMod, Softplus, + []() { return std::make_shared(kSoftplus); }); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/mkldnn/eltwise_cpu_kernel.h b/mindspore/ccsrc/plugin/device/cpu/kernel/mkldnn/eltwise_cpu_kernel.h index 8b5905bceb..8ac416ba50 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/mkldnn/eltwise_cpu_kernel.h +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/mkldnn/eltwise_cpu_kernel.h @@ -70,20 +70,6 @@ class EltWiseCpuKernelMod : public MKLCpuKernelMod { std::string kernel_type_{kUnKnown}; }; - -MS_KERNEL_FACTORY_REG_BY_CREATOR(NativeCpuKernelMod, Elu, []() { return std::make_shared(kElu); }); -MS_KERNEL_FACTORY_REG_BY_CREATOR(NativeCpuKernelMod, ReLU, - []() { return std::make_shared(kReLU); }); -MS_KERNEL_FACTORY_REG_BY_CREATOR(NativeCpuKernelMod, ReLU6, - []() { return std::make_shared(kReLU6); }); -MS_KERNEL_FACTORY_REG_BY_CREATOR(NativeCpuKernelMod, Exp, []() { return std::make_shared(kExp); }); -MS_KERNEL_FACTORY_REG_BY_CREATOR(NativeCpuKernelMod, Log, []() { return std::make_shared(kLog); }); -MS_KERNEL_FACTORY_REG_BY_CREATOR(NativeCpuKernelMod, Sigmoid, - []() { return std::make_shared(kSigmoid); }); -MS_KERNEL_FACTORY_REG_BY_CREATOR(NativeCpuKernelMod, Tanh, - []() { return std::make_shared(kTanh); }); -MS_KERNEL_FACTORY_REG_BY_CREATOR(NativeCpuKernelMod, Softplus, - []() { return std::make_shared(kSoftplus); }); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/mkldnn/log_softmax_cpu_kernel.cc b/mindspore/ccsrc/plugin/device/cpu/kernel/mkldnn/log_softmax_cpu_kernel.cc index 65561f20ea..50c36f1a51 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/mkldnn/log_softmax_cpu_kernel.cc +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/mkldnn/log_softmax_cpu_kernel.cc @@ -55,5 +55,7 @@ bool LogSoftmaxCpuKernelMod::Launch(const std::vector &input ExecutePrimitive(); return true; } + +MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, LogSoftmax, LogSoftmaxCpuKernelMod); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/mkldnn/log_softmax_cpu_kernel.h b/mindspore/ccsrc/plugin/device/cpu/kernel/mkldnn/log_softmax_cpu_kernel.h index b74ee88ebd..570809d53c 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/mkldnn/log_softmax_cpu_kernel.h +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/mkldnn/log_softmax_cpu_kernel.h @@ -40,8 +40,6 @@ class LogSoftmaxCpuKernelMod : public MKLCpuKernelMod { return support_list; } }; - -MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, LogSoftmax, LogSoftmaxCpuKernelMod); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/mkldnn/log_softmax_grad_cpu_kernel.cc b/mindspore/ccsrc/plugin/device/cpu/kernel/mkldnn/log_softmax_grad_cpu_kernel.cc index ce0af3080e..aef3d12efe 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/mkldnn/log_softmax_grad_cpu_kernel.cc +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/mkldnn/log_softmax_grad_cpu_kernel.cc @@ -60,5 +60,7 @@ bool LogSoftmaxGradCpuKernelMod::Launch(const std::vector &i ExecutePrimitive(); return true; } + +MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, LogSoftmaxGrad, LogSoftmaxGradCpuKernelMod); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/mkldnn/log_softmax_grad_cpu_kernel.h b/mindspore/ccsrc/plugin/device/cpu/kernel/mkldnn/log_softmax_grad_cpu_kernel.h index 3235d7af90..169003ed25 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/mkldnn/log_softmax_grad_cpu_kernel.h +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/mkldnn/log_softmax_grad_cpu_kernel.h @@ -40,8 +40,6 @@ class LogSoftmaxGradCpuKernelMod : public MKLCpuKernelMod { return support_list; } }; - -MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, LogSoftmaxGrad, LogSoftmaxGradCpuKernelMod); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/mkldnn/lstm_cpu_kernel.cc b/mindspore/ccsrc/plugin/device/cpu/kernel/mkldnn/lstm_cpu_kernel.cc index f04c501adc..c360cf0cf0 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/mkldnn/lstm_cpu_kernel.cc +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/mkldnn/lstm_cpu_kernel.cc @@ -190,5 +190,7 @@ bool LstmCpuKernelMod::Launch(const std::vector &inputs, con ExecutePrimitive(); return true; } + +MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, LSTM, LstmCpuKernelMod); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/mkldnn/lstm_cpu_kernel.h b/mindspore/ccsrc/plugin/device/cpu/kernel/mkldnn/lstm_cpu_kernel.h index 0e7169aed2..02e42b5601 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/mkldnn/lstm_cpu_kernel.h +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/mkldnn/lstm_cpu_kernel.h @@ -75,8 +75,6 @@ class LstmCpuKernelMod : public MKLCpuKernelMod { dnnl::memory weights_h_memory_; dnnl::memory bias_memory_; }; - -MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, LSTM, LstmCpuKernelMod); } // namespace kernel } // namespace mindspore #endif // MINDSPORE_CCSRC_BACKEND_KERNEL_COMPILER_CPU_LSTM_CPU_KERNEL_H diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/mkldnn/lstm_grad_cpu_kernel.cc b/mindspore/ccsrc/plugin/device/cpu/kernel/mkldnn/lstm_grad_cpu_kernel.cc index 543d7517ef..ee3073a11e 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/mkldnn/lstm_grad_cpu_kernel.cc +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/mkldnn/lstm_grad_cpu_kernel.cc @@ -251,5 +251,7 @@ bool LSTMGradCpuKernelMod::Launch(const std::vector &inputs, Reorder(&diff_weights_h_memory_, &user_diff_weights_h_memory_); return true; } + +MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, LSTMGrad, LSTMGradCpuKernelMod); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/mkldnn/lstm_grad_cpu_kernel.h b/mindspore/ccsrc/plugin/device/cpu/kernel/mkldnn/lstm_grad_cpu_kernel.h index aa464121b8..f9b7d083ec 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/mkldnn/lstm_grad_cpu_kernel.h +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/mkldnn/lstm_grad_cpu_kernel.h @@ -99,8 +99,6 @@ class LSTMGradCpuKernelMod : public MKLCpuKernelMod { dnnl::memory user_diff_weights_memory_; dnnl::memory user_diff_weights_h_memory_; }; - -MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, LSTMGrad, LSTMGradCpuKernelMod); } // namespace kernel } // namespace mindspore #endif // MINDSPORE_CCSRC_BACKEND_KERNEL_COMPILER_CPU_LSTM_GRAD_CPU_KERNEL_H_ diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/mkldnn/softmax_cpu_kernel.cc b/mindspore/ccsrc/plugin/device/cpu/kernel/mkldnn/softmax_cpu_kernel.cc index 592d4cc4ad..b556c1ab22 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/mkldnn/softmax_cpu_kernel.cc +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/mkldnn/softmax_cpu_kernel.cc @@ -61,5 +61,7 @@ bool SoftmaxCpuKernelMod::Launch(const std::vector &inputs, ExecutePrimitive(); return true; } + +MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, Softmax, SoftmaxCpuKernelMod); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/mkldnn/softmax_cpu_kernel.h b/mindspore/ccsrc/plugin/device/cpu/kernel/mkldnn/softmax_cpu_kernel.h index 52f209935a..4cfe3dc108 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/mkldnn/softmax_cpu_kernel.h +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/mkldnn/softmax_cpu_kernel.h @@ -40,8 +40,6 @@ class SoftmaxCpuKernelMod : public MKLCpuKernelMod { return support_list; } }; - -MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, Softmax, SoftmaxCpuKernelMod); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/mkldnn/softmax_cross_entropy_with_logits_cpu_kernel.cc b/mindspore/ccsrc/plugin/device/cpu/kernel/mkldnn/softmax_cross_entropy_with_logits_cpu_kernel.cc index 6d4a131189..01c2085234 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/mkldnn/softmax_cross_entropy_with_logits_cpu_kernel.cc +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/mkldnn/softmax_cross_entropy_with_logits_cpu_kernel.cc @@ -103,5 +103,7 @@ bool SoftmaxCrossEntropyWithLogitsCpuKernelMod::Launch(const std::vector &inputs, c BcastCompute(inputs, outputs); } } + +MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, MulNoNan, MulNoNanCPUKernelMod); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/mul_no_nan_cpu_kernel.h b/mindspore/ccsrc/plugin/device/cpu/kernel/mul_no_nan_cpu_kernel.h index 7179681fcb..c67ac76f08 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/mul_no_nan_cpu_kernel.h +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/mul_no_nan_cpu_kernel.h @@ -76,8 +76,6 @@ class MulNoNanCPUKernelMod : public NativeCpuKernelMod { template void LaunchKernel(const std::vector &inputs, const std::vector &outputs); }; - -MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, MulNoNan, MulNoNanCPUKernelMod); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/multinomial_cpu_kernel.cc b/mindspore/ccsrc/plugin/device/cpu/kernel/multinomial_cpu_kernel.cc index 85c81233db..419cf63638 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/multinomial_cpu_kernel.cc +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/multinomial_cpu_kernel.cc @@ -121,5 +121,7 @@ bool MultinomialCpuKernel::Launch(const std::vector &inputs, } return true; } + +MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, Multinomial, MultinomialCpuKernel); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/multinomial_cpu_kernel.h b/mindspore/ccsrc/plugin/device/cpu/kernel/multinomial_cpu_kernel.h index c3dec7a7c9..ee04766d3f 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/multinomial_cpu_kernel.h +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/multinomial_cpu_kernel.h @@ -49,8 +49,6 @@ class MultinomialCpuKernel : public NativeCpuKernelMod { int seed2_{0}; std::default_random_engine rng_; }; - -MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, Multinomial, MultinomialCpuKernel); } // namespace kernel } // namespace mindspore #endif // MINDSPORE_CCSRC_BACKEND_KERNEL_COMPILER_CPU_TILE_CPU_KERNEL_H_ diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/pad_and_shift_cpu_kernel.cc b/mindspore/ccsrc/plugin/device/cpu/kernel/pad_and_shift_cpu_kernel.cc index 8af21dbc95..25598c990e 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/pad_and_shift_cpu_kernel.cc +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/pad_and_shift_cpu_kernel.cc @@ -96,5 +96,7 @@ void PadAndShiftCpuKernelMod::LaunchKernel(const std::vector &inputs } common::AnfAlgo::SetOutputInferTypeAndShape(dtypes, {out_shape}, node_.get()); } + +MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, PadAndShift, PadAndShiftCpuKernelMod); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/pad_and_shift_cpu_kernel.h b/mindspore/ccsrc/plugin/device/cpu/kernel/pad_and_shift_cpu_kernel.h index 9e34e1dd12..dbd55f9ba1 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/pad_and_shift_cpu_kernel.h +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/pad_and_shift_cpu_kernel.h @@ -59,8 +59,6 @@ class PadAndShiftCpuKernelMod : public NativeCpuKernelMod { TypeId input_x_dtype_{kTypeUnknown}; CNodeWeakPtr node_wpt_; }; - -MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, PadAndShift, PadAndShiftCpuKernelMod); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/pad_cpu_kernel.cc b/mindspore/ccsrc/plugin/device/cpu/kernel/pad_cpu_kernel.cc index 1429b95270..a7d1ea14c2 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/pad_cpu_kernel.cc +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/pad_cpu_kernel.cc @@ -119,5 +119,7 @@ bool PadCpuKernelMod::LaunchKernel(const std::vector &inputs, const ParallelLaunchAutoSearch(task, input_size_, this, ¶llel_search_info_); return true; } + +MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, Pad, PadCpuKernelMod); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/pad_cpu_kernel.h b/mindspore/ccsrc/plugin/device/cpu/kernel/pad_cpu_kernel.h index 6fb1c5c037..81c56f1de3 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/pad_cpu_kernel.h +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/pad_cpu_kernel.h @@ -48,8 +48,6 @@ class PadCpuKernelMod : public NativeCpuKernelMod { size_t input_size_{1}; size_t output_size_{1}; }; - -MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, Pad, PadCpuKernelMod); } // namespace kernel } // namespace mindspore #endif // MINDSPORE_CCSRC_BACKEND_KERNEL_COMPILER_CPU_PAD_CPU_KERNEL_H_ diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/ps/embedding_look_up_proxy_kernel.cc b/mindspore/ccsrc/plugin/device/cpu/kernel/ps/embedding_look_up_proxy_kernel.cc index 22d2216918..0832d76633 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/ps/embedding_look_up_proxy_kernel.cc +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/ps/embedding_look_up_proxy_kernel.cc @@ -96,6 +96,8 @@ bool EmbeddingLookUpProxyKernel::Launch(const std::vector &i } return true; } + +MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, EmbeddingLookupProxy, EmbeddingLookUpProxyKernel); } // namespace ps } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/ps/embedding_look_up_proxy_kernel.h b/mindspore/ccsrc/plugin/device/cpu/kernel/ps/embedding_look_up_proxy_kernel.h index b71c891ad6..42371d98c2 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/ps/embedding_look_up_proxy_kernel.h +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/ps/embedding_look_up_proxy_kernel.h @@ -45,8 +45,6 @@ class EmbeddingLookUpProxyKernel : public EmbeddingLookUpCpuKernelMod { size_t key_{0}; size_t input_dims_{1}; }; - -MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, EmbeddingLookupProxy, EmbeddingLookUpProxyKernel); } // namespace ps } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/ps/sparse_apply_ftrl_ps_kernel.h b/mindspore/ccsrc/plugin/device/cpu/kernel/ps/sparse_apply_ftrl_ps_kernel.h index 1bd6d522b9..aecdceb5f7 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/ps/sparse_apply_ftrl_ps_kernel.h +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/ps/sparse_apply_ftrl_ps_kernel.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef MINDSPORE_CCSRC_BACKEND_KERNEL_COMPILER_CPU_SPARSE_APPLY_FTRL_CPU_KERNEL_H_ -#define MINDSPORE_CCSRC_BACKEND_KERNEL_COMPILER_CPU_SPARSE_APPLY_FTRL_PS_KERNEL_H_ +#ifndef MINDSPORE_CCSRC_PLUGIN_DEVICE_CPU_KERNEL_SPARSE_APPLY_FTRL_PS_KERNEL_H_ +#define MINDSPORE_CCSRC_PLUGIN_DEVICE_CPU_KERNEL_SPARSE_APPLY_FTRL_PS_KERNEL_H_ #include #include @@ -52,4 +52,4 @@ class SparseApplyFtrlPSKernelMod : public SparseApplyFtrlCpuKernelMod, public PS } // namespace kernel } // namespace mindspore -#endif // MINDSPORE_CCSRC_BACKEND_KERNEL_COMPILER_CPU_SPARSE_APPLY_FTRL_PS_KERNEL_H_ +#endif // MINDSPORE_CCSRC_PLUGIN_DEVICE_CPU_KERNEL_SPARSE_APPLY_FTRL_PS_KERNEL_H_ diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/random_choice_with_mask_cpu_kernel.cc b/mindspore/ccsrc/plugin/device/cpu/kernel/random_choice_with_mask_cpu_kernel.cc index cf2a4cbb8f..2bb68cd219 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/random_choice_with_mask_cpu_kernel.cc +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/random_choice_with_mask_cpu_kernel.cc @@ -203,5 +203,7 @@ bool RandomChoiceWithMaskCpuKernelMod::Launch(const std::vector &inputs, } return true; } + +MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, Range, RangeCpuKernelMod); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/range_cpu_kernel.h b/mindspore/ccsrc/plugin/device/cpu/kernel/range_cpu_kernel.h index 5450c69d61..13ed6736c7 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/range_cpu_kernel.h +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/range_cpu_kernel.h @@ -40,8 +40,6 @@ class RangeCpuKernelMod : public NativeCpuKernelMod { TypeId dtype_{kTypeUnknown}; }; - -MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, Range, RangeCpuKernelMod); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/reduce_scatter_cpu_kernel.cc b/mindspore/ccsrc/plugin/device/cpu/kernel/reduce_scatter_cpu_kernel.cc index 3bf8af94ec..620f53d4b8 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/reduce_scatter_cpu_kernel.cc +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/reduce_scatter_cpu_kernel.cc @@ -57,5 +57,7 @@ bool ReduceScatterCpuKernelMod::Launch(const std::vector &in auto output_data_num = outputs[0]->size / sizeof(float); return MPIReduceScatter(input_addr, output_addr, ranks_group_, output_data_num, op_type_); } + +MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, _HostReduceScatter, ReduceScatterCpuKernelMod); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/reduce_scatter_cpu_kernel.h b/mindspore/ccsrc/plugin/device/cpu/kernel/reduce_scatter_cpu_kernel.h index 1a79af6d7f..201eef76ed 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/reduce_scatter_cpu_kernel.h +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/reduce_scatter_cpu_kernel.h @@ -45,8 +45,6 @@ class ReduceScatterCpuKernelMod : public NativeCpuKernelMod { std::string op_type_; std::vector ranks_group_; }; - -MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, _HostReduceScatter, ReduceScatterCpuKernelMod); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/resize_bilinear_cpu_kernel.cc b/mindspore/ccsrc/plugin/device/cpu/kernel/resize_bilinear_cpu_kernel.cc index 98c978d816..0b662d4266 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/resize_bilinear_cpu_kernel.cc +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/resize_bilinear_cpu_kernel.cc @@ -151,5 +151,7 @@ bool ResizeBilinearCpuKernelMod::LaunchKernel(const std::vector &inp } return true; } + +MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, ResizeBilinear, ResizeBilinearCpuKernelMod); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/resize_bilinear_cpu_kernel.h b/mindspore/ccsrc/plugin/device/cpu/kernel/resize_bilinear_cpu_kernel.h index dd414669dc..6175669a9d 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/resize_bilinear_cpu_kernel.h +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/resize_bilinear_cpu_kernel.h @@ -55,8 +55,6 @@ class ResizeBilinearCpuKernelMod : public NativeCpuKernelMod { std::vector size_; std::vector shape_; }; - -MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, ResizeBilinear, ResizeBilinearCpuKernelMod); } // namespace kernel } // namespace mindspore #endif // MINDSPORE_CCSRC_BACKEND_KERNEL_COMPILER_CPU_RESIZE_BILINEAR_CPU_KERNEL_H_ diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/resize_bilinear_grad_cpu_kernel.cc b/mindspore/ccsrc/plugin/device/cpu/kernel/resize_bilinear_grad_cpu_kernel.cc index d9f3c20fbd..a137a0726e 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/resize_bilinear_grad_cpu_kernel.cc +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/resize_bilinear_grad_cpu_kernel.cc @@ -163,5 +163,7 @@ bool ResizeBilinearGradCpuKernelMod::LaunchKernel(const std::vector } return true; } + +MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, ResizeBilinearGrad, ResizeBilinearGradCpuKernelMod); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/resize_bilinear_grad_cpu_kernel.h b/mindspore/ccsrc/plugin/device/cpu/kernel/resize_bilinear_grad_cpu_kernel.h index c291cc2d8e..fa2af09dc8 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/resize_bilinear_grad_cpu_kernel.h +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/resize_bilinear_grad_cpu_kernel.h @@ -55,8 +55,6 @@ class ResizeBilinearGradCpuKernelMod : public NativeCpuKernelMod { std::vector size_; std::vector shape_; }; - -MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, ResizeBilinearGrad, ResizeBilinearGradCpuKernelMod); } // namespace kernel } // namespace mindspore #endif // MINDSPORE_CCSRC_BACKEND_KERNEL_COMPILER_CPU_RESIZE_BILINEAR_GRAD_CPU_KERNEL_H_ diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/resize_nearest_neighbor_cpu_kernel.cc b/mindspore/ccsrc/plugin/device/cpu/kernel/resize_nearest_neighbor_cpu_kernel.cc index da196108bd..55c19a3b4c 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/resize_nearest_neighbor_cpu_kernel.cc +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/resize_nearest_neighbor_cpu_kernel.cc @@ -106,5 +106,7 @@ void ResizeNearestNeighborCpuKernelMod::LaunchKernel(const std::vector & *handle = handle_; return true; } + +MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, PriorityReplayBufferCreate, PriorityReplayBufferCreateCpuKernel); +MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, PriorityReplayBufferPush, PriorityReplayBufferPushCpuKernel); +MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, PriorityReplayBufferSample, PriorityReplayBufferSampleCpuKernel); +MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, PriorityReplayBufferUpdate, PriorityReplayBufferUpdateCpuKernel); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/rl/priority_replay_buffer_cpu_kernel.h b/mindspore/ccsrc/plugin/device/cpu/kernel/rl/priority_replay_buffer_cpu_kernel.h index 74eae04295..535fb8e9b4 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/rl/priority_replay_buffer_cpu_kernel.h +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/rl/priority_replay_buffer_cpu_kernel.h @@ -112,11 +112,6 @@ class PriorityReplayBufferUpdateCpuKernel : public NativeCpuKernelMod { std::vector priorities_shape_; std::shared_ptr prioriory_replay_buffer_{nullptr}; }; - -MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, PriorityReplayBufferCreate, PriorityReplayBufferCreateCpuKernel); -MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, PriorityReplayBufferPush, PriorityReplayBufferPushCpuKernel); -MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, PriorityReplayBufferSample, PriorityReplayBufferSampleCpuKernel); -MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, PriorityReplayBufferUpdate, PriorityReplayBufferUpdateCpuKernel); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/rl/tensor_array_clear_kernel.cc b/mindspore/ccsrc/plugin/device/cpu/kernel/rl/tensor_array_clear_kernel.cc index 4c6061e4ed..01e2afdc96 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/rl/tensor_array_clear_kernel.cc +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/rl/tensor_array_clear_kernel.cc @@ -41,5 +41,7 @@ bool TensorArrayClearCpuKernelMod::Launch(const std::vector &inputs, tensors_->Clear(); return true; } + +MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, TensorArrayClear, TensorArrayClearCpuKernelMod); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/rl/tensor_array_clear_kernel.h b/mindspore/ccsrc/plugin/device/cpu/kernel/rl/tensor_array_clear_kernel.h index 6be2194377..13bad301d3 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/rl/tensor_array_clear_kernel.h +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/rl/tensor_array_clear_kernel.h @@ -39,8 +39,6 @@ class TensorArrayClearCpuKernelMod : public NativeCpuKernelMod { return support_list; } }; - -MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, TensorArrayClear, TensorArrayClearCpuKernelMod); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/rl/tensor_array_close_kernel.cc b/mindspore/ccsrc/plugin/device/cpu/kernel/rl/tensor_array_close_kernel.cc index 62d55c265f..9bfb7d3ce5 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/rl/tensor_array_close_kernel.cc +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/rl/tensor_array_close_kernel.cc @@ -47,5 +47,7 @@ bool TensorArrayCloseCpuKernelMod::Launch(const std::vector &inputs, } return true; } + +MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, TensorArrayClose, TensorArrayCloseCpuKernelMod); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/rl/tensor_array_close_kernel.h b/mindspore/ccsrc/plugin/device/cpu/kernel/rl/tensor_array_close_kernel.h index 6d8d4f218b..c439e943fb 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/rl/tensor_array_close_kernel.h +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/rl/tensor_array_close_kernel.h @@ -39,8 +39,6 @@ class TensorArrayCloseCpuKernelMod : public NativeCpuKernelMod { return support_list; } }; - -MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, TensorArrayClose, TensorArrayCloseCpuKernelMod); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/rl/tensor_array_create_kernel.cc b/mindspore/ccsrc/plugin/device/cpu/kernel/rl/tensor_array_create_kernel.cc index 369e886076..5c2973bd2f 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/rl/tensor_array_create_kernel.cc +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/rl/tensor_array_create_kernel.cc @@ -56,5 +56,7 @@ bool TensorArrayCreateCpuKernelMod::Launch(const std::vector &, cons TensorArrayMgr::GetInstance().AddTensorArray(tensor_array_handle, tensor_array); return true; } + +MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, TensorArray, TensorArrayCreateCpuKernelMod); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/rl/tensor_array_create_kernel.h b/mindspore/ccsrc/plugin/device/cpu/kernel/rl/tensor_array_create_kernel.h index dc88b2b805..2980b4679f 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/rl/tensor_array_create_kernel.h +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/rl/tensor_array_create_kernel.h @@ -45,8 +45,6 @@ class TensorArrayCreateCpuKernelMod : public NativeCpuKernelMod { TypePtr type_; std::string name_; }; - -MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, TensorArray, TensorArrayCreateCpuKernelMod); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/rl/tensor_array_read_kernel.cc b/mindspore/ccsrc/plugin/device/cpu/kernel/rl/tensor_array_read_kernel.cc index 181124e02d..c153583273 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/rl/tensor_array_read_kernel.cc +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/rl/tensor_array_read_kernel.cc @@ -61,5 +61,7 @@ bool TensorArrayReadCpuKernelMod::Launch(const std::vector &inputs, } return true; } + +MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, TensorArrayRead, TensorArrayReadCpuKernelMod); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/rl/tensor_array_read_kernel.h b/mindspore/ccsrc/plugin/device/cpu/kernel/rl/tensor_array_read_kernel.h index 54db26baf1..fdb305e118 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/rl/tensor_array_read_kernel.h +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/rl/tensor_array_read_kernel.h @@ -66,8 +66,6 @@ class TensorArrayReadCpuKernelMod : public NativeCpuKernelMod { std::vector shapes_; TypePtr type_; }; - -MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, TensorArrayRead, TensorArrayReadCpuKernelMod); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/rl/tensor_array_size_kernel.cc b/mindspore/ccsrc/plugin/device/cpu/kernel/rl/tensor_array_size_kernel.cc index f8845c0c55..0c21a29121 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/rl/tensor_array_size_kernel.cc +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/rl/tensor_array_size_kernel.cc @@ -43,5 +43,7 @@ bool TensorArraySizeCpuKernelMod::Launch(const std::vector &inputs, MS_LOG(DEBUG) << "Launch TensorArraySize, valid size is " << out_addr[0]; return true; } + +MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, TensorArraySize, TensorArraySizeCpuKernelMod); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/rl/tensor_array_size_kernel.h b/mindspore/ccsrc/plugin/device/cpu/kernel/rl/tensor_array_size_kernel.h index d497c54d47..7ba3e89a57 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/rl/tensor_array_size_kernel.h +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/rl/tensor_array_size_kernel.h @@ -39,8 +39,6 @@ class TensorArraySizeCpuKernelMod : public NativeCpuKernelMod { return support_list; } }; - -MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, TensorArraySize, TensorArraySizeCpuKernelMod); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/rl/tensor_array_stack_kernel.cc b/mindspore/ccsrc/plugin/device/cpu/kernel/rl/tensor_array_stack_kernel.cc index 50b741eb01..89b9668945 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/rl/tensor_array_stack_kernel.cc +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/rl/tensor_array_stack_kernel.cc @@ -109,5 +109,7 @@ bool TensorArrayStackCpuKernelMod::Launch(const std::vector &inputs, } return true; } + +MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, TensorArrayStack, TensorArrayStackCpuKernelMod); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/rl/tensor_array_stack_kernel.h b/mindspore/ccsrc/plugin/device/cpu/kernel/rl/tensor_array_stack_kernel.h index 2c585c7d8b..08474b0591 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/rl/tensor_array_stack_kernel.h +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/rl/tensor_array_stack_kernel.h @@ -62,8 +62,6 @@ class TensorArrayStackCpuKernelMod : public NativeCpuKernelMod { TypePtr type_; bool is_dynamic_; }; - -MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, TensorArrayStack, TensorArrayStackCpuKernelMod); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/rl/tensor_array_write_kernel.cc b/mindspore/ccsrc/plugin/device/cpu/kernel/rl/tensor_array_write_kernel.cc index ba906eb4a3..7b8bf1f112 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/rl/tensor_array_write_kernel.cc +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/rl/tensor_array_write_kernel.cc @@ -183,5 +183,7 @@ std::vector TensorArrayWriteCpuKernelMod::support_list_ = { // inde .AddOutputAttr(kNumberTypeInt64)}; std::vector TensorArrayWriteCpuKernelMod::GetOpSupport() { return support_list_; } + +MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, TensorArrayWrite, TensorArrayWriteCpuKernelMod); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/rl/tensor_array_write_kernel.h b/mindspore/ccsrc/plugin/device/cpu/kernel/rl/tensor_array_write_kernel.h index ef5064e3a4..2c78f530d4 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/rl/tensor_array_write_kernel.h +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/rl/tensor_array_write_kernel.h @@ -42,8 +42,6 @@ class TensorArrayWriteCpuKernelMod : public NativeCpuKernelMod { TypeId type_; static std::vector support_list_; }; - -MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, TensorArrayWrite, TensorArrayWriteCpuKernelMod); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/scatter_nd_update_cpu_kernel.cc b/mindspore/ccsrc/plugin/device/cpu/kernel/scatter_nd_update_cpu_kernel.cc index 46c50e5701..6411578555 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/scatter_nd_update_cpu_kernel.cc +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/scatter_nd_update_cpu_kernel.cc @@ -182,5 +182,8 @@ void *TensorScatterUpdateCpuKernelMod::ScatterUpdateRealData(const std::vector &inputs, co return true; } + +MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, Slice, SliceCpuKernelMod); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/slice_cpu_kernel.h b/mindspore/ccsrc/plugin/device/cpu/kernel/slice_cpu_kernel.h index dbc6d7d5e0..ec230d6e29 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/slice_cpu_kernel.h +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/slice_cpu_kernel.h @@ -67,8 +67,6 @@ class SliceCpuKernelMod : public NativeCpuKernelMod { int data_size_{4}; SliceParameter slice_param_; }; - -MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, Slice, SliceCpuKernelMod); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/slice_grad_cpu_kernel.cc b/mindspore/ccsrc/plugin/device/cpu/kernel/slice_grad_cpu_kernel.cc index 289ce8a757..112e83b29b 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/slice_grad_cpu_kernel.cc +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/slice_grad_cpu_kernel.cc @@ -405,5 +405,10 @@ std::vector SliceGradCpuKernelMod::GetOpSupport() { return iter->second; } + +MS_KERNEL_FACTORY_REG_BY_CREATOR(NativeCpuKernelMod, SliceGrad, + []() { return std::make_shared(kSliceGrad); }); +MS_KERNEL_FACTORY_REG_BY_CREATOR(NativeCpuKernelMod, StridedSliceGrad, + []() { return std::make_shared(kStridedSliceGrad); }); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/slice_grad_cpu_kernel.h b/mindspore/ccsrc/plugin/device/cpu/kernel/slice_grad_cpu_kernel.h index 8cb1d51227..9129e12d97 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/slice_grad_cpu_kernel.h +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/slice_grad_cpu_kernel.h @@ -66,11 +66,6 @@ class SliceGradCpuKernelMod : public NativeCpuKernelMod { TypeId dtype_{kTypeUnknown}; std::string kernel_type_{kUnknown}; }; - -MS_KERNEL_FACTORY_REG_BY_CREATOR(NativeCpuKernelMod, SliceGrad, - []() { return std::make_shared(kSliceGrad); }); -MS_KERNEL_FACTORY_REG_BY_CREATOR(NativeCpuKernelMod, StridedSliceGrad, - []() { return std::make_shared(kStridedSliceGrad); }); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/sparse_apply_adam_cpu_kernel.cc b/mindspore/ccsrc/plugin/device/cpu/kernel/sparse_apply_adam_cpu_kernel.cc index 405f6ea345..16c2c5c4c1 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/sparse_apply_adam_cpu_kernel.cc +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/sparse_apply_adam_cpu_kernel.cc @@ -229,5 +229,7 @@ bool SparseApplyAdamCpuKernelMod::Launch(const std::vector & } return true; } + +MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, FusedSparseAdam, SparseApplyAdamCpuKernelMod); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/sparse_apply_adam_cpu_kernel.h b/mindspore/ccsrc/plugin/device/cpu/kernel/sparse_apply_adam_cpu_kernel.h index 243d1b28bb..ffee10a0bb 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/sparse_apply_adam_cpu_kernel.h +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/sparse_apply_adam_cpu_kernel.h @@ -79,8 +79,6 @@ class SparseApplyAdamCpuKernelMod : public SparseOptimizerCpuKernelMod { void LaunchKernel(const std::vector &inputs, const std::vector &workspace) const; }; - -MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, FusedSparseAdam, SparseApplyAdamCpuKernelMod); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/sparse_apply_ftrl_cpu_kernel.cc b/mindspore/ccsrc/plugin/device/cpu/kernel/sparse_apply_ftrl_cpu_kernel.cc index 96aec849bb..6fc1a928a4 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/sparse_apply_ftrl_cpu_kernel.cc +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/sparse_apply_ftrl_cpu_kernel.cc @@ -210,5 +210,7 @@ bool SparseApplyFtrlCpuKernelMod::Launch(const std::vector & } return true; } + +MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, FusedSparseFtrl, SparseApplyFtrlCpuKernelMod); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/sparse_apply_ftrl_cpu_kernel.h b/mindspore/ccsrc/plugin/device/cpu/kernel/sparse_apply_ftrl_cpu_kernel.h index 15ce13cb13..d338c14e92 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/sparse_apply_ftrl_cpu_kernel.h +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/sparse_apply_ftrl_cpu_kernel.h @@ -70,8 +70,6 @@ class SparseApplyFtrlCpuKernelMod : public SparseOptimizerCpuKernelMod { void LaunchKernel(const std::vector &inputs, const std::vector &workspace) const; }; - -MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, FusedSparseFtrl, SparseApplyFtrlCpuKernelMod); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/sparse_apply_lazy_adam_cpu_kernel.cc b/mindspore/ccsrc/plugin/device/cpu/kernel/sparse_apply_lazy_adam_cpu_kernel.cc index 5594828dce..b81e43d36f 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/sparse_apply_lazy_adam_cpu_kernel.cc +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/sparse_apply_lazy_adam_cpu_kernel.cc @@ -200,5 +200,7 @@ bool SparseApplyLazyAdamCpuKernelMod::Launch(const std::vector &inputs, const std::vector &workspace) const; }; - -MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, FusedSparseLazyAdam, SparseApplyLazyAdamCpuKernelMod); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/sparse_apply_proximal_adagrad_cpu_kernel.cc b/mindspore/ccsrc/plugin/device/cpu/kernel/sparse_apply_proximal_adagrad_cpu_kernel.cc index fdf12f11a0..0d3d770dea 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/sparse_apply_proximal_adagrad_cpu_kernel.cc +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/sparse_apply_proximal_adagrad_cpu_kernel.cc @@ -198,5 +198,7 @@ bool SparseApplyProximalAdagradCpuKernelMod::Launch(const std::vector &inputs, const std::vector &workspace) const; }; - -MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, FusedSparseProximalAdagrad, SparseApplyProximalAdagradCpuKernelMod); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/stridedslice_cpu_kernel.cc b/mindspore/ccsrc/plugin/device/cpu/kernel/stridedslice_cpu_kernel.cc index 67e567add6..6e9545facd 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/stridedslice_cpu_kernel.cc +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/stridedslice_cpu_kernel.cc @@ -244,5 +244,7 @@ bool StridedSliceCpuKernelMod::Launch(const std::vector &inp } return true; } + +MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, StridedSlice, StridedSliceCpuKernelMod); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/stridedslice_cpu_kernel.h b/mindspore/ccsrc/plugin/device/cpu/kernel/stridedslice_cpu_kernel.h index 45a5f71c56..c9d36029ae 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/stridedslice_cpu_kernel.h +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/stridedslice_cpu_kernel.h @@ -92,8 +92,6 @@ class StridedSliceCpuKernelMod : public NativeCpuKernelMod { std::vector output_shape_; StridedSliceParameter slice_param_; }; - -MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, StridedSlice, StridedSliceCpuKernelMod); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/sub_and_filter_cpu_kernel.cc b/mindspore/ccsrc/plugin/device/cpu/kernel/sub_and_filter_cpu_kernel.cc index eff980c73a..fa86977f75 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/sub_and_filter_cpu_kernel.cc +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/sub_and_filter_cpu_kernel.cc @@ -85,5 +85,7 @@ void SubAndFilterCpuKernelMod::LaunchKernel(const std::vector &input } common::AnfAlgo::SetOutputInferTypeAndShape(dtypes, {out_shape, out_shape}, node.get()); } + +MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, SubAndFilter, SubAndFilterCpuKernelMod); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/sub_and_filter_cpu_kernel.h b/mindspore/ccsrc/plugin/device/cpu/kernel/sub_and_filter_cpu_kernel.h index 8403cf12e9..dfe278f3f5 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/sub_and_filter_cpu_kernel.h +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/sub_and_filter_cpu_kernel.h @@ -60,8 +60,6 @@ class SubAndFilterCpuKernelMod : public NativeCpuKernelMod { TypeId input_x_dtype_{kTypeUnknown}; CNodeWeakPtr node_wpt_; }; - -MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, SubAndFilter, SubAndFilterCpuKernelMod); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/tensor_copy_cpu_kernel.cc b/mindspore/ccsrc/plugin/device/cpu/kernel/tensor_copy_cpu_kernel.cc index 24c7cc3bd2..e46c050a91 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/tensor_copy_cpu_kernel.cc +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/tensor_copy_cpu_kernel.cc @@ -51,5 +51,7 @@ bool TensorCopyCpuKernelMod::Launch(const std::vector &input } return true; } + +MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, TensorMove, TensorCopyCpuKernelMod); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/tensor_copy_cpu_kernel.h b/mindspore/ccsrc/plugin/device/cpu/kernel/tensor_copy_cpu_kernel.h index c57b85da3a..2e6b87195e 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/tensor_copy_cpu_kernel.h +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/tensor_copy_cpu_kernel.h @@ -49,8 +49,6 @@ class TensorCopyCpuKernelMod : public NativeCpuKernelMod { return support_list; } }; - -MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, TensorMove, TensorCopyCpuKernelMod); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/tensor_copy_slices_cpu_kernel.cc b/mindspore/ccsrc/plugin/device/cpu/kernel/tensor_copy_slices_cpu_kernel.cc index d5445df568..ca1122957c 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/tensor_copy_slices_cpu_kernel.cc +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/tensor_copy_slices_cpu_kernel.cc @@ -71,5 +71,7 @@ bool TensorCopySlicesCpuKernelMod::Launch(const std::vector } return true; } + +MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, TensorCopySlices, TensorCopySlicesCpuKernelMod); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/tensor_copy_slices_cpu_kernel.h b/mindspore/ccsrc/plugin/device/cpu/kernel/tensor_copy_slices_cpu_kernel.h index f819fb2b37..3a262e3786 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/tensor_copy_slices_cpu_kernel.h +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/tensor_copy_slices_cpu_kernel.h @@ -42,8 +42,6 @@ class TensorCopySlicesCpuKernelMod : public NativeCpuKernelMod { std::vector update_shape_; std::vector output_shape_; }; - -MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, TensorCopySlices, TensorCopySlicesCpuKernelMod); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/tile_cpu_kernel.cc b/mindspore/ccsrc/plugin/device/cpu/kernel/tile_cpu_kernel.cc index d124b9af09..34e8b94d88 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/tile_cpu_kernel.cc +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/tile_cpu_kernel.cc @@ -160,5 +160,7 @@ void TileCpuKernelMod::LaunchKernel(const std::vector &inputs, const Tile(x_addr, y_addr, &tile_parameter_); } + +MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, Tile, TileCpuKernelMod); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/tile_cpu_kernel.h b/mindspore/ccsrc/plugin/device/cpu/kernel/tile_cpu_kernel.h index e235380a80..7053fb8c84 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/tile_cpu_kernel.h +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/tile_cpu_kernel.h @@ -73,8 +73,6 @@ class TileCpuKernelMod : public NativeCpuKernelMod { bool one_dim_tile_{false}; size_t input_size_{0}; }; - -MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, Tile, TileCpuKernelMod); } // namespace kernel } // namespace mindspore #endif // MINDSPORE_CCSRC_BACKEND_KERNEL_COMPILER_CPU_TILE_CPU_KERNEL_H_ diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/topk_cpu_kernel.cc b/mindspore/ccsrc/plugin/device/cpu/kernel/topk_cpu_kernel.cc index 92c501002f..2e87c2cc30 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/topk_cpu_kernel.cc +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/topk_cpu_kernel.cc @@ -126,5 +126,7 @@ bool TopKCpuKernelMod::Launch(const std::vector &inputs, } return true; } + +MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, TopK, TopKCpuKernelMod); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/topk_cpu_kernel.h b/mindspore/ccsrc/plugin/device/cpu/kernel/topk_cpu_kernel.h index 6c2d9643ac..b5255b073e 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/topk_cpu_kernel.h +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/topk_cpu_kernel.h @@ -46,8 +46,6 @@ class TopKCpuKernelMod : public NativeCpuKernelMod { bool sorted_{false}; TypeId dtype_{kTypeUnknown}; }; - -MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, TopK, TopKCpuKernelMod); } // namespace kernel } // namespace mindspore #endif // MINDSPORE_CCSRC_BACKEND_KERNEL_COMPILER_CPU_TOPK_CPU_KERNEL_H_ diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/transpose_cpu_kernel.cc b/mindspore/ccsrc/plugin/device/cpu/kernel/transpose_cpu_kernel.cc index ae3690da27..d481c4a4a0 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/transpose_cpu_kernel.cc +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/transpose_cpu_kernel.cc @@ -166,5 +166,7 @@ void TransposeFwdCpuKernelMod::ParallelRun(const T *input_addr, T *output_addr, }; ParallelLaunchAutoSearch(task, thread_num, this, ¶llel_search_info_); } + +MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, Transpose, TransposeFwdCpuKernelMod); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/transpose_cpu_kernel.h b/mindspore/ccsrc/plugin/device/cpu/kernel/transpose_cpu_kernel.h index dad075a9bc..1cd60d52fa 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/transpose_cpu_kernel.h +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/transpose_cpu_kernel.h @@ -54,8 +54,6 @@ class TransposeFwdCpuKernelMod : public NativeCpuKernelMod { std::unordered_map launch_map_; TypeKernel launch_func_; }; - -MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, Transpose, TransposeFwdCpuKernelMod); } // namespace kernel } // namespace mindspore #endif // MINDSPORE_CCSRC_BACKEND_KERNEL_COMPILER_CPU_TRANSPOSE_CPU_KERNEL_H_ diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/unique_cpu_kernel.cc b/mindspore/ccsrc/plugin/device/cpu/kernel/unique_cpu_kernel.cc index 172676c05f..d15e2ad999 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/unique_cpu_kernel.cc +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/unique_cpu_kernel.cc @@ -117,5 +117,7 @@ void UniqueCpuKernelMod::LaunchKernel(const std::vector &inputs, con } output_size_ = static_cast(params->output_size_); } + +MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, Unique, UniqueCpuKernelMod); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/unique_cpu_kernel.h b/mindspore/ccsrc/plugin/device/cpu/kernel/unique_cpu_kernel.h index 3cba7778f4..25272ff88e 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/unique_cpu_kernel.h +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/unique_cpu_kernel.h @@ -388,8 +388,6 @@ class UniqueCpuKernelMod : public NativeCpuKernelMod { return support_list; } }; - -MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, Unique, UniqueCpuKernelMod); } // namespace kernel } // namespace mindspore #endif // MINDSPORE_CCSRC_BACKEND_KERNEL_COMPILER_CPU_UNIQUE_CPU_KERNEL_H_ diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/unique_with_pad_cpu_kernel.cc b/mindspore/ccsrc/plugin/device/cpu/kernel/unique_with_pad_cpu_kernel.cc index 6c1d5e2518..08b12a015c 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/unique_with_pad_cpu_kernel.cc +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/unique_with_pad_cpu_kernel.cc @@ -55,5 +55,7 @@ void UniqueWithPadCpuKernelMod::PadOutput(const std::vector &inputs, out[i] = pad_num; } } + +MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, UniqueWithPad, UniqueWithPadCpuKernelMod); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/unique_with_pad_cpu_kernel.h b/mindspore/ccsrc/plugin/device/cpu/kernel/unique_with_pad_cpu_kernel.h index 73114ab5c0..b0bd357132 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/unique_with_pad_cpu_kernel.h +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/unique_with_pad_cpu_kernel.h @@ -57,8 +57,6 @@ class UniqueWithPadCpuKernelMod : public UniqueCpuKernelMod { template void PadOutput(const std::vector &inputs, const std::vector &outputs) const; }; - -MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, UniqueWithPad, UniqueWithPadCpuKernelMod); } // namespace kernel } // namespace mindspore #endif // MINDSPORE_CCSRC_BACKEND_KERNEL_COMPILER_CPU_UNIQUE_WITH_PAD_CPU_KERNEL_H_ diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/unsorted_segment_sum_cpu_kernel.cc b/mindspore/ccsrc/plugin/device/cpu/kernel/unsorted_segment_sum_cpu_kernel.cc index 24950a74c2..92a1093095 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/unsorted_segment_sum_cpu_kernel.cc +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/unsorted_segment_sum_cpu_kernel.cc @@ -94,5 +94,7 @@ bool UnsortedSegmentSumCpuKernelMod::Launch(const std::vector &inputs } } } + +MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, UpdateCache, UpdateCacheCpuKernelMod); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/update_cache_cpu_kernel.h b/mindspore/ccsrc/plugin/device/cpu/kernel/update_cache_cpu_kernel.h index 0938b529b7..19e7c89d40 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/update_cache_cpu_kernel.h +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/update_cache_cpu_kernel.h @@ -89,8 +89,6 @@ class UpdateCacheCpuKernelMod : public NativeCpuKernelMod { size_t input_x_dtype_size_{4}; CNodeWeakPtr node_wpt_; }; - -MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, UpdateCache, UpdateCacheCpuKernelMod); } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/factory/ms_factory.h b/mindspore/ccsrc/plugin/factory/ms_factory.h index 08b00ff5a1..f85e0136c3 100644 --- a/mindspore/ccsrc/plugin/factory/ms_factory.h +++ b/mindspore/ccsrc/plugin/factory/ms_factory.h @@ -42,7 +42,12 @@ class Factory { return instance; } - void Register(const std::string &name, CreatorFunc &&creator) { (void)kernel_mod_creators_.emplace(name, creator); } + void Register(const std::string &name, CreatorFunc &&creator) { + if (IsRegistered(name)) { + MS_LOG(EXCEPTION) << "Kernel " << name << " is already registered!"; + } + (void)kernel_mod_creators_.emplace(name, creator); + } std::shared_ptr Create(const std::string &name) { auto iter = kernel_mod_creators_.find(name);