Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
FORMUS3IC_LAS3
/
embb
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
e4c059e5
authored
9 years ago
by
Marcus Winter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mtapi_opencl_c: fixed race condition in opencl plugin
parent
ed1c83f6
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
8 deletions
+17
-8
mtapi_plugins_c/mtapi_opencl_c/src/embb_mtapi_opencl.c
+17
-8
No files found.
mtapi_plugins_c/mtapi_opencl_c/src/embb_mtapi_opencl.c
View file @
e4c059e5
...
...
@@ -174,34 +174,43 @@ static void opencl_task_start(
err
=
clSetKernelArg
(
opencl_action
->
kernel
,
0
,
sizeof
(
cl_mem
),
(
const
void
*
)
&
opencl_task
->
arguments
);
err
=
clSetKernelArg
(
opencl_action
->
kernel
,
1
,
sizeof
(
cl_int
),
err
|
=
clSetKernelArg
(
opencl_action
->
kernel
,
1
,
sizeof
(
cl_int
),
(
const
void
*
)
&
opencl_task
->
arguments_size
);
err
=
clSetKernelArg
(
opencl_action
->
kernel
,
2
,
sizeof
(
cl_mem
),
err
|
=
clSetKernelArg
(
opencl_action
->
kernel
,
2
,
sizeof
(
cl_mem
),
(
const
void
*
)
&
opencl_task
->
result_buffer
);
err
=
clSetKernelArg
(
opencl_action
->
kernel
,
3
,
sizeof
(
cl_int
),
err
|
=
clSetKernelArg
(
opencl_action
->
kernel
,
3
,
sizeof
(
cl_int
),
(
const
void
*
)
&
opencl_task
->
result_buffer_size
);
err
=
clEnqueueWriteBuffer
(
plugin
->
command_queue
,
err
|
=
clEnqueueWriteBuffer
(
plugin
->
command_queue
,
opencl_task
->
arguments
,
CL_FALSE
,
0
,
(
size_t
)
opencl_task
->
arguments_size
,
local_task
->
arguments
,
0
,
NULL
,
NULL
);
err
=
clEnqueueNDRangeKernel
(
plugin
->
command_queue
,
if
(
CL_SUCCESS
==
err
)
{
err
|=
clEnqueueNDRangeKernel
(
plugin
->
command_queue
,
opencl_action
->
kernel
,
1
,
NULL
,
&
global_work_size
,
&
opencl_action
->
local_work_size
,
0
,
NULL
,
NULL
);
err
=
clEnqueueReadBuffer
(
plugin
->
command_queue
,
err
|
=
clEnqueueReadBuffer
(
plugin
->
command_queue
,
opencl_task
->
result_buffer
,
CL_FALSE
,
0
,
(
size_t
)
opencl_task
->
result_buffer_size
,
local_task
->
result_buffer
,
0
,
NULL
,
&
opencl_task
->
kernel_finish_event
);
err
=
clSetEventCallback
(
opencl_task
->
kernel_finish_event
,
err
|
=
clSetEventCallback
(
opencl_task
->
kernel_finish_event
,
CL_COMPLETE
,
opencl_task_complete
,
opencl_task
);
err
=
clFlush
(
plugin
->
command_queue
);
embb_mtapi_task_set_state
(
local_task
,
MTAPI_TASK_RUNNING
);
}
err
|=
clFlush
(
plugin
->
command_queue
);
if
(
CL_SUCCESS
!=
err
)
{
embb_mtapi_task_set_state
(
local_task
,
MTAPI_TASK_ERROR
);
local_status
=
MTAPI_ERR_ACTION_FAILED
;
}
else
{
local_status
=
MTAPI_SUCCESS
;
}
}
}
}
mtapi_status_set
(
status
,
local_status
);
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment