提交 8d2e49d9 编写于 作者: J Jiaying Zhao 提交者: GitHub

Merge pull request #1119 from smilejames/opencl

add PADDLE_MOBILE_CL macro in fetch_op.h
...@@ -24,6 +24,7 @@ namespace operators { ...@@ -24,6 +24,7 @@ namespace operators {
using std::string; using std::string;
template <typename DeviceType, typename T> template <typename DeviceType, typename T>
#ifdef PADDLE_MOBILE_CL
class FetchOp class FetchOp
: public framework::OperatorWithKernel<DeviceType, FetchParam<DeviceType>, : public framework::OperatorWithKernel<DeviceType, FetchParam<DeviceType>,
FetchKernel<DeviceType, T>> { FetchKernel<DeviceType, T>> {
...@@ -34,12 +35,26 @@ class FetchOp ...@@ -34,12 +35,26 @@ class FetchOp
: framework::OperatorWithKernel<DeviceType, FetchParam<DeviceType>, : framework::OperatorWithKernel<DeviceType, FetchParam<DeviceType>,
FetchKernel<DeviceType, T>>( FetchKernel<DeviceType, T>>(
type, inputs, outputs, attrs, scope) {} type, inputs, outputs, attrs, scope) {}
#else
class FetchOp : public framework::OperatorBase<DeviceType> {
public:
FetchOp(const string &type, const VariableNameMap &inputs,
const VariableNameMap &outputs, const framework::AttributeMap attrs,
std::shared_ptr<framework::Scope> scope)
: framework::OperatorBase<DeviceType>(type, inputs, outputs, attrs,
scope),
param_(inputs, outputs, attrs, *scope) {}
void Init() {}
#endif
void InferShape() const override; void InferShape() const override;
void RunImpl() override; void RunImpl() override;
protected: protected:
#ifndef PADDLE_MOBILE_CL
FetchParam<DeviceType> param_;
#endif
}; };
} // namespace operators } // namespace operators
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册