Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dlib
Commits
2703a72d
Commit
2703a72d
authored
Apr 16, 2016
by
Davis King
Browse files
Added get_num_devices()
parent
603d4743
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
0 deletions
+14
-0
dlib/dnn/cuda_dlib.cu
dlib/dnn/cuda_dlib.cu
+8
-0
dlib/dnn/cuda_dlib.h
dlib/dnn/cuda_dlib.h
+6
-0
No files found.
dlib/dnn/cuda_dlib.cu
View file @
2703a72d
...
...
@@ -27,6 +27,14 @@ namespace dlib
return
dev
;
}
int
get_num_devices
(
)
{
int
num_devices
;
CHECK_CUDA
(
cudaGetDeviceCount
(
&
num_devices
));
return
num_devices
;
}
// -----------------------------------------------------------------------------------
__global__
void
_cuda_multiply1
(
float
*
d
,
const
float
*
s1
,
const
float
*
s2
,
size_t
n
)
...
...
dlib/dnn/cuda_dlib.h
View file @
2703a72d
...
...
@@ -22,6 +22,9 @@ namespace dlib
int
get_device
(
);
int
get_num_devices
(
);
// -----------------------------------------------------------------------------------
void
multiply
(
...
...
@@ -165,6 +168,9 @@ namespace dlib
inline
int
get_device
(
){
return
0
;
}
int
get_num_devices
(
)
{
return
1
;
}
#endif // DLIB_USE_CUDA
}
...
...
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