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
Feb 22, 2016
by
Marcus Winter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mtapi_opencl_c: fixed race condition in opencl plugin
parent
ed1c83f6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
17 deletions
+26
-17
mtapi_plugins_c/mtapi_opencl_c/src/embb_mtapi_opencl.c
+26
-17
No files found.
mtapi_plugins_c/mtapi_opencl_c/src/embb_mtapi_opencl.c
View file @
e4c059e5
...
@@ -174,31 +174,40 @@ static void opencl_task_start(
...
@@ -174,31 +174,40 @@ static void opencl_task_start(
err
=
clSetKernelArg
(
opencl_action
->
kernel
,
0
,
sizeof
(
cl_mem
),
err
=
clSetKernelArg
(
opencl_action
->
kernel
,
0
,
sizeof
(
cl_mem
),
(
const
void
*
)
&
opencl_task
->
arguments
);
(
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
);
(
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
);
(
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
);
(
const
void
*
)
&
opencl_task
->
result_buffer_size
);
err
=
clEnqueueWriteBuffer
(
plugin
->
command_queue
,
err
|
=
clEnqueueWriteBuffer
(
plugin
->
command_queue
,
opencl_task
->
arguments
,
CL_FALSE
,
0
,
opencl_task
->
arguments
,
CL_FALSE
,
0
,
(
size_t
)
opencl_task
->
arguments_size
,
local_task
->
arguments
,
(
size_t
)
opencl_task
->
arguments_size
,
local_task
->
arguments
,
0
,
NULL
,
NULL
);
0
,
NULL
,
NULL
);
err
=
clEnqueueNDRangeKernel
(
plugin
->
command_queue
,
opencl_action
->
kernel
,
1
,
NULL
,
if
(
CL_SUCCESS
==
err
)
{
&
global_work_size
,
&
opencl_action
->
local_work_size
,
0
,
NULL
,
NULL
);
err
|=
clEnqueueNDRangeKernel
(
plugin
->
command_queue
,
err
=
clEnqueueReadBuffer
(
plugin
->
command_queue
,
opencl_action
->
kernel
,
1
,
NULL
,
opencl_task
->
result_buffer
,
CL_FALSE
,
0
,
&
global_work_size
,
&
opencl_action
->
local_work_size
,
0
,
NULL
,
NULL
);
(
size_t
)
opencl_task
->
result_buffer_size
,
local_task
->
result_buffer
,
err
|=
clEnqueueReadBuffer
(
plugin
->
command_queue
,
0
,
NULL
,
&
opencl_task
->
kernel_finish_event
);
opencl_task
->
result_buffer
,
CL_FALSE
,
0
,
err
=
clSetEventCallback
(
opencl_task
->
kernel_finish_event
,
(
size_t
)
opencl_task
->
result_buffer_size
,
local_task
->
result_buffer
,
CL_COMPLETE
,
opencl_task_complete
,
opencl_task
);
0
,
NULL
,
&
opencl_task
->
kernel_finish_event
);
err
=
clFlush
(
plugin
->
command_queue
);
err
|=
clSetEventCallback
(
opencl_task
->
kernel_finish_event
,
CL_COMPLETE
,
opencl_task_complete
,
opencl_task
);
embb_mtapi_task_set_state
(
local_task
,
MTAPI_TASK_RUNNING
);
local_status
=
MTAPI_SUCCESS
;
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
;
}
}
}
}
}
}
}
...
...
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