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
d0509f67
Commit
d0509f67
authored
Aug 23, 2017
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #9449 from ribalda:ocv
parents
1fc9425b
6fc56979
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
8 deletions
+24
-8
opencl_core.cpp
modules/core/src/opencl/runtime/opencl_core.cpp
+24
-8
No files found.
modules/core/src/opencl/runtime/opencl_core.cpp
View file @
d0509f67
...
...
@@ -134,6 +134,24 @@ static void* WinGetProcAddress(const char* name)
#include <dlfcn.h>
#include <stdio.h>
static
void
*
GetHandle
(
const
char
*
file
)
{
void
*
handle
;
handle
=
dlopen
(
file
,
RTLD_LAZY
|
RTLD_GLOBAL
);
if
(
!
handle
)
return
NULL
;
if
(
dlsym
(
handle
,
OPENCL_FUNC_TO_CHECK_1_1
)
==
NULL
)
{
fprintf
(
stderr
,
ERROR_MSG_INVALID_VERSION
);
dlclose
(
handle
);
return
NULL
;
}
return
handle
;
}
static
void
*
GetProcAddress
(
const
char
*
name
)
{
static
bool
initialized
=
false
;
...
...
@@ -143,20 +161,18 @@ static void* GetProcAddress(const char* name)
cv
::
AutoLock
lock
(
cv
::
getInitializationMutex
());
if
(
!
initialized
)
{
const
char
*
path
=
"libOpenCL.so"
;
const
char
*
envPath
=
getenv
(
"OPENCV_OPENCL_RUNTIME"
);
if
(
envPath
)
path
=
envPath
;
handle
=
dlopen
(
path
,
RTLD_LAZY
|
RTLD_GLOBAL
);
if
(
handle
==
NULL
)
{
if
(
envPath
)
handle
=
GetHandle
(
envPath
);
if
(
!
handle
)
fprintf
(
stderr
,
ERROR_MSG_CANT_LOAD
);
}
else
if
(
dlsym
(
handle
,
OPENCL_FUNC_TO_CHECK_1_1
)
==
NULL
)
else
{
fprintf
(
stderr
,
ERROR_MSG_INVALID_VERSION
);
handle
=
NULL
;
handle
=
GetHandle
(
"libOpenCL.so"
);
if
(
!
handle
)
handle
=
GetHandle
(
"libOpenCL.so.1"
);
}
initialized
=
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