forked from huawei/mindspore2022
cpu kernel registerd
This commit is contained in:
parent
059c939854
commit
b8cbf8d176
|
|
@ -44,8 +44,6 @@ class EmbeddingLookUpCommGradCpuKernelMod : public NativeCpuKernelMod {
|
|||
private:
|
||||
int64_t split_num_;
|
||||
};
|
||||
|
||||
MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, EmbeddingLookupCommGrad, EmbeddingLookUpCommGradCpuKernelMod);
|
||||
} // namespace kernel
|
||||
} // namespace mindspore
|
||||
|
||||
|
|
|
|||
|
|
@ -126,5 +126,7 @@ bool EmbeddingLookUpCpuKernelMod::Launch(const std::vector<kernel::AddressPtr> &
|
|||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, EmbeddingLookup, EmbeddingLookUpCpuKernelMod);
|
||||
} // namespace kernel
|
||||
} // namespace mindspore
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -44,5 +44,7 @@ bool EnvironCreateCpuKernelMod::Launch(const std::vector<AddressPtr> &, const st
|
|||
|
||||
return true;
|
||||
}
|
||||
|
||||
MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, EnvironCreate, EnvironCreateCpuKernelMod);
|
||||
} // namespace kernel
|
||||
} // namespace mindspore
|
||||
|
|
|
|||
|
|
@ -41,8 +41,6 @@ class EnvironCreateCpuKernelMod : public NativeCpuKernelMod {
|
|||
private:
|
||||
size_t handle_size_;
|
||||
};
|
||||
|
||||
MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, EnvironCreate, EnvironCreateCpuKernelMod);
|
||||
} // namespace kernel
|
||||
} // namespace mindspore
|
||||
|
||||
|
|
|
|||
|
|
@ -38,5 +38,7 @@ bool EnvironDestroyAllCpuKernelMod::Launch(const std::vector<AddressPtr> &, cons
|
|||
|
||||
return true;
|
||||
}
|
||||
|
||||
MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, EnvironDestroyAll, EnvironDestroyAllCpuKernelMod);
|
||||
} // namespace kernel
|
||||
} // namespace mindspore
|
||||
|
|
|
|||
|
|
@ -38,8 +38,6 @@ class EnvironDestroyAllCpuKernelMod : public NativeCpuKernelMod {
|
|||
return support_list;
|
||||
}
|
||||
};
|
||||
|
||||
MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, EnvironDestroyAll, EnvironDestroyAllCpuKernelMod);
|
||||
} // namespace kernel
|
||||
} // namespace mindspore
|
||||
|
||||
|
|
|
|||
|
|
@ -95,5 +95,7 @@ bool EnvironGetCpuKernelMod::Launch(const std::vector<AddressPtr> &inputs, const
|
|||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, EnvironGet, EnvironGetCpuKernelMod);
|
||||
} // namespace kernel
|
||||
} // namespace mindspore
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -85,5 +85,7 @@ bool EnvironSetCpuKernelMod::Launch(const std::vector<AddressPtr> &inputs, const
|
|||
|
||||
return true;
|
||||
}
|
||||
|
||||
MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, EnvironSet, EnvironSetCpuKernelMod);
|
||||
} // namespace kernel
|
||||
} // namespace mindspore
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -52,5 +52,7 @@ bool EqualCountCpuKernelMod::Launch(const std::vector<kernel::AddressPtr> &input
|
|||
output[0] = count;
|
||||
return true;
|
||||
}
|
||||
|
||||
MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, EqualCount, EqualCountCpuKernelMod);
|
||||
} // namespace kernel
|
||||
} // namespace mindspore
|
||||
|
|
|
|||
|
|
@ -34,8 +34,6 @@ class EqualCountCpuKernelMod : public NativeCpuKernelMod {
|
|||
bool Launch(const std::vector<AddressPtr> &inputs, const std::vector<AddressPtr> &workspace,
|
||||
const std::vector<AddressPtr> &outputs) override;
|
||||
};
|
||||
|
||||
MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, EqualCount, EqualCountCpuKernelMod);
|
||||
} // namespace kernel
|
||||
} // namespace mindspore
|
||||
|
||||
|
|
|
|||
|
|
@ -60,5 +60,7 @@ void Expm1CpuKernelMod::LaunchKernel(const std::vector<AddressPtr> &inputs,
|
|||
output[i] = exp(input[i]) - T(1);
|
||||
}
|
||||
}
|
||||
|
||||
MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, Expm1, Expm1CpuKernelMod);
|
||||
} // namespace kernel
|
||||
} // namespace mindspore
|
||||
|
|
|
|||
|
|
@ -48,8 +48,6 @@ class Expm1CpuKernelMod : public NativeCpuKernelMod {
|
|||
private:
|
||||
TypeId input_dtype_{kTypeUnknown};
|
||||
};
|
||||
|
||||
MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, Expm1, Expm1CpuKernelMod);
|
||||
} // namespace kernel
|
||||
} // namespace mindspore
|
||||
|
||||
|
|
|
|||
|
|
@ -198,5 +198,7 @@ bool FusedCastAdamWeightDecayCpuKernelMod::Launch(const std::vector<kernel::Addr
|
|||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, FusedCastAdamWeightDecay, FusedCastAdamWeightDecayCpuKernelMod);
|
||||
} // namespace kernel
|
||||
} // namespace mindspore
|
||||
|
|
|
|||
|
|
@ -81,8 +81,6 @@ class FusedCastAdamWeightDecayCpuKernelMod : public NativeCpuKernelMod {
|
|||
TypeId gradient_dtype_{kTypeUnknown};
|
||||
enum input_list_ { VAR, M, V, LR, BETA1, BETA2, EPSILON, DECAY, GRAD, GLOBAL_NORM };
|
||||
};
|
||||
|
||||
MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, FusedCastAdamWeightDecay, FusedCastAdamWeightDecayCpuKernelMod);
|
||||
} // namespace kernel
|
||||
} // namespace mindspore
|
||||
|
||||
|
|
|
|||
|
|
@ -213,5 +213,7 @@ T GridSampler3DCpuKernelMod::reflect_coordinates(T coord, int64_t twice_low, int
|
|||
bool GridSampler3DCpuKernelMod::within_bounds_3d(int64_t d, int64_t h, int64_t w, int64_t D, int64_t H, int64_t W) {
|
||||
return d >= 0 && d < D && h >= 0 && h < H && w >= 0 && w < W;
|
||||
}
|
||||
|
||||
MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, GridSampler3D, GridSampler3DCpuKernelMod);
|
||||
} // namespace kernel
|
||||
} // namespace mindspore
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -323,5 +323,7 @@ bool GridSampler3DGradCpuKernelMod::within_bounds_3d(int64_t d, int64_t h, int64
|
|||
int64_t iW = static_cast<int64_t>(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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -165,5 +165,7 @@ bool HSVToRGBCpuKernelMod::Launch(const std::vector<AddressPtr> &inputs, const s
|
|||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, HSVToRGB, HSVToRGBCpuKernelMod);
|
||||
} // namespace kernel
|
||||
} // namespace mindspore
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -88,5 +88,7 @@ void IsFiniteCpuKernelMod::LaunchKernelOther(const std::vector<AddressPtr> &inpu
|
|||
output[i] = true;
|
||||
}
|
||||
}
|
||||
|
||||
MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, IsFinite, IsFiniteCpuKernelMod);
|
||||
} // namespace kernel
|
||||
} // namespace mindspore
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -80,5 +80,6 @@ void IsInfCpuKernelMod::LaunchKernelFloat(const std::vector<AddressPtr> &inputs,
|
|||
}
|
||||
}
|
||||
|
||||
MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, IsInf, IsInfCpuKernelMod);
|
||||
} // namespace kernel
|
||||
} // namespace mindspore
|
||||
|
|
|
|||
|
|
@ -54,8 +54,6 @@ class IsInfCpuKernelMod : public NativeCpuKernelMod {
|
|||
|
||||
TypeId input_dtype_{kTypeUnknown};
|
||||
};
|
||||
|
||||
MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, IsInf, IsInfCpuKernelMod);
|
||||
} // namespace kernel
|
||||
} // namespace mindspore
|
||||
|
||||
|
|
|
|||
|
|
@ -87,5 +87,7 @@ void IsNanCpuKernelMod::LaunchKernelOther(const std::vector<AddressPtr> &inputs,
|
|||
output[i] = false;
|
||||
}
|
||||
}
|
||||
|
||||
MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, IsNan, IsNanCpuKernelMod);
|
||||
} // namespace kernel
|
||||
} // namespace mindspore
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -124,5 +124,7 @@ void LayerNormCpuKernelMod::LaunchKernel(const std::vector<AddressPtr> &inputs,
|
|||
}
|
||||
ParallelLaunch(tasks);
|
||||
}
|
||||
|
||||
MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, LayerNorm, LayerNormCpuKernelMod);
|
||||
} // namespace kernel
|
||||
} // namespace mindspore
|
||||
|
|
|
|||
|
|
@ -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_
|
||||
|
|
|
|||
|
|
@ -154,5 +154,7 @@ void LayerNormGradCpuKernelMod::LaunchKernel(const std::vector<AddressPtr> &inpu
|
|||
}
|
||||
ParallelLaunch(tasks2);
|
||||
}
|
||||
|
||||
MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, LayerNormGrad, LayerNormGradCpuKernelMod);
|
||||
} // namespace kernel
|
||||
} // namespace mindspore
|
||||
|
|
|
|||
|
|
@ -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_
|
||||
|
|
|
|||
|
|
@ -162,5 +162,7 @@ void LogMatrixDeterminantCpuKernelMod::LaunchLogMatrixDeterminant(const std::vec
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, LogMatrixDeterminant, LogMatrixDeterminantCpuKernelMod);
|
||||
} // namespace kernel
|
||||
} // namespace mindspore
|
||||
|
|
|
|||
|
|
@ -56,8 +56,6 @@ class LogMatrixDeterminantCpuKernelMod : public NativeCpuKernelMod {
|
|||
template <typename T>
|
||||
void LaunchLogMatrixDeterminant(const std::vector<AddressPtr> &inputs, const std::vector<AddressPtr> &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_
|
||||
|
|
|
|||
|
|
@ -107,5 +107,7 @@ void LstsqCpuKernelMod::LaunchKernel(const std::vector<AddressPtr> &inputs, cons
|
|||
*(output_addr + i * k + j) = static_cast<T2>(result(i, j));
|
||||
}
|
||||
}
|
||||
|
||||
MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, Lstsq, LstsqCpuKernelMod);
|
||||
} // namespace kernel
|
||||
} // namespace mindspore
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -203,5 +203,7 @@ void MapCacheIdxCpuKernelMod::LaunchKernel(const std::vector<AddressPtr> &inputs
|
|||
}
|
||||
UpdateShape(miss_count, node);
|
||||
}
|
||||
|
||||
MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, MapCacheIdx, MapCacheIdxCpuKernelMod);
|
||||
} // namespace kernel
|
||||
} // namespace mindspore
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -80,5 +80,7 @@ void MapUniformCpuKernelMod::LaunchKernel(const std::vector<AddressPtr> &inputs,
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, MapUniform, MapUniformCpuKernelMod);
|
||||
} // namespace kernel
|
||||
} // namespace mindspore
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -96,5 +96,7 @@ void MatrixDeterminantCpuKernelMod::LaunchMatrixDeterminant(const std::vector<Ad
|
|||
};
|
||||
CPUKernelUtils::ParallelFor(task, n);
|
||||
}
|
||||
|
||||
MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, MatrixDeterminant, MatrixDeterminantCpuKernelMod);
|
||||
} // namespace kernel
|
||||
} // namespace mindspore
|
||||
|
|
|
|||
|
|
@ -50,8 +50,6 @@ class MatrixDeterminantCpuKernelMod : public NativeCpuKernelMod {
|
|||
template <typename T>
|
||||
void LaunchMatrixDeterminant(const std::vector<AddressPtr> &inputs, const std::vector<AddressPtr> &outputs);
|
||||
};
|
||||
|
||||
MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, MatrixDeterminant, MatrixDeterminantCpuKernelMod);
|
||||
} // namespace kernel
|
||||
} // namespace mindspore
|
||||
#endif // MINDSPORE_CCSRC_BACKEND_KERNEL_COMPILER_CPU_MATRIX_DETERMINANT_CPU_KERNEL_H_
|
||||
|
|
|
|||
|
|
@ -124,5 +124,7 @@ void MatrixInverseCpuKernelMod::LaunchMatrixInverse(const std::vector<AddressPtr
|
|||
CPUKernelUtils::ParallelFor(task, matrix_num);
|
||||
}
|
||||
}
|
||||
|
||||
MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, MatrixInverse, MatrixInverseCpuKernelMod);
|
||||
} // namespace kernel
|
||||
} // namespace mindspore
|
||||
|
|
|
|||
|
|
@ -51,8 +51,6 @@ class MatrixInverseCpuKernelMod : public NativeCpuKernelMod {
|
|||
template <typename T>
|
||||
void LaunchMatrixInverse(const std::vector<AddressPtr> &inputs, const std::vector<AddressPtr> &outputs);
|
||||
};
|
||||
|
||||
MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, MatrixInverse, MatrixInverseCpuKernelMod);
|
||||
} // namespace kernel
|
||||
} // namespace mindspore
|
||||
#endif // MINDSPORE_CCSRC_BACKEND_KERNEL_COMPILER_CPU_MATRIX_INVERSE_CPU_KERNEL_H_
|
||||
|
|
|
|||
|
|
@ -176,5 +176,7 @@ void MatrixSetDiagCpuKernelMod::LaunchKernel(const std::vector<AddressPtr> &inpu
|
|||
};
|
||||
CPUKernelUtils::ParallelFor(task, max_index);
|
||||
}
|
||||
|
||||
MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, MatrixSetDiag, MatrixSetDiagCpuKernelMod);
|
||||
} // namespace kernel
|
||||
} // namespace mindspore
|
||||
|
|
|
|||
|
|
@ -78,8 +78,6 @@ class MatrixSetDiagCpuKernelMod : public NativeCpuKernelMod {
|
|||
std::pair<MatrixDiag::Alignment, MatrixDiag::Alignment> 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_
|
||||
|
|
|
|||
|
|
@ -155,5 +155,7 @@ void MaximumGradCpuKernelMod::LaunchKernel(const std::vector<AddressPtr> &inputs
|
|||
MaximumGradRecTask<T>(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
|
||||
|
|
|
|||
|
|
@ -46,8 +46,6 @@ class MaximumGradCpuKernelMod : public NativeCpuKernelMod {
|
|||
std::vector<size_t> dy_shape;
|
||||
TypeId dtype_{kTypeUnknown};
|
||||
};
|
||||
|
||||
MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, MaximumGrad, MaximumGradCpuKernelMod);
|
||||
} // namespace kernel
|
||||
} // namespace mindspore
|
||||
|
||||
|
|
|
|||
|
|
@ -155,5 +155,7 @@ void MinimumGradCpuKernelMod::LaunchKernel(const std::vector<AddressPtr> &inputs
|
|||
MinimumGradRecTask<T>(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
|
||||
|
|
|
|||
|
|
@ -46,8 +46,6 @@ class MinimumGradCpuKernelMod : public NativeCpuKernelMod {
|
|||
std::vector<size_t> 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_
|
||||
|
|
|
|||
|
|
@ -210,5 +210,7 @@ void MirrorPadCpuKernelMod::LaunchKernel(const std::vector<AddressPtr> &inputs,
|
|||
outputs_addr[pos] = inputs_addr[pos_index];
|
||||
}
|
||||
}
|
||||
|
||||
MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, MirrorPad, MirrorPadCpuKernelMod);
|
||||
} // namespace kernel
|
||||
} // namespace mindspore
|
||||
|
|
|
|||
|
|
@ -64,8 +64,6 @@ class MirrorPadCpuKernelMod : public NativeCpuKernelMod {
|
|||
std::vector<int64_t> input_shape_;
|
||||
std::vector<int64_t> 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_
|
||||
|
|
|
|||
|
|
@ -311,5 +311,7 @@ void MirrorPadGradCpuKernelMod::LaunchKernel(const std::vector<AddressPtr> &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
|
||||
|
|
|
|||
|
|
@ -78,8 +78,6 @@ class MirrorPadGradCpuKernelMod : public NativeCpuKernelMod {
|
|||
std::vector<int64_t> input_shape_;
|
||||
std::vector<int64_t> 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_
|
||||
|
|
|
|||
|
|
@ -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<size_t> src0_shape = AnfAlgo::GetInputDeviceShape(kernel_node, 0);
|
||||
std::vector<size_t> 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::binary::desc>(dnnl::algorithm::binary_add, src0_desc, src1_desc, src0_desc);
|
||||
auto prim_desc = CreateDesc<dnnl::binary::primitive_desc>(desc, engine_);
|
||||
primitive_ = CreatePrimitive<dnnl::binary>(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<kernel::AddressPtr> &inputs,
|
||||
const std::vector<kernel::AddressPtr> &,
|
||||
const std::vector<kernel::AddressPtr> &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
|
||||
|
|
@ -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 <vector>
|
||||
#include <memory>
|
||||
#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<AddressPtr> &inputs, const std::vector<AddressPtr> &workspace,
|
||||
const std::vector<AddressPtr> &outputs) override;
|
||||
|
||||
protected:
|
||||
std::vector<KernelAttr> GetOpSupport() override {
|
||||
static std::vector<KernelAttr> 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_
|
||||
|
|
@ -112,5 +112,7 @@ bool BatchNormCpuKernelMod::Launch(const std::vector<kernel::AddressPtr> &inputs
|
|||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, BatchNorm, BatchNormCpuKernelMod);
|
||||
} // namespace kernel
|
||||
} // namespace mindspore
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -126,5 +126,7 @@ bool BatchNormGradCpuKernelMod::Launch(const std::vector<kernel::AddressPtr> &in
|
|||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, BatchNormGrad, BatchNormGradCpuKernelMod);
|
||||
} // namespace kernel
|
||||
} // namespace mindspore
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -102,5 +102,8 @@ bool ConvCpuKernelMod::Launch(const std::vector<kernel::AddressPtr> &inputs, con
|
|||
ExecutePrimitive();
|
||||
return true;
|
||||
}
|
||||
|
||||
MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, Conv2D, ConvCpuKernelMod);
|
||||
MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, Conv3D, ConvCpuKernelMod);
|
||||
} // namespace kernel
|
||||
} // namespace mindspore
|
||||
|
|
|
|||
|
|
@ -34,9 +34,6 @@ class ConvCpuKernelMod : public MKLCpuKernelMod {
|
|||
bool Launch(const std::vector<AddressPtr> &inputs, const std::vector<AddressPtr> &workspace,
|
||||
const std::vector<AddressPtr> &outputs) override;
|
||||
};
|
||||
|
||||
MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, Conv2D, ConvCpuKernelMod);
|
||||
MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, Conv3D, ConvCpuKernelMod);
|
||||
} // namespace kernel
|
||||
} // namespace mindspore
|
||||
|
||||
|
|
|
|||
|
|
@ -80,5 +80,19 @@ bool EltWiseCpuKernelMod::Launch(const std::vector<kernel::AddressPtr> &inputs,
|
|||
ExecutePrimitive();
|
||||
return true;
|
||||
}
|
||||
|
||||
MS_KERNEL_FACTORY_REG_BY_CREATOR(NativeCpuKernelMod, Elu, []() { return std::make_shared<EltWiseCpuKernelMod>(kElu); });
|
||||
MS_KERNEL_FACTORY_REG_BY_CREATOR(NativeCpuKernelMod, ReLU,
|
||||
[]() { return std::make_shared<EltWiseCpuKernelMod>(kReLU); });
|
||||
MS_KERNEL_FACTORY_REG_BY_CREATOR(NativeCpuKernelMod, ReLU6,
|
||||
[]() { return std::make_shared<EltWiseCpuKernelMod>(kReLU6); });
|
||||
MS_KERNEL_FACTORY_REG_BY_CREATOR(NativeCpuKernelMod, Exp, []() { return std::make_shared<EltWiseCpuKernelMod>(kExp); });
|
||||
MS_KERNEL_FACTORY_REG_BY_CREATOR(NativeCpuKernelMod, Log, []() { return std::make_shared<EltWiseCpuKernelMod>(kLog); });
|
||||
MS_KERNEL_FACTORY_REG_BY_CREATOR(NativeCpuKernelMod, Sigmoid,
|
||||
[]() { return std::make_shared<EltWiseCpuKernelMod>(kSigmoid); });
|
||||
MS_KERNEL_FACTORY_REG_BY_CREATOR(NativeCpuKernelMod, Tanh,
|
||||
[]() { return std::make_shared<EltWiseCpuKernelMod>(kTanh); });
|
||||
MS_KERNEL_FACTORY_REG_BY_CREATOR(NativeCpuKernelMod, Softplus,
|
||||
[]() { return std::make_shared<EltWiseCpuKernelMod>(kSoftplus); });
|
||||
} // namespace kernel
|
||||
} // namespace mindspore
|
||||
|
|
|
|||
|
|
@ -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<EltWiseCpuKernelMod>(kElu); });
|
||||
MS_KERNEL_FACTORY_REG_BY_CREATOR(NativeCpuKernelMod, ReLU,
|
||||
[]() { return std::make_shared<EltWiseCpuKernelMod>(kReLU); });
|
||||
MS_KERNEL_FACTORY_REG_BY_CREATOR(NativeCpuKernelMod, ReLU6,
|
||||
[]() { return std::make_shared<EltWiseCpuKernelMod>(kReLU6); });
|
||||
MS_KERNEL_FACTORY_REG_BY_CREATOR(NativeCpuKernelMod, Exp, []() { return std::make_shared<EltWiseCpuKernelMod>(kExp); });
|
||||
MS_KERNEL_FACTORY_REG_BY_CREATOR(NativeCpuKernelMod, Log, []() { return std::make_shared<EltWiseCpuKernelMod>(kLog); });
|
||||
MS_KERNEL_FACTORY_REG_BY_CREATOR(NativeCpuKernelMod, Sigmoid,
|
||||
[]() { return std::make_shared<EltWiseCpuKernelMod>(kSigmoid); });
|
||||
MS_KERNEL_FACTORY_REG_BY_CREATOR(NativeCpuKernelMod, Tanh,
|
||||
[]() { return std::make_shared<EltWiseCpuKernelMod>(kTanh); });
|
||||
MS_KERNEL_FACTORY_REG_BY_CREATOR(NativeCpuKernelMod, Softplus,
|
||||
[]() { return std::make_shared<EltWiseCpuKernelMod>(kSoftplus); });
|
||||
} // namespace kernel
|
||||
} // namespace mindspore
|
||||
|
||||
|
|
|
|||
|
|
@ -55,5 +55,7 @@ bool LogSoftmaxCpuKernelMod::Launch(const std::vector<kernel::AddressPtr> &input
|
|||
ExecutePrimitive();
|
||||
return true;
|
||||
}
|
||||
|
||||
MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, LogSoftmax, LogSoftmaxCpuKernelMod);
|
||||
} // namespace kernel
|
||||
} // namespace mindspore
|
||||
|
|
|
|||
|
|
@ -40,8 +40,6 @@ class LogSoftmaxCpuKernelMod : public MKLCpuKernelMod {
|
|||
return support_list;
|
||||
}
|
||||
};
|
||||
|
||||
MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, LogSoftmax, LogSoftmaxCpuKernelMod);
|
||||
} // namespace kernel
|
||||
} // namespace mindspore
|
||||
|
||||
|
|
|
|||
|
|
@ -60,5 +60,7 @@ bool LogSoftmaxGradCpuKernelMod::Launch(const std::vector<kernel::AddressPtr> &i
|
|||
ExecutePrimitive();
|
||||
return true;
|
||||
}
|
||||
|
||||
MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, LogSoftmaxGrad, LogSoftmaxGradCpuKernelMod);
|
||||
} // namespace kernel
|
||||
} // namespace mindspore
|
||||
|
|
|
|||
|
|
@ -40,8 +40,6 @@ class LogSoftmaxGradCpuKernelMod : public MKLCpuKernelMod {
|
|||
return support_list;
|
||||
}
|
||||
};
|
||||
|
||||
MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, LogSoftmaxGrad, LogSoftmaxGradCpuKernelMod);
|
||||
} // namespace kernel
|
||||
} // namespace mindspore
|
||||
|
||||
|
|
|
|||
|
|
@ -190,5 +190,7 @@ bool LstmCpuKernelMod::Launch(const std::vector<kernel::AddressPtr> &inputs, con
|
|||
ExecutePrimitive();
|
||||
return true;
|
||||
}
|
||||
|
||||
MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, LSTM, LstmCpuKernelMod);
|
||||
} // namespace kernel
|
||||
} // namespace mindspore
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -251,5 +251,7 @@ bool LSTMGradCpuKernelMod::Launch(const std::vector<kernel::AddressPtr> &inputs,
|
|||
Reorder(&diff_weights_h_memory_, &user_diff_weights_h_memory_);
|
||||
return true;
|
||||
}
|
||||
|
||||
MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, LSTMGrad, LSTMGradCpuKernelMod);
|
||||
} // namespace kernel
|
||||
} // namespace mindspore
|
||||
|
|
|
|||
|
|
@ -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_
|
||||
|
|
|
|||
|
|
@ -61,5 +61,7 @@ bool SoftmaxCpuKernelMod::Launch(const std::vector<kernel::AddressPtr> &inputs,
|
|||
ExecutePrimitive();
|
||||
return true;
|
||||
}
|
||||
|
||||
MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, Softmax, SoftmaxCpuKernelMod);
|
||||
} // namespace kernel
|
||||
} // namespace mindspore
|
||||
|
|
|
|||
|
|
@ -40,8 +40,6 @@ class SoftmaxCpuKernelMod : public MKLCpuKernelMod {
|
|||
return support_list;
|
||||
}
|
||||
};
|
||||
|
||||
MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, Softmax, SoftmaxCpuKernelMod);
|
||||
} // namespace kernel
|
||||
} // namespace mindspore
|
||||
|
||||
|
|
|
|||
|
|
@ -103,5 +103,7 @@ bool SoftmaxCrossEntropyWithLogitsCpuKernelMod::Launch(const std::vector<kernel:
|
|||
ForwardPostExecute(logits, labels, output1, output2);
|
||||
return true;
|
||||
}
|
||||
|
||||
MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, SoftmaxCrossEntropyWithLogits, SoftmaxCrossEntropyWithLogitsCpuKernelMod);
|
||||
} // namespace kernel
|
||||
} // namespace mindspore
|
||||
|
|
|
|||
|
|
@ -49,8 +49,6 @@ class SoftmaxCrossEntropyWithLogitsCpuKernelMod : public MKLCpuKernelMod {
|
|||
size_t class_num_{0};
|
||||
size_t batch_size_{0};
|
||||
};
|
||||
|
||||
MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, SoftmaxCrossEntropyWithLogits, SoftmaxCrossEntropyWithLogitsCpuKernelMod);
|
||||
} // namespace kernel
|
||||
} // namespace mindspore
|
||||
|
||||
|
|
|
|||
|
|
@ -138,5 +138,8 @@ bool SparseSoftmaxCrossEntropyWithLogitsCpuKernelMod::Launch(const std::vector<k
|
|||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, SparseSoftmaxCrossEntropyWithLogits,
|
||||
SparseSoftmaxCrossEntropyWithLogitsCpuKernelMod);
|
||||
} // namespace kernel
|
||||
} // namespace mindspore
|
||||
|
|
|
|||
|
|
@ -48,9 +48,6 @@ class SparseSoftmaxCrossEntropyWithLogitsCpuKernelMod : public MKLCpuKernelMod {
|
|||
size_t class_num_{0};
|
||||
size_t batch_size_{0};
|
||||
};
|
||||
|
||||
MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, SparseSoftmaxCrossEntropyWithLogits,
|
||||
SparseSoftmaxCrossEntropyWithLogitsCpuKernelMod);
|
||||
} // namespace kernel
|
||||
} // namespace mindspore
|
||||
|
||||
|
|
|
|||
|
|
@ -153,5 +153,7 @@ void MulNoNanCPUKernelMod::LaunchKernel(const std::vector<AddressPtr> &inputs, c
|
|||
BcastCompute<T>(inputs, outputs);
|
||||
}
|
||||
}
|
||||
|
||||
MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, MulNoNan, MulNoNanCPUKernelMod);
|
||||
} // namespace kernel
|
||||
} // namespace mindspore
|
||||
|
|
|
|||
|
|
@ -76,8 +76,6 @@ class MulNoNanCPUKernelMod : public NativeCpuKernelMod {
|
|||
template <typename T>
|
||||
void LaunchKernel(const std::vector<AddressPtr> &inputs, const std::vector<AddressPtr> &outputs);
|
||||
};
|
||||
|
||||
MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, MulNoNan, MulNoNanCPUKernelMod);
|
||||
} // namespace kernel
|
||||
} // namespace mindspore
|
||||
|
||||
|
|
|
|||
|
|
@ -121,5 +121,7 @@ bool MultinomialCpuKernel::Launch(const std::vector<kernel::AddressPtr> &inputs,
|
|||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, Multinomial, MultinomialCpuKernel);
|
||||
} // namespace kernel
|
||||
} // namespace mindspore
|
||||
|
|
|
|||
|
|
@ -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_
|
||||
|
|
|
|||
|
|
@ -96,5 +96,7 @@ void PadAndShiftCpuKernelMod::LaunchKernel(const std::vector<AddressPtr> &inputs
|
|||
}
|
||||
common::AnfAlgo::SetOutputInferTypeAndShape(dtypes, {out_shape}, node_.get());
|
||||
}
|
||||
|
||||
MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, PadAndShift, PadAndShiftCpuKernelMod);
|
||||
} // namespace kernel
|
||||
} // namespace mindspore
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -119,5 +119,7 @@ bool PadCpuKernelMod::LaunchKernel(const std::vector<AddressPtr> &inputs, const
|
|||
ParallelLaunchAutoSearch(task, input_size_, this, ¶llel_search_info_);
|
||||
return true;
|
||||
}
|
||||
|
||||
MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, Pad, PadCpuKernelMod);
|
||||
} // namespace kernel
|
||||
} // namespace mindspore
|
||||
|
|
|
|||
|
|
@ -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_
|
||||
|
|
|
|||
|
|
@ -96,6 +96,8 @@ bool EmbeddingLookUpProxyKernel::Launch(const std::vector<kernel::AddressPtr> &i
|
|||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, EmbeddingLookupProxy, EmbeddingLookUpProxyKernel);
|
||||
} // namespace ps
|
||||
} // namespace kernel
|
||||
} // namespace mindspore
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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 <vector>
|
||||
#include <memory>
|
||||
|
|
@ -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_
|
||||
|
|
|
|||
|
|
@ -203,5 +203,7 @@ bool RandomChoiceWithMaskCpuKernelMod::Launch(const std::vector<kernel::AddressP
|
|||
UpdateOutput(dims, non_zero_num, count, output_length, mask_dim, output_coordinate, mask);
|
||||
return true;
|
||||
}
|
||||
|
||||
MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, RandomChoiceWithMask, RandomChoiceWithMaskCpuKernelMod);
|
||||
} // namespace kernel
|
||||
} // namespace mindspore
|
||||
|
|
|
|||
|
|
@ -56,9 +56,6 @@ class RandomChoiceWithMaskCpuKernelMod : public NativeCpuKernelMod {
|
|||
size_t seed2{0};
|
||||
std::mt19937 generator_;
|
||||
};
|
||||
|
||||
MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, RandomChoiceWithMask, RandomChoiceWithMaskCpuKernelMod);
|
||||
|
||||
} // namespace kernel
|
||||
} // namespace mindspore
|
||||
|
||||
|
|
|
|||
|
|
@ -62,5 +62,7 @@ bool RangeCpuKernelMod::LaunchKernel(const std::vector<AddressPtr> &inputs,
|
|||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, Range, RangeCpuKernelMod);
|
||||
} // namespace kernel
|
||||
} // namespace mindspore
|
||||
|
|
|
|||
|
|
@ -40,8 +40,6 @@ class RangeCpuKernelMod : public NativeCpuKernelMod {
|
|||
|
||||
TypeId dtype_{kTypeUnknown};
|
||||
};
|
||||
|
||||
MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, Range, RangeCpuKernelMod);
|
||||
} // namespace kernel
|
||||
} // namespace mindspore
|
||||
|
||||
|
|
|
|||
|
|
@ -57,5 +57,7 @@ bool ReduceScatterCpuKernelMod::Launch(const std::vector<kernel::AddressPtr> &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
|
||||
|
|
|
|||
|
|
@ -45,8 +45,6 @@ class ReduceScatterCpuKernelMod : public NativeCpuKernelMod {
|
|||
std::string op_type_;
|
||||
std::vector<int> ranks_group_;
|
||||
};
|
||||
|
||||
MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, _HostReduceScatter, ReduceScatterCpuKernelMod);
|
||||
} // namespace kernel
|
||||
} // namespace mindspore
|
||||
|
||||
|
|
|
|||
|
|
@ -151,5 +151,7 @@ bool ResizeBilinearCpuKernelMod::LaunchKernel(const std::vector<AddressPtr> &inp
|
|||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, ResizeBilinear, ResizeBilinearCpuKernelMod);
|
||||
} // namespace kernel
|
||||
} // namespace mindspore
|
||||
|
|
|
|||
|
|
@ -55,8 +55,6 @@ class ResizeBilinearCpuKernelMod : public NativeCpuKernelMod {
|
|||
std::vector<int64_t> size_;
|
||||
std::vector<size_t> shape_;
|
||||
};
|
||||
|
||||
MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, ResizeBilinear, ResizeBilinearCpuKernelMod);
|
||||
} // namespace kernel
|
||||
} // namespace mindspore
|
||||
#endif // MINDSPORE_CCSRC_BACKEND_KERNEL_COMPILER_CPU_RESIZE_BILINEAR_CPU_KERNEL_H_
|
||||
|
|
|
|||
|
|
@ -163,5 +163,7 @@ bool ResizeBilinearGradCpuKernelMod::LaunchKernel(const std::vector<AddressPtr>
|
|||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
MS_KERNEL_FACTORY_REG(NativeCpuKernelMod, ResizeBilinearGrad, ResizeBilinearGradCpuKernelMod);
|
||||
} // namespace kernel
|
||||
} // namespace mindspore
|
||||
|
|
|
|||
|
|
@ -55,8 +55,6 @@ class ResizeBilinearGradCpuKernelMod : public NativeCpuKernelMod {
|
|||
std::vector<size_t> size_;
|
||||
std::vector<size_t> 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_
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue