提交 a75030e0 编写于 作者: Y Yanzhan Yang 提交者: GitHub

add assign_value op for gpu test=develop (#2053)

上级 b91850b9
......@@ -354,7 +354,7 @@ LOAD_OP1(pad2d, CPU);
LOAD_OP1(one_hot, CPU);
#endif
#ifdef ASSIGN_VALUE_OP
LOAD_OP1(assign_value, CPU);
LOAD_OP2(assign_value, CPU, GPU_CL);
#endif
#ifdef EXP_OP
LOAD_OP1(exp, CPU);
......
......@@ -34,4 +34,8 @@ namespace ops = paddle_mobile::operators;
REGISTER_OPERATOR_CPU(assign_value, ops::AssignValueOp);
#endif
#ifdef PADDLE_MOBILE_CL
REGISTER_OPERATOR_CL(assign_value, ops::AssignValueOp);
#endif
#endif // ASSIGN_VALUE_OP
......@@ -67,6 +67,20 @@ void AssignValueKernel<CPU, float>::Compute(
param.int32_values_));
}
template <>
bool AssignValueKernel<GPU_CL, float>::Init(AssignValueParam<GPU_CL>* param) {
return true;
}
template <>
void AssignValueKernel<GPU_CL, float>::Compute(
const AssignValueParam<GPU_CL>& param) {
framework::VisitDataType(
framework::ToDataType(param.dtype_),
AssignValueOpFunctor(param.output_, param.shape_, param.fp32_values_,
param.int32_values_));
}
} // namespace operators
} // namespace paddle_mobile
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册