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
05e22ee8
Commit
05e22ee8
authored
Nov 26, 2013
by
Roman Donchenko
Committed by
OpenCV Buildbot
Nov 26, 2013
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1859 from SpecLad:string-plus-equals
parents
684ff703
dd817857
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
63 additions
and
30 deletions
+63
-30
cvstd.hpp
modules/core/include/opencv2/core/cvstd.hpp
+26
-0
cvstd.inl.hpp
modules/core/include/opencv2/core/cvstd.inl.hpp
+7
-0
arithm.cpp
modules/ocl/src/arithm.cpp
+2
-2
cl_operations.cpp
modules/ocl/src/cl_operations.cpp
+2
-2
cl_programcache.cpp
modules/ocl/src/cl_programcache.cpp
+3
-3
haar.cpp
modules/ocl/src/haar.cpp
+9
-9
imgproc.cpp
modules/ocl/src/imgproc.cpp
+8
-8
mcwutil.cpp
modules/ocl/src/mcwutil.cpp
+1
-1
split_merge.cpp
modules/ocl/src/split_merge.cpp
+5
-5
No files found.
modules/core/include/opencv2/core/cvstd.hpp
View file @
05e22ee8
...
...
@@ -364,6 +364,10 @@ public:
String
&
operator
=
(
const
char
*
s
);
String
&
operator
=
(
char
c
);
String
&
operator
+=
(
const
String
&
str
);
String
&
operator
+=
(
const
char
*
s
);
String
&
operator
+=
(
char
c
);
size_t
size
()
const
;
size_t
length
()
const
;
...
...
@@ -416,6 +420,7 @@ public:
String
(
const
std
::
string
&
str
);
String
(
const
std
::
string
&
str
,
size_t
pos
,
size_t
len
=
npos
);
String
&
operator
=
(
const
std
::
string
&
str
);
String
&
operator
+=
(
const
std
::
string
&
str
);
operator
std
::
string
()
const
;
friend
String
operator
+
(
const
String
&
lhs
,
const
std
::
string
&
rhs
);
...
...
@@ -544,6 +549,27 @@ String& String::operator=(char c)
return
*
this
;
}
inline
String
&
String
::
operator
+=
(
const
String
&
str
)
{
*
this
=
*
this
+
str
;
return
*
this
;
}
inline
String
&
String
::
operator
+=
(
const
char
*
s
)
{
*
this
=
*
this
+
s
;
return
*
this
;
}
inline
String
&
String
::
operator
+=
(
char
c
)
{
*
this
=
*
this
+
c
;
return
*
this
;
}
inline
size_t
String
::
size
()
const
{
...
...
modules/core/include/opencv2/core/cvstd.inl.hpp
View file @
05e22ee8
...
...
@@ -103,6 +103,13 @@ String& String::operator = (const std::string& str)
return
*
this
;
}
inline
String
&
String
::
operator
+=
(
const
std
::
string
&
str
)
{
*
this
=
*
this
+
str
;
return
*
this
;
}
inline
String
::
operator
std
::
string
()
const
{
...
...
modules/ocl/src/arithm.cpp
View file @
05e22ee8
...
...
@@ -505,7 +505,7 @@ static void arithmetic_minMax_run(const oclMat &src, const oclMat & mask, cl_mem
args
.
push_back
(
std
::
make_pair
(
sizeof
(
cl_int
)
,
(
void
*
)
&
minvalid_cols
));
args
.
push_back
(
std
::
make_pair
(
sizeof
(
cl_int
)
,
(
void
*
)
&
moffset
));
kernelName
=
kernelName
+
"_mask"
;
kernelName
+=
"_mask"
;
}
size_t
globalThreads
[
3
]
=
{
groupnum
*
256
,
1
,
1
};
...
...
@@ -634,7 +634,7 @@ static void arithm_absdiff_nonsaturate_run(const oclMat & src1, const oclMat & s
args
.
push_back
(
std
::
make_pair
(
sizeof
(
cl_int
),
(
void
*
)
&
src2step1
));
args
.
push_back
(
std
::
make_pair
(
sizeof
(
cl_int
),
(
void
*
)
&
src2offset1
));
kernelName
=
kernelName
+
"_binary"
;
kernelName
+=
"_binary"
;
}
args
.
push_back
(
std
::
make_pair
(
sizeof
(
cl_mem
),
(
void
*
)
&
diff
.
data
));
...
...
modules/ocl/src/cl_operations.cpp
View file @
05e22ee8
...
...
@@ -379,7 +379,7 @@ cl_kernel openCLGetKernelFromSource(Context *ctx, const cv::ocl::ProgramEntry* s
idxStr
<<
"_C"
<<
channels
;
if
(
depth
!=
-
1
)
idxStr
<<
"_D"
<<
depth
;
kernelName
=
kernelName
+
idxStr
.
str
();
kernelName
+=
idxStr
.
str
();
std
::
string
fixedOptions
=
removeDuplicatedWhiteSpaces
(
build_options
);
cl_kernel
kernel
=
openCLGetKernelFromSource
(
ctx
,
source
,
kernelName
,
fixedOptions
.
c_str
());
...
...
@@ -497,7 +497,7 @@ void openCLExecuteKernelInterop(Context *ctx, const cv::ocl::ProgramSource& sour
idxStr
<<
"_C"
<<
channels
;
if
(
depth
!=
-
1
)
idxStr
<<
"_D"
<<
depth
;
kernelName
=
kernelName
+
idxStr
.
str
();
kernelName
+=
idxStr
.
str
();
std
::
string
name
=
std
::
string
(
"custom_"
)
+
source
.
name
;
ProgramEntry
program
=
{
name
.
c_str
(),
source
.
programStr
,
source
.
programHash
};
...
...
modules/ocl/src/cl_programcache.cpp
View file @
05e22ee8
...
...
@@ -489,11 +489,11 @@ cl_program ProgramCache::getProgram(const Context *ctx, const cv::ocl::ProgramEn
String
all_build_options
;
if
(
!
ctx
->
getDeviceInfo
().
compilationExtraOptions
.
empty
())
all_build_options
=
all_build_options
+
ctx
->
getDeviceInfo
().
compilationExtraOptions
;
all_build_options
+=
ctx
->
getDeviceInfo
().
compilationExtraOptions
;
if
(
build_options
!=
NULL
)
{
all_build_options
=
all_build_options
+
" "
;
all_build_options
=
all_build_options
+
build_options
;
all_build_options
+=
" "
;
all_build_options
+=
build_options
;
}
const
DeviceInfo
&
devInfo
=
ctx
->
getDeviceInfo
();
String
filename
=
binpath
+
(
source
->
name
?
source
->
name
:
"NULL"
)
+
"_"
+
devInfo
.
platform
->
platformName
+
"_"
+
devInfo
.
deviceName
+
".clb"
;
...
...
modules/ocl/src/haar.cpp
View file @
05e22ee8
...
...
@@ -959,15 +959,15 @@ void OclCascadeClassifier::detectMultiScale(oclMat &gimg, CV_OUT std::vector<cv:
//form build options for kernel
String
options
=
"-D PACKED_CLASSIFIER"
;
options
=
options
+
format
(
" -D NODE_SIZE=%d"
,
NODE_SIZE
);
options
=
options
+
format
(
" -D WND_SIZE_X=%d"
,
cascade
->
orig_window_size
.
width
);
options
=
options
+
format
(
" -D WND_SIZE_Y=%d"
,
cascade
->
orig_window_size
.
height
);
options
=
options
+
format
(
" -D STUMP_BASED=%d"
,
gcascade
->
is_stump_based
);
options
=
options
+
format
(
" -D LSx=%d"
,
localThreads
[
0
]);
options
=
options
+
format
(
" -D LSy=%d"
,
localThreads
[
1
]);
options
=
options
+
format
(
" -D SPLITNODE=%d"
,
splitnode
);
options
=
options
+
format
(
" -D SPLITSTAGE=%d"
,
splitstage
);
options
=
options
+
format
(
" -D OUTPUTSZ=%d"
,
outputsz
);
options
+=
format
(
" -D NODE_SIZE=%d"
,
NODE_SIZE
);
options
+=
format
(
" -D WND_SIZE_X=%d"
,
cascade
->
orig_window_size
.
width
);
options
+=
format
(
" -D WND_SIZE_Y=%d"
,
cascade
->
orig_window_size
.
height
);
options
+=
format
(
" -D STUMP_BASED=%d"
,
gcascade
->
is_stump_based
);
options
+=
format
(
" -D LSx=%d"
,
localThreads
[
0
]);
options
+=
format
(
" -D LSy=%d"
,
localThreads
[
1
]);
options
+=
format
(
" -D SPLITNODE=%d"
,
splitnode
);
options
+=
format
(
" -D SPLITSTAGE=%d"
,
splitstage
);
options
+=
format
(
" -D OUTPUTSZ=%d"
,
outputsz
);
// init candiate global count by 0
int
pattern
=
0
;
...
...
modules/ocl/src/imgproc.cpp
View file @
05e22ee8
...
...
@@ -217,15 +217,15 @@ namespace cv
String
kernelName
=
"remap"
;
if
(
map1
.
type
()
==
CV_32FC2
&&
map2
.
empty
())
kernelName
=
kernelName
+
"_32FC2"
;
kernelName
+=
"_32FC2"
;
else
if
(
map1
.
type
()
==
CV_16SC2
)
{
kernelName
=
kernelName
+
"_16SC2"
;
kernelName
+=
"_16SC2"
;
if
(
!
map2
.
empty
())
kernelName
=
kernelName
+
"_16UC1"
;
kernelName
+=
"_16UC1"
;
}
else
if
(
map1
.
type
()
==
CV_32FC1
&&
map2
.
type
()
==
CV_32FC1
)
kernelName
=
kernelName
+
"_2_32FC1"
;
kernelName
+=
"_2_32FC1"
;
else
CV_Error
(
Error
::
StsBadArg
,
"Unsupported map types"
);
...
...
@@ -916,16 +916,16 @@ namespace cv
switch
(
borderType
)
{
case
cv
:
:
BORDER_REPLICATE
:
option
=
option
+
" -D BORDER_REPLICATE"
;
option
+=
" -D BORDER_REPLICATE"
;
break
;
case
cv
:
:
BORDER_REFLECT
:
option
=
option
+
" -D BORDER_REFLECT"
;
option
+=
" -D BORDER_REFLECT"
;
break
;
case
cv
:
:
BORDER_REFLECT101
:
option
=
option
+
" -D BORDER_REFLECT101"
;
option
+=
" -D BORDER_REFLECT101"
;
break
;
case
cv
:
:
BORDER_WRAP
:
option
=
option
+
" -D BORDER_WRAP"
;
option
+=
" -D BORDER_WRAP"
;
break
;
}
openCLExecuteKernel
(
src
.
clCxt
,
&
imgproc_sobel3
,
"sobel3"
,
gt2
,
lt2
,
args
,
-
1
,
-
1
,
option
.
c_str
()
);
...
...
modules/ocl/src/mcwutil.cpp
View file @
05e22ee8
...
...
@@ -64,7 +64,7 @@ namespace cv
idxStr
<<
"_C"
<<
channels
;
if
(
depth
!=
-
1
)
idxStr
<<
"_D"
<<
depth
;
kernelName
=
kernelName
+
idxStr
.
str
().
c_str
();
kernelName
+=
idxStr
.
str
().
c_str
();
cl_kernel
kernel
;
kernel
=
openCLGetKernelFromSource
(
clCxt
,
source
,
kernelName
,
build_options
);
...
...
modules/ocl/src/split_merge.cpp
View file @
05e22ee8
...
...
@@ -234,13 +234,13 @@ namespace cv
(
int
)
VEC_SIZE
,
depth
,
channels
);
if
(
dst0Aligned
)
build_options
=
build_options
+
" -D DST0_ALIGNED"
;
build_options
+=
" -D DST0_ALIGNED"
;
if
(
dst1Aligned
)
build_options
=
build_options
+
" -D DST1_ALIGNED"
;
build_options
+=
" -D DST1_ALIGNED"
;
if
(
dst2Aligned
)
build_options
=
build_options
+
" -D DST2_ALIGNED"
;
build_options
+=
" -D DST2_ALIGNED"
;
if
(
dst3Aligned
)
build_options
=
build_options
+
" -D DST3_ALIGNED"
;
build_options
+=
" -D DST3_ALIGNED"
;
const
DeviceInfo
&
devInfo
=
clCtx
->
getDeviceInfo
();
...
...
@@ -251,7 +251,7 @@ namespace cv
&&
(
devInfo
.
deviceVersion
.
find
(
"Build 56860"
)
!=
std
::
string
::
npos
||
devInfo
.
deviceVersion
.
find
(
"Build 76921"
)
!=
std
::
string
::
npos
||
devInfo
.
deviceVersion
.
find
(
"Build 78712"
)
!=
std
::
string
::
npos
))
build_options
=
build_options
+
" -D BYPASS_VSTORE=true"
;
build_options
+=
" -D BYPASS_VSTORE=true"
;
size_t
globalThreads
[
3
]
=
{
divUp
(
src
.
cols
,
VEC_SIZE
),
src
.
rows
,
1
};
openCLExecuteKernel
(
clCtx
,
&
split_mat
,
kernelName
,
globalThreads
,
NULL
,
args
,
-
1
,
-
1
,
build_options
.
c_str
());
...
...
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