Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
4e66d078
Commit
4e66d078
authored
Feb 01, 2019
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #13722 from alalek:ocl_pass_ptr_for_empty_umat
parents
a42bbc97
4501a2cd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
0 deletions
+13
-0
ocl.cpp
modules/core/src/ocl.cpp
+13
-0
No files found.
modules/core/src/ocl.cpp
View file @
4e66d078
...
...
@@ -2998,7 +2998,11 @@ int Kernel::set(int i, const KernelArg& arg)
if
(
!
p
||
!
p
->
handle
)
return
-
1
;
if
(
i
<
0
)
{
CV_LOG_ERROR
(
NULL
,
cv
::
format
(
"OpenCL: Kernel(%s)::set(arg_index=%d): negative arg_index"
,
p
->
name
.
c_str
(),
(
int
)
i
));
return
i
;
}
if
(
i
==
0
)
p
->
cleanupUMats
();
cl_int
status
=
0
;
...
...
@@ -3007,10 +3011,19 @@ int Kernel::set(int i, const KernelArg& arg)
int
accessFlags
=
((
arg
.
flags
&
KernelArg
::
READ_ONLY
)
?
ACCESS_READ
:
0
)
+
((
arg
.
flags
&
KernelArg
::
WRITE_ONLY
)
?
ACCESS_WRITE
:
0
);
bool
ptronly
=
(
arg
.
flags
&
KernelArg
::
PTR_ONLY
)
!=
0
;
if
(
ptronly
&&
arg
.
m
->
empty
())
{
cl_mem
h_null
=
(
cl_mem
)
NULL
;
status
=
clSetKernelArg
(
p
->
handle
,
(
cl_uint
)
i
,
sizeof
(
h_null
),
&
h_null
);
CV_OCL_DBG_CHECK_RESULT
(
status
,
cv
::
format
(
"clSetKernelArg('%s', arg_index=%d, cl_mem=NULL)"
,
p
->
name
.
c_str
(),
(
int
)
i
).
c_str
());
return
i
+
1
;
}
cl_mem
h
=
(
cl_mem
)
arg
.
m
->
handle
(
accessFlags
);
if
(
!
h
)
{
CV_LOG_ERROR
(
NULL
,
cv
::
format
(
"OpenCL: Kernel(%s)::set(arg_index=%d, flags=%d): can't create cl_mem handle for passed UMat buffer (addr=%p)"
,
p
->
name
.
c_str
(),
(
int
)
i
,
(
int
)
arg
.
flags
,
arg
.
m
));
p
->
release
();
p
=
0
;
return
-
1
;
...
...
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