fix undefined issue when with_gpu

del_some_in_makelist
tensor-tang 8 years ago
parent e0c3317646
commit f271210595

@ -277,6 +277,14 @@ void set_constant_with_place<platform::CPUPlace>(
TensorSetConstantCPU(tensor, value));
}
template <>
void set_constant_with_place<platform::MKLDNNPlace>(
const platform::DeviceContext& context, framework::Tensor* tensor,
float value) {
framework::VisitDataType(framework::ToDataType(tensor->type()),
TensorSetConstantCPU(tensor, value));
}
struct TensorSetConstantWithPlace : public boost::static_visitor<void> {
TensorSetConstantWithPlace(const platform::DeviceContext& context,
framework::Tensor* tensor, float value)

@ -31,7 +31,7 @@ struct CPUPlace {
inline bool operator!=(const CPUPlace &) const { return false; }
};
struct MKLDNNPlace : public CPUPlace {
struct MKLDNNPlace {
MKLDNNPlace() {}
// needed for variant equality comparison

Loading…
Cancel
Save