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
2e639b80
"tests/vscode:/vscode.git/clone" did not exist on "8b3d2aeaf8ed1489752a9dc4ebf69e72c7af6bf0"
Commit
2e639b80
authored
Oct 13, 2015
by
Davis King
Browse files
Minor cuda stuff
parent
d72caabb
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
3 deletions
+16
-3
dlib/dnn/cudnn.h
dlib/dnn/cudnn.h
+2
-3
dlib/dnn/tensor.h
dlib/dnn/tensor.h
+14
-0
No files found.
dlib/dnn/cudnn.h
View file @
2e639b80
...
@@ -5,7 +5,6 @@
...
@@ -5,7 +5,6 @@
#ifdef DLIB_USE_CUDA
#ifdef DLIB_USE_CUDA
#include "tensor.h"
namespace
dlib
namespace
dlib
{
{
...
@@ -128,9 +127,9 @@ namespace dlib
...
@@ -128,9 +127,9 @@ namespace dlib
calls cudnnAddTensor_v3()
calls cudnnAddTensor_v3()
This function adds the scaled values of one bias tensor to another
This function adds the scaled values of one bias tensor to another
tensor. Each dimension of the bias tensor must match the coresponding
tensor. Each dimension of the bias tensor must match the cor
r
esponding
dimension of the srcDest tensor or must be equal to 1. In the latter
dimension of the srcDest tensor or must be equal to 1. In the latter
case, the same value from the bias tensor for those
s
dimensions will be
case, the same value from the bias tensor for those dimensions will be
used to blend into the srcDest tensor.
used to blend into the srcDest tensor.
!*/
!*/
...
...
dlib/dnn/tensor.h
View file @
2e639b80
...
@@ -66,12 +66,16 @@ namespace dlib
...
@@ -66,12 +66,16 @@ namespace dlib
void
async_copy_to_device
()
void
async_copy_to_device
()
{
{
#ifdef DLIB_USE_CUDA
// TODO
// TODO
#endif
}
}
void
async_copy_to_host
()
void
async_copy_to_host
()
{
{
#ifdef DLIB_USE_CUDA
// TODO
// TODO
#endif
}
}
const
float
*
host
()
const
const
float
*
host
()
const
...
@@ -89,12 +93,18 @@ namespace dlib
...
@@ -89,12 +93,18 @@ namespace dlib
const
float
*
device
()
const
const
float
*
device
()
const
{
{
#ifndef DLIB_USE_CUDA
DLIB_CASSERT
(
false
,
"CUDA NOT ENABLED"
);
#endif
copy_to_device
();
copy_to_device
();
return
data_device
.
get
();
return
data_device
.
get
();
}
}
float
*
device
()
float
*
device
()
{
{
#ifndef DLIB_USE_CUDA
DLIB_CASSERT
(
false
,
"CUDA NOT ENABLED"
);
#endif
copy_to_device
();
copy_to_device
();
host_current
=
false
;
host_current
=
false
;
return
data_device
.
get
();
return
data_device
.
get
();
...
@@ -108,7 +118,9 @@ namespace dlib
...
@@ -108,7 +118,9 @@ namespace dlib
{
{
if
(
!
device_current
)
if
(
!
device_current
)
{
{
#ifdef DLIB_USE_CUDA
// TODO, cudamemcpy()
// TODO, cudamemcpy()
#endif
device_current
=
true
;
device_current
=
true
;
}
}
}
}
...
@@ -117,7 +129,9 @@ namespace dlib
...
@@ -117,7 +129,9 @@ namespace dlib
{
{
if
(
!
host_current
)
if
(
!
host_current
)
{
{
#ifdef DLIB_USE_CUDA
// TODO, cudamemcpy()
// TODO, cudamemcpy()
#endif
host_current
=
true
;
host_current
=
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