Skip to content

OpenVINO™ is an open source toolkit for optimizing and deploying AI inference

[CPU][DFT] CPU DFT createPrimitve code refactor (#30308)

Katarzyna Mitrus368e64dac1d0
diff --git a/src/plugins/intel_cpu/src/nodes/dft.cpp b/src/plugins/intel_cpu/src/nodes/dft.cpp
index 42c612a4566..a2a4689e7a4 100644
--- a/src/plugins/intel_cpu/src/nodes/dft.cpp
+++ b/src/plugins/intel_cpu/src/nodes/dft.cpp
@@ -599,25 +599,18 @@ bool DFT::needPrepareParams() const {
}
void DFT::createPrimitive() {
- if (!outputShapesDefined() || !m_is_axes_size_const) {
- if (mayiuse(cpu::x64::sse41)) {
- createJITKernels(true, true);
- }
- return;
- }
-
- bool hasDFT = false;
- bool hasFFT = false;
-
- axes = getAxes();
- const auto outputShape = getChildEdgeAt(0)->getMemory().getStaticDims();
-
- for (auto axis : axes) {
- size_t nComplex = outputShape[axis];
- if (!IsPowerOfTwo(nComplex)) {
- hasDFT = true;
- } else {
- hasFFT = true;
+ bool hasDFT = true;
+ bool hasFFT = true;
+ if (m_is_axes_size_const && outputShapesDefined()) {
+ axes = getAxes();
+ const auto& outputShape = getChildEdgeAt(0)->getMemory().getStaticDims();
+ hasDFT = hasFFT = false;
+ for (auto axis : axes) {
+ if (IsPowerOfTwo(outputShape[axis])) {
+ hasFFT = true;
+ } else {
+ hasDFT = true;
+ }
}
}
if (mayiuse(cpu::x64::sse41)) {