Skip to content

Commit 306d09d

Browse files
authored
[Windows] Fix windows compiling error (#6092)
1 parent e62598b commit 306d09d

File tree

4 files changed

+22
-8
lines changed

4 files changed

+22
-8
lines changed

lite/backends/x86/math/sequence_pooling.cc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -396,9 +396,10 @@ class SequencePoolGradFunctor<TARGET(kX86), T> {
396396
};
397397

398398
template class SequencePoolFunctor<TARGET(kX86), float>;
399-
template class SequencePoolFunctor<TARGET(kX86), double>;
400-
template class SequencePoolGradFunctor<TARGET(kX86), float>;
401-
template class SequencePoolGradFunctor<TARGET(kX86), double>;
399+
// Note: these implementations have not been called yet
400+
// Template class SequencePoolFunctor<TARGET(kX86), double>;
401+
// Template class SequencePoolGradFunctor<TARGET(kX86), float>;
402+
// Template class SequencePoolGradFunctor<TARGET(kX86), double>;
402403

403404
} // namespace math
404405
} // namespace x86

lite/backends/x86/math/softmax.cc

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,12 @@ namespace x86 {
2121
namespace math {
2222

2323
template class SoftmaxFunctor<lite::TargetType::kX86, float, true>;
24-
template class SoftmaxFunctor<lite::TargetType::kX86, float, false>;
25-
template class SoftmaxFunctor<lite::TargetType::kX86, double, true>;
26-
template class SoftmaxFunctor<lite::TargetType::kX86, double, false>;
27-
template class SoftmaxGradFunctor<lite::TargetType::kX86, float>;
28-
template class SoftmaxGradFunctor<lite::TargetType::kX86, double>;
24+
// note: these implemetaions have not been called yet
25+
// template class SoftmaxFunctor<lite::TargetType::kX86, float, false>;
26+
// template class SoftmaxFunctor<lite::TargetType::kX86, double, true>;
27+
// template class SoftmaxFunctor<lite::TargetType::kX86, double, false>;
28+
// template class SoftmaxGradFunctor<lite::TargetType::kX86, float>;
29+
// template class SoftmaxGradFunctor<lite::TargetType::kX86, double>;
2930

3031
} // namespace math
3132
} // namespace x86

lite/kernels/x86/grid_sampler_compute.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,7 @@ void BilinearInter(const X86Context& ctx,
293293

294294
template <class T>
295295
void GridSamplerCompute<T>::Run() {
296+
#ifndef WIN32
296297
auto& param = this->Param<param_t>();
297298
auto& context = ctx_->As<X86Context>();
298299
auto* input = param.x;
@@ -328,6 +329,11 @@ void GridSamplerCompute<T>::Run() {
328329
grid_y_t = grid_y_t.round();
329330
GetGridPointValue<T>(*input, output, grid_x, grid_y);
330331
}
332+
#else
333+
LOG(FATAL) << "Error: This model is not supported on Windows Os yet, because "
334+
"grid_sample op is not supported on windows Paddle-Lite, "
335+
"please update your Paddle-Lite version.";
336+
#endif
331337
}
332338

333339
} // namespace x86

lite/kernels/x86/gru_unit_compute.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ using EigenMatrix = lite::fluid::EigenMatrix<T, MajorType, IndexType>;
2727

2828
template <class T>
2929
void GRUUnitCompute<T>::Run() {
30+
#ifndef WIN32
3031
auto& param = this->Param<param_t>();
3132
auto& context = ctx_->As<X86Context>();
3233
auto* input = param.input;
@@ -121,6 +122,11 @@ void GRUUnitCompute<T>::Run() {
121122
} else {
122123
h.device(place) = u * (c - h_p) + h_p; // u * c + (1 - u) * h_p
123124
}
125+
#else
126+
LOG(FATAL) << "Error: this model is not supported on Windows Os yet, because "
127+
"gru_unit kernel is not supported on Windows Paddle-Lite, "
128+
"please update your Paddle-Lite version.";
129+
#endif
124130
}
125131

126132
} // namespace x86

0 commit comments

Comments
 (0)