提交 93c23de7 编写于 作者: Y yangfei

add wait_event

上级 73fb37a9
...@@ -78,9 +78,11 @@ void ElementwiseAddKernel<GPU_CL, float>::Compute( ...@@ -78,9 +78,11 @@ void ElementwiseAddKernel<GPU_CL, float>::Compute(
int width = input->ImageWidth(); int width = input->ImageWidth();
int height = input->ImageHeight(); int height = input->ImageHeight();
size_t global_work_size[2] = {width, height}; size_t global_work_size[2] = {width, height};
cl_event out_event = param.Out()->GetClEvent();
cl_event wait_event = param.InputX()->GetClEvent();
status = status =
clEnqueueNDRangeKernel(this->cl_helper_.CLCommandQueue(), kernel, 2, clEnqueueNDRangeKernel(this->cl_helper_.CLCommandQueue(), kernel, 2,
NULL, global_work_size, NULL, 0, NULL, NULL); NULL, global_work_size, NULL, 1,&wait_event, &out_event);
CL_CHECK_ERRORS(status); CL_CHECK_ERRORS(status);
} else { } else {
DLOG << "error:bias dims is error"; DLOG << "error:bias dims is error";
......
...@@ -51,8 +51,11 @@ void FeedKernel<GPU_CL, float>::Compute(const FeedParam<GPU_CL> &param) { ...@@ -51,8 +51,11 @@ void FeedKernel<GPU_CL, float>::Compute(const FeedParam<GPU_CL> &param) {
CL_CHECK_ERRORS(status); CL_CHECK_ERRORS(status);
size_t global_work_size[2] = {width, height}; size_t global_work_size[2] = {width, height};
cl_event out_event = param.Out()->GetClEvent();
status = clEnqueueNDRangeKernel(this->cl_helper_.CLCommandQueue(), kernel, 2, status = clEnqueueNDRangeKernel(this->cl_helper_.CLCommandQueue(), kernel, 2,
NULL, global_work_size, NULL, 0, NULL, NULL); NULL, global_work_size, NULL, 0, NULL, &out_event);
CL_CHECK_ERRORS(status); CL_CHECK_ERRORS(status);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册