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
aed69cc4
Commit
aed69cc4
authored
Dec 02, 2013
by
Roman Donchenko
Committed by
OpenCV Buildbot
Dec 02, 2013
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1882 from philippefoubert:branch_ocl_instrumentation
parents
b27d7d2a
ec6f2e1c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
13 deletions
+16
-13
cl_context.cpp
modules/ocl/src/cl_context.cpp
+4
-1
cl_operations.cpp
modules/ocl/src/cl_operations.cpp
+12
-12
No files found.
modules/ocl/src/cl_context.cpp
View file @
aed69cc4
...
...
@@ -658,8 +658,11 @@ void ContextImpl::setContext(const DeviceInfo* deviceInfo)
cl_context_properties
cps
[
3
]
=
{
CL_CONTEXT_PLATFORM
,
(
cl_context_properties
)(
infoImpl
.
platform_id
),
0
};
cl_context
clContext
=
clCreateContext
(
cps
,
1
,
&
infoImpl
.
device_id
,
NULL
,
NULL
,
&
status
);
openCLVerifyCall
(
status
);
// TODO add CL_QUEUE_PROFILING_ENABLE
#ifdef PRINT_KERNEL_RUN_TIME
cl_command_queue
clCmdQueue
=
clCreateCommandQueue
(
clContext
,
infoImpl
.
device_id
,
CL_QUEUE_PROFILING_ENABLE
,
&
status
);
#else
/*PRINT_KERNEL_RUN_TIME*/
cl_command_queue
clCmdQueue
=
clCreateCommandQueue
(
clContext
,
infoImpl
.
device_id
,
0
,
&
status
);
#endif
/*PRINT_KERNEL_RUN_TIME*/
openCLVerifyCall
(
status
);
ContextImpl
*
ctx
=
new
ContextImpl
(
infoImpl
.
info
,
infoImpl
.
device_id
);
...
...
modules/ocl/src/cl_operations.cpp
View file @
aed69cc4
...
...
@@ -459,28 +459,28 @@ void openCLExecuteKernel(Context *ctx, const cv::ocl::ProgramEntry* source, Stri
openCLExecuteKernel_
(
ctx
,
source
,
kernelName
,
globalThreads
,
localThreads
,
args
,
channels
,
depth
,
build_options
);
#else
s
tring
data_type
[]
=
{
"uchar"
,
"char"
,
"ushort"
,
"short"
,
"int"
,
"float"
,
"double"
};
cout
<<
endl
;
cout
<<
"Function Name: "
<<
kernelName
;
S
tring
data_type
[]
=
{
"uchar"
,
"char"
,
"ushort"
,
"short"
,
"int"
,
"float"
,
"double"
};
std
::
cout
<<
std
::
endl
;
std
::
cout
<<
"Function Name: "
<<
kernelName
;
if
(
depth
>=
0
)
cout
<<
" |data type: "
<<
data_type
[
depth
];
cout
<<
" |channels: "
<<
channels
;
cout
<<
" |Time Unit: "
<<
"ms"
<<
endl
;
std
::
cout
<<
" |data type: "
<<
data_type
[
depth
];
std
::
cout
<<
" |channels: "
<<
channels
;
std
::
cout
<<
" |Time Unit: "
<<
"ms"
<<
std
::
endl
;
total_execute_time
=
0
;
total_kernel_time
=
0
;
cout
<<
"-------------------------------------"
<<
endl
;
std
::
cout
<<
"-------------------------------------"
<<
std
::
endl
;
cout
<<
setiosflags
(
ios
::
left
)
<<
setw
(
15
)
<<
"execute time"
;
cout
<<
setiosflags
(
ios
::
left
)
<<
setw
(
15
)
<<
"launch time"
;
cout
<<
setiosflags
(
ios
::
left
)
<<
setw
(
15
)
<<
"kernel time"
<<
endl
;
std
::
cout
<<
std
::
setiosflags
(
std
::
ios
::
left
)
<<
std
::
setw
(
15
)
<<
"execute time"
;
std
::
cout
<<
std
::
setiosflags
(
std
::
ios
::
left
)
<<
std
::
setw
(
15
)
<<
"launch time"
;
std
::
cout
<<
std
::
setiosflags
(
std
::
ios
::
left
)
<<
std
::
setw
(
15
)
<<
"kernel time"
<<
std
::
endl
;
int
i
=
0
;
for
(
i
=
0
;
i
<
RUN_TIMES
;
i
++
)
openCLExecuteKernel_
(
ctx
,
source
,
kernelName
,
globalThreads
,
localThreads
,
args
,
channels
,
depth
,
build_options
);
cout
<<
"average kernel execute time: "
<<
total_execute_time
/
RUN_TIMES
<<
endl
;
// "ms" <<
endl;
cout
<<
"average kernel total time: "
<<
total_kernel_time
/
RUN_TIMES
<<
endl
;
// "ms" <<
endl;
std
::
cout
<<
"average kernel execute time: "
<<
total_execute_time
/
RUN_TIMES
<<
std
::
endl
;
// "ms" << std::
endl;
std
::
cout
<<
"average kernel total time: "
<<
total_kernel_time
/
RUN_TIMES
<<
std
::
endl
;
// "ms" << std::
endl;
#endif
}
...
...
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