projects
/
platform
/
upstream
/
opencv.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f584c6d
)
Merge pull request #18386 from JulienMaille:patch-1
author
Julien
<182520+JulienMaille@users.noreply.github.com>
Wed, 23 Sep 2020 09:15:02 +0000
(11:15 +0200)
committer
GitHub
<noreply@github.com>
Wed, 23 Sep 2020 09:15:02 +0000
(09:15 +0000)
* Make sure there is a cuda device before getting it
* Update init.hpp
modules/dnn/src/cuda4dnn/init.hpp
patch
|
blob
|
history
diff --git
a/modules/dnn/src/cuda4dnn/init.hpp
b/modules/dnn/src/cuda4dnn/init.hpp
index
b548f09
..
e9d9973
100644
(file)
--- a/
modules/dnn/src/cuda4dnn/init.hpp
+++ b/
modules/dnn/src/cuda4dnn/init.hpp
@@
-57,6
+57,9
@@
namespace cv { namespace dnn { namespace cuda4dnn {
bool isDeviceCompatible()
{
+ if (getDeviceCount() <= 0)
+ return false;
+
int device_id = getDevice();
if (device_id < 0)
return false;
@@
-77,6
+80,9
@@
namespace cv { namespace dnn { namespace cuda4dnn {
bool doesDeviceSupportFP16()
{
+ if (getDeviceCount() <= 0)
+ return false;
+
int device_id = getDevice();
if (device_id < 0)
return false;