提交 22efb06f 编写于 作者: R Ray Liu 提交者: GitHub

Merge pull request #1031 from codeWorm2015/opencl

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