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
9be727b1
Commit
9be727b1
authored
Dec 01, 2013
by
Vadim Pisarevsky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
another attempt to fix Core_UMat.getUMat test
parent
f263fe14
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
ocl.cpp
modules/core/src/ocl.cpp
+9
-2
No files found.
modules/core/src/ocl.cpp
View file @
9be727b1
...
@@ -2043,6 +2043,7 @@ struct Kernel::Impl
...
@@ -2043,6 +2043,7 @@ struct Kernel::Impl
clCreateKernel
(
ph
,
kname
,
&
retval
)
:
0
;
clCreateKernel
(
ph
,
kname
,
&
retval
)
:
0
;
for
(
int
i
=
0
;
i
<
MAX_ARRS
;
i
++
)
for
(
int
i
=
0
;
i
<
MAX_ARRS
;
i
++
)
u
[
i
]
=
0
;
u
[
i
]
=
0
;
haveTempDstUMats
=
false
;
}
}
void
cleanupUMats
()
void
cleanupUMats
()
...
@@ -2055,14 +2056,17 @@ struct Kernel::Impl
...
@@ -2055,14 +2056,17 @@ struct Kernel::Impl
u
[
i
]
=
0
;
u
[
i
]
=
0
;
}
}
nu
=
0
;
nu
=
0
;
haveTempDstUMats
=
false
;
}
}
void
addUMat
(
const
UMat
&
m
)
void
addUMat
(
const
UMat
&
m
,
bool
dst
)
{
{
CV_Assert
(
nu
<
MAX_ARRS
&&
m
.
u
&&
m
.
u
->
urefcount
>
0
);
CV_Assert
(
nu
<
MAX_ARRS
&&
m
.
u
&&
m
.
u
->
urefcount
>
0
);
u
[
nu
]
=
m
.
u
;
u
[
nu
]
=
m
.
u
;
CV_XADD
(
&
m
.
u
->
urefcount
,
1
);
CV_XADD
(
&
m
.
u
->
urefcount
,
1
);
nu
++
;
nu
++
;
if
(
dst
&&
m
.
u
->
tempUMat
())
haveTempDstUMats
=
true
;
}
}
void
finit
()
void
finit
()
...
@@ -2085,6 +2089,7 @@ struct Kernel::Impl
...
@@ -2085,6 +2089,7 @@ struct Kernel::Impl
enum
{
MAX_ARRS
=
16
};
enum
{
MAX_ARRS
=
16
};
UMatData
*
u
[
MAX_ARRS
];
UMatData
*
u
[
MAX_ARRS
];
int
nu
;
int
nu
;
bool
haveTempDstUMats
;
};
};
}}
}}
...
@@ -2243,7 +2248,7 @@ int Kernel::set(int i, const KernelArg& arg)
...
@@ -2243,7 +2248,7 @@ int Kernel::set(int i, const KernelArg& arg)
i
+=
3
;
i
+=
3
;
}
}
}
}
p
->
addUMat
(
*
arg
.
m
);
p
->
addUMat
(
*
arg
.
m
,
(
accessFlags
&
ACCESS_WRITE
)
!=
0
);
return
i
;
return
i
;
}
}
clSetKernelArg
(
p
->
handle
,
(
cl_uint
)
i
,
arg
.
sz
,
arg
.
obj
);
clSetKernelArg
(
p
->
handle
,
(
cl_uint
)
i
,
arg
.
sz
,
arg
.
obj
);
...
@@ -2271,6 +2276,8 @@ bool Kernel::run(int dims, size_t _globalsize[], size_t _localsize[],
...
@@ -2271,6 +2276,8 @@ bool Kernel::run(int dims, size_t _globalsize[], size_t _localsize[],
}
}
if
(
total
==
0
)
if
(
total
==
0
)
return
true
;
return
true
;
if
(
p
->
haveTempDstUMats
)
sync
=
true
;
cl_int
retval
=
clEnqueueNDRangeKernel
(
qq
,
p
->
handle
,
(
cl_uint
)
dims
,
cl_int
retval
=
clEnqueueNDRangeKernel
(
qq
,
p
->
handle
,
(
cl_uint
)
dims
,
offset
,
globalsize
,
_localsize
,
0
,
0
,
offset
,
globalsize
,
_localsize
,
0
,
0
,
sync
?
0
:
&
p
->
e
);
sync
?
0
:
&
p
->
e
);
...
...
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