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
650609aa
Commit
650609aa
authored
Feb 04, 2013
by
Andrey Kamaev
Committed by
OpenCV Buildbot
Feb 04, 2013
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #429 from bitwangyaoyao:2.4_setdevEx
parents
6dc3b662
a639a1ae
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
9 deletions
+17
-9
ocl.hpp
modules/ocl/include/opencv2/ocl/ocl.hpp
+11
-5
initialization.cpp
modules/ocl/src/initialization.cpp
+0
-0
precomp.hpp
modules/ocl/src/precomp.hpp
+5
-3
pyrlk.cpp
modules/ocl/src/pyrlk.cpp
+1
-1
No files found.
modules/ocl/include/opencv2/ocl/ocl.hpp
View file @
650609aa
...
@@ -84,20 +84,26 @@ namespace cv
...
@@ -84,20 +84,26 @@ namespace cv
//this function may be obsoleted
//this function may be obsoleted
//CV_EXPORTS cl_device_id getDevice();
//CV_EXPORTS cl_device_id getDevice();
//the function must be called before any other cv::ocl::functions, it initialize ocl runtime
//the function must be called before any other cv::ocl::functions, it initialize ocl runtime
//each Info relates to an OpenCL platform
//there is one or more devices in each platform, each one has a separate name
CV_EXPORTS
int
getDevice
(
std
::
vector
<
Info
>
&
oclinfo
,
int
devicetype
=
CVCL_DEVICE_TYPE_GPU
);
CV_EXPORTS
int
getDevice
(
std
::
vector
<
Info
>
&
oclinfo
,
int
devicetype
=
CVCL_DEVICE_TYPE_GPU
);
//set device you want to use, optional function after getDevice be called
//set device you want to use, optional function after getDevice be called
//the devnum is the index of the selected device in DeviceName vector of INfo
CV_EXPORTS
void
setDevice
(
Info
&
oclinfo
,
int
devnum
=
0
);
CV_EXPORTS
void
setDevice
(
Info
&
oclinfo
,
int
devnum
=
0
);
//this function is not ready yet
//CV_EXPORTS void getComputeCapability(cl_device_id device, int &major, int &minor);
//optional function, if you want save opencl binary kernel to the file, set its path
//optional function, if you want save opencl binary kernel to the file, set its path
CV_EXPORTS
void
setBinpath
(
const
char
*
path
);
CV_EXPORTS
void
setBinpath
(
const
char
*
path
);
//The two functions below are used to get opencl runtime so that opencv can interactive with
//other opencl program
//The two functions below enable other opencl program to use ocl module's cl_context and cl_command_queue
CV_EXPORTS
void
*
getoclContext
();
CV_EXPORTS
void
*
getoclContext
();
CV_EXPORTS
void
*
getoclCommandQueue
();
CV_EXPORTS
void
*
getoclCommandQueue
();
//this function enable ocl module to use customized cl_context and cl_command_queue
//getDevice also need to be called before this function
CV_EXPORTS
void
setDeviceEx
(
Info
&
oclinfo
,
void
*
ctx
,
void
*
qu
,
int
devnum
=
0
);
//////////////////////////////// Error handling ////////////////////////
//////////////////////////////// Error handling ////////////////////////
CV_EXPORTS
void
error
(
const
char
*
error_string
,
const
char
*
file
,
const
int
line
,
const
char
*
func
);
CV_EXPORTS
void
error
(
const
char
*
error_string
,
const
char
*
file
,
const
int
line
,
const
char
*
func
);
...
...
modules/ocl/src/initialization.cpp
View file @
650609aa
This diff is collapsed.
Click to expand it.
modules/ocl/src/precomp.hpp
View file @
650609aa
...
@@ -12,10 +12,12 @@
...
@@ -12,10 +12,12 @@
//
//
// Copyright (C) 2010-2012, Institute Of Software Chinese Academy Of Science, all rights reserved.
// Copyright (C) 2010-2012, Institute Of Software Chinese Academy Of Science, all rights reserved.
// Copyright (C) 2010-2012, Advanced Micro Devices, Inc., all rights reserved.
// Copyright (C) 2010-2012, Advanced Micro Devices, Inc., all rights reserved.
// Copyright (C) 2010-2012, Multicoreware, Inc., all rights reserved.
// Third party copyrights are property of their respective owners.
// Third party copyrights are property of their respective owners.
//
//
// @Authors
// @Authors
// Guoping Long, longguoping@gmail.com
// Guoping Long, longguoping@gmail.com
// Yao Wang, bitwangyaoyao@gmail.com
//
//
// Redistribution and use in source and binary forms, with or without modification,
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
// are permitted provided that the following conditions are met:
...
@@ -131,15 +133,15 @@ namespace cv
...
@@ -131,15 +133,15 @@ namespace cv
//Information of the OpenCL context
//Information of the OpenCL context
cl_context
clContext
;
cl_context
clContext
;
cl_command_queue
clCmdQueue
;
cl_command_queue
clCmdQueue
;
cl_device_id
*
devices
;
cl_device_id
devices
;
string
devName
;
string
devName
;
cl_uint
maxDimensions
;
cl_uint
maxDimensions
;
size_t
maxWorkGroupSize
;
size_t
maxWorkGroupSize
;
size_t
*
maxWorkItemSizes
;
size_t
maxWorkItemSizes
[
4
]
;
cl_uint
maxComputeUnits
;
cl_uint
maxComputeUnits
;
int
double_support
;
int
double_support
;
//extra options to recognize vendor specific fp64 extensions
//extra options to recognize vendor specific fp64 extensions
char
*
extra_options
;
char
extra_options
[
512
]
;
string
Binpath
;
string
Binpath
;
};
};
}
}
...
...
modules/ocl/src/pyrlk.cpp
View file @
650609aa
...
@@ -742,7 +742,7 @@ static void lkSparse_run(oclMat &I, oclMat &J,
...
@@ -742,7 +742,7 @@ static void lkSparse_run(oclMat &I, oclMat &J,
Context
*
clCxt
=
I
.
clCxt
;
Context
*
clCxt
=
I
.
clCxt
;
char
platform
[
256
]
=
{
0
};
char
platform
[
256
]
=
{
0
};
cl_platform_id
pid
;
cl_platform_id
pid
;
clGetDeviceInfo
(
*
clCxt
->
impl
->
devices
,
CL_DEVICE_PLATFORM
,
sizeof
(
pid
),
&
pid
,
NULL
);
clGetDeviceInfo
(
clCxt
->
impl
->
devices
,
CL_DEVICE_PLATFORM
,
sizeof
(
pid
),
&
pid
,
NULL
);
clGetPlatformInfo
(
pid
,
CL_PLATFORM_NAME
,
256
,
platform
,
NULL
);
clGetPlatformInfo
(
pid
,
CL_PLATFORM_NAME
,
256
,
platform
,
NULL
);
std
::
string
namestr
=
platform
;
std
::
string
namestr
=
platform
;
bool
isImageSupported
=
true
;
bool
isImageSupported
=
true
;
...
...
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