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
b7f1edcc
Commit
b7f1edcc
authored
Oct 11, 2013
by
Andrey Pavlenko
Committed by
OpenCV Buildbot
Oct 11, 2013
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1595 from alalek:cl_code_cleanup
parents
dfbd5021
238550cd
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
28 additions
and
59 deletions
+28
-59
ocl.hpp
modules/ocl/include/opencv2/ocl/ocl.hpp
+9
-21
opencl_utils.hpp
modules/ocl/include/opencv2/ocl/private/opencl_utils.hpp
+7
-3
cl_context.cpp
modules/ocl/src/cl_context.cpp
+4
-1
cl_programcache.cpp
modules/ocl/src/cl_programcache.cpp
+3
-8
mcwutil.cpp
modules/ocl/src/mcwutil.cpp
+0
-26
svm.cpp
modules/ocl/src/svm.cpp
+5
-0
No files found.
modules/ocl/include/opencv2/ocl/ocl.hpp
View file @
b7f1edcc
...
@@ -83,15 +83,6 @@ namespace cv
...
@@ -83,15 +83,6 @@ namespace cv
DEVICE_MEM_PM
//persistent memory
DEVICE_MEM_PM
//persistent memory
};
};
//Get the global device memory and read/write type
//return 1 if unified memory system supported, otherwise return 0
CV_EXPORTS
int
getDevMemType
(
DevMemRW
&
rw_type
,
DevMemType
&
mem_type
);
//Set the global device memory and read/write type,
//the newly generated oclMat will all use this type
//return -1 if the target type is unsupported, otherwise return 0
CV_EXPORTS
int
setDevMemType
(
DevMemRW
rw_type
=
DEVICE_MEM_R_W
,
DevMemType
mem_type
=
DEVICE_MEM_DEFAULT
);
// these classes contain OpenCL runtime information
// these classes contain OpenCL runtime information
struct
PlatformInfo
;
struct
PlatformInfo
;
...
@@ -113,6 +104,7 @@ namespace cv
...
@@ -113,6 +104,7 @@ namespace cv
std
::
vector
<
size_t
>
maxWorkItemSizes
;
std
::
vector
<
size_t
>
maxWorkItemSizes
;
int
maxComputeUnits
;
int
maxComputeUnits
;
size_t
localMemorySize
;
size_t
localMemorySize
;
size_t
maxMemAllocSize
;
int
deviceVersionMajor
;
int
deviceVersionMajor
;
int
deviceVersionMinor
;
int
deviceVersionMinor
;
...
@@ -199,23 +191,19 @@ namespace cv
...
@@ -199,23 +191,19 @@ namespace cv
void
CV_EXPORTS
finish
();
void
CV_EXPORTS
finish
();
enum
BINARY_CACHE_MODE
{
CACHE_NONE
=
0
,
// do not cache OpenCL binary
CACHE_DEBUG
=
0x1
<<
0
,
// cache OpenCL binary when built in debug mode
CACHE_RELEASE
=
0x1
<<
1
,
// default behavior, only cache when built in release mode
CACHE_ALL
=
CACHE_DEBUG
|
CACHE_RELEASE
,
// cache opencl binary
};
//! Enable or disable OpenCL program binary caching onto local disk
//! Enable or disable OpenCL program binary caching onto local disk
// After a program (*.cl files in opencl/ folder) is built at runtime, we allow the
// After a program (*.cl files in opencl/ folder) is built at runtime, we allow the
// compiled OpenCL program to be cached to the path automatically as "path/*.clb"
// compiled OpenCL program to be cached to the path automatically as "path/*.clb"
// binary file, which will be reused when the OpenCV executable is started again.
// binary file, which will be reused when the OpenCV executable is started again.
//
//
// Caching mode is controlled by the following enums
// This feature is enabled by default.
// Notes
// 1. the feature is by default enabled when OpenCV is built in release mode.
// 2. the CACHE_DEBUG / CACHE_RELEASE flags only effectively work with MSVC compiler;
// for GNU compilers, the function always treats the build as release mode (enabled by default).
enum
{
CACHE_NONE
=
0
,
// do not cache OpenCL binary
CACHE_DEBUG
=
0x1
<<
0
,
// cache OpenCL binary when built in debug mode (only work with MSVC)
CACHE_RELEASE
=
0x1
<<
1
,
// default behavior, only cache when built in release mode (only work with MSVC)
CACHE_ALL
=
CACHE_DEBUG
|
CACHE_RELEASE
,
// always cache opencl binary
};
CV_EXPORTS
void
setBinaryDiskCache
(
int
mode
=
CACHE_RELEASE
,
cv
::
String
path
=
"./"
);
CV_EXPORTS
void
setBinaryDiskCache
(
int
mode
=
CACHE_RELEASE
,
cv
::
String
path
=
"./"
);
//! set where binary cache to be saved to
//! set where binary cache to be saved to
...
...
modules/ocl/include/opencv2/ocl/private/opencl_utils.hpp
View file @
b7f1edcc
...
@@ -98,9 +98,13 @@ inline cl_int getStringInfo(Functor f, ObjectType obj, cl_uint name, std::string
...
@@ -98,9 +98,13 @@ inline cl_int getStringInfo(Functor f, ObjectType obj, cl_uint name, std::string
return
err
;
return
err
;
param
.
resize
(
required
);
param
.
resize
(
required
);
err
=
f
(
obj
,
name
,
required
,
&
param
.
at
(
0
),
NULL
);
if
(
required
>
0
)
if
(
err
!=
CL_SUCCESS
)
{
return
err
;
err
=
f
(
obj
,
name
,
required
,
&
param
.
at
(
0
),
NULL
);
if
(
err
!=
CL_SUCCESS
)
return
err
;
param
.
resize
(
required
-
1
);
// last symbol is '\0'
}
return
CL_SUCCESS
;
return
CL_SUCCESS
;
};
};
...
...
modules/ocl/src/cl_context.cpp
View file @
b7f1edcc
...
@@ -412,6 +412,9 @@ static int initializeOpenCLDevices()
...
@@ -412,6 +412,9 @@ static int initializeOpenCLDevices()
openCLSafeCall
(
getScalarInfo
(
clGetDeviceInfo
,
device
,
CL_DEVICE_LOCAL_MEM_SIZE
,
localMemorySize
));
openCLSafeCall
(
getScalarInfo
(
clGetDeviceInfo
,
device
,
CL_DEVICE_LOCAL_MEM_SIZE
,
localMemorySize
));
deviceInfo
.
info
.
localMemorySize
=
(
size_t
)
localMemorySize
;
deviceInfo
.
info
.
localMemorySize
=
(
size_t
)
localMemorySize
;
cl_ulong
maxMemAllocSize
=
0
;
openCLSafeCall
(
getScalarInfo
(
clGetDeviceInfo
,
device
,
CL_DEVICE_MAX_MEM_ALLOC_SIZE
,
maxMemAllocSize
));
deviceInfo
.
info
.
maxMemAllocSize
=
(
size_t
)
maxMemAllocSize
;
cl_bool
unifiedMemory
=
false
;
cl_bool
unifiedMemory
=
false
;
openCLSafeCall
(
getScalarInfo
(
clGetDeviceInfo
,
device
,
CL_DEVICE_HOST_UNIFIED_MEMORY
,
unifiedMemory
));
openCLSafeCall
(
getScalarInfo
(
clGetDeviceInfo
,
device
,
CL_DEVICE_HOST_UNIFIED_MEMORY
,
unifiedMemory
));
...
@@ -452,7 +455,7 @@ static int initializeOpenCLDevices()
...
@@ -452,7 +455,7 @@ static int initializeOpenCLDevices()
DeviceInfo
::
DeviceInfo
()
DeviceInfo
::
DeviceInfo
()
:
_id
(
-
1
),
deviceType
(
DeviceType
(
0
)),
:
_id
(
-
1
),
deviceType
(
DeviceType
(
0
)),
deviceVendorId
(
-
1
),
deviceVendorId
(
-
1
),
maxWorkGroupSize
(
0
),
maxComputeUnits
(
0
),
localMemorySize
(
0
),
maxWorkGroupSize
(
0
),
maxComputeUnits
(
0
),
localMemorySize
(
0
),
maxMemAllocSize
(
0
),
deviceVersionMajor
(
0
),
deviceVersionMinor
(
0
),
deviceVersionMajor
(
0
),
deviceVersionMinor
(
0
),
haveDoubleSupport
(
false
),
isUnifiedMemory
(
false
),
haveDoubleSupport
(
false
),
isUnifiedMemory
(
false
),
platform
(
NULL
)
platform
(
NULL
)
...
...
modules/ocl/src/cl_programcache.cpp
View file @
b7f1edcc
...
@@ -110,17 +110,12 @@ void ProgramCache::releaseProgram()
...
@@ -110,17 +110,12 @@ void ProgramCache::releaseProgram()
cacheSize
=
0
;
cacheSize
=
0
;
}
}
static
int
enable_disk_cache
=
true
||
static
bool
enable_disk_cache
=
true
;
#ifdef _DEBUG
false
;
#else
true
;
#endif
static
String
binpath
=
""
;
static
String
binpath
=
""
;
void
setBinaryDiskCache
(
int
mode
,
String
path
)
void
setBinaryDiskCache
(
int
mode
,
String
path
)
{
{
enable_disk_cache
=
0
;
enable_disk_cache
=
false
;
binpath
=
""
;
binpath
=
""
;
if
(
mode
==
CACHE_NONE
)
if
(
mode
==
CACHE_NONE
)
...
@@ -128,7 +123,7 @@ void setBinaryDiskCache(int mode, String path)
...
@@ -128,7 +123,7 @@ void setBinaryDiskCache(int mode, String path)
return
;
return
;
}
}
enable_disk_cache
=
enable_disk_cache
=
#if
def _DEBUG
#if
defined(_DEBUG) || defined(DEBUG)
(
mode
&
CACHE_DEBUG
)
==
CACHE_DEBUG
;
(
mode
&
CACHE_DEBUG
)
==
CACHE_DEBUG
;
#else
#else
(
mode
&
CACHE_RELEASE
)
==
CACHE_RELEASE
;
(
mode
&
CACHE_RELEASE
)
==
CACHE_RELEASE
;
...
...
modules/ocl/src/mcwutil.cpp
View file @
b7f1edcc
...
@@ -45,26 +45,6 @@
...
@@ -45,26 +45,6 @@
#include "precomp.hpp"
#include "precomp.hpp"
#ifdef __GNUC__
#if ((__GNUC__ * 100) + __GNUC_MINOR__) >= 402
#define GCC_DIAG_STR(s) #s
#define GCC_DIAG_JOINSTR(x,y) GCC_DIAG_STR(x ## y)
# define GCC_DIAG_DO_PRAGMA(x) _Pragma (#x)
# define GCC_DIAG_PRAGMA(x) GCC_DIAG_DO_PRAGMA(GCC diagnostic x)
# if ((__GNUC__ * 100) + __GNUC_MINOR__) >= 406
# define GCC_DIAG_OFF(x) GCC_DIAG_PRAGMA(push) \
GCC_DIAG_PRAGMA(ignored GCC_DIAG_JOINSTR(-W,x))
# define GCC_DIAG_ON(x) GCC_DIAG_PRAGMA(pop)
# else
# define GCC_DIAG_OFF(x) GCC_DIAG_PRAGMA(ignored GCC_DIAG_JOINSTR(-W,x))
# define GCC_DIAG_ON(x) GCC_DIAG_PRAGMA(warning GCC_DIAG_JOINSTR(-W,x))
# endif
#else
# define GCC_DIAG_OFF(x)
# define GCC_DIAG_ON(x)
#endif
#endif
/* __GNUC__ */
using
namespace
std
;
using
namespace
std
;
namespace
cv
namespace
cv
...
@@ -134,9 +114,6 @@ namespace cv
...
@@ -134,9 +114,6 @@ namespace cv
build_options
,
finish_mode
);
build_options
,
finish_mode
);
}
}
#ifdef __GNUC__
GCC_DIAG_OFF
(
deprecated
-
declarations
)
#endif
cl_mem
bindTexture
(
const
oclMat
&
mat
)
cl_mem
bindTexture
(
const
oclMat
&
mat
)
{
{
cl_mem
texture
;
cl_mem
texture
;
...
@@ -234,9 +211,6 @@ namespace cv
...
@@ -234,9 +211,6 @@ namespace cv
openCLSafeCall
(
err
);
openCLSafeCall
(
err
);
return
texture
;
return
texture
;
}
}
#ifdef __GNUC__
GCC_DIAG_ON
(
deprecated
-
declarations
)
#endif
Ptr
<
TextureCL
>
bindTexturePtr
(
const
oclMat
&
mat
)
Ptr
<
TextureCL
>
bindTexturePtr
(
const
oclMat
&
mat
)
{
{
...
...
modules/ocl/src/svm.cpp
View file @
b7f1edcc
...
@@ -45,6 +45,11 @@
...
@@ -45,6 +45,11 @@
#include "precomp.hpp"
#include "precomp.hpp"
#include "opencl_kernels.hpp"
#include "opencl_kernels.hpp"
// TODO Remove this after HAVE_CLAMDBLAS eliminating
#ifdef __GNUC__
# pragma GCC diagnostic ignored "-Wunused-but-set-variable"
#endif
using
namespace
cv
;
using
namespace
cv
;
using
namespace
ocl
;
using
namespace
ocl
;
...
...
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