提交 e4dabf84 编写于 作者: L liuruilong

update cl image

上级 ae4beda3
...@@ -32,8 +32,13 @@ class CLImage { ...@@ -32,8 +32,13 @@ class CLImage {
} }
const DDim &TensorDim() { inline CLImage &Resize(const DDim &dims) {
return tensorDims_; tensorDims_ = dims;
return *this;
}
const DDim &dims() const {
return DDim();
} }
std::vector<size_t> DefaultWorkSize() { std::vector<size_t> DefaultWorkSize() {
......
...@@ -122,6 +122,9 @@ class OpRegistry { ...@@ -122,6 +122,9 @@ class OpRegistry {
#define REGISTER_OPERATOR_FPGA(op_type, op_class) \ #define REGISTER_OPERATOR_FPGA(op_type, op_class) \
REGISTER_OPERATOR(op_type, op_class, fpga, paddle_mobile::FPGA); REGISTER_OPERATOR(op_type, op_class, fpga, paddle_mobile::FPGA);
#define REGISTER_OPERATOR_CL(op_type, op_class) \
REGISTER_OPERATOR(op_type, op_class, cl, paddle_mobile::GPU_CL);
#define USE_OP(op_type, device_name) \ #define USE_OP(op_type, device_name) \
extern int TouchOpRegistrar_##op_type##_##device_name(); \ extern int TouchOpRegistrar_##op_type##_##device_name(); \
static int use_op_itself_##op_type##_##device_name __attribute__((unused)) = \ static int use_op_itself_##op_type##_##device_name __attribute__((unused)) = \
...@@ -133,5 +136,7 @@ class OpRegistry { ...@@ -133,5 +136,7 @@ class OpRegistry {
#define USE_OP_FPGA(op_type) USE_OP(op_type, fpga); #define USE_OP_FPGA(op_type) USE_OP(op_type, fpga);
#define USE_OP_CL(op_type) USE_OP(op_type, cl);
} // namespace framework } // namespace framework
} // namespace paddle_mobile } // namespace paddle_mobile
...@@ -62,4 +62,8 @@ REGISTER_OPERATOR_MALI_GPU(conv2d, ops::ConvOp); ...@@ -62,4 +62,8 @@ REGISTER_OPERATOR_MALI_GPU(conv2d, ops::ConvOp);
REGISTER_OPERATOR_FPGA(conv2d, ops::ConvOp); REGISTER_OPERATOR_FPGA(conv2d, ops::ConvOp);
#endif #endif
#ifdef PADDLE_MOBILE_CL
REGISTER_OPERATOR_CL(conv2d, ops::ConvOp);
#endif
#endif #endif
...@@ -45,11 +45,17 @@ class ConvOp : public framework::OperatorWithKernel< ...@@ -45,11 +45,17 @@ class ConvOp : public framework::OperatorWithKernel<
#ifdef PADDLE_MOBILE_CPU #ifdef PADDLE_MOBILE_CPU
USE_OP_CPU(conv2d); USE_OP_CPU(conv2d);
#endif #endif
#ifdef PADDLE_MOBILE_MALI_GPU #ifdef PADDLE_MOBILE_MALI_GPU
USE_OP_MALI_GPU(conv2d); USE_OP_MALI_GPU(conv2d);
#endif #endif
#ifdef PADDLE_MOBILE_FPGA #ifdef PADDLE_MOBILE_FPGA
USE_OP_FPGA(conv2d); USE_OP_FPGA(conv2d);
#endif #endif
#ifdef PADDLE_MOBILE_CL
USE_OP_CL(conv2d);
#endif
#endif #endif
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册