Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
dlib
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
钟尚武
dlib
Commits
2e639b80
Commit
2e639b80
authored
Oct 13, 2015
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor cuda stuff
parent
d72caabb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
3 deletions
+16
-3
cudnn.h
dlib/dnn/cudnn.h
+2
-3
tensor.h
dlib/dnn/tensor.h
+14
-0
No files found.
dlib/dnn/cudnn.h
View file @
2e639b80
...
...
@@ -5,7 +5,6 @@
#ifdef DLIB_USE_CUDA
#include "tensor.h"
namespace
dlib
{
...
...
@@ -128,9 +127,9 @@ namespace dlib
calls cudnnAddTensor_v3()
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
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.
!*/
...
...
dlib/dnn/tensor.h
View file @
2e639b80
...
...
@@ -66,12 +66,16 @@ namespace dlib
void
async_copy_to_device
()
{
#ifdef DLIB_USE_CUDA
// TODO
#endif
}
void
async_copy_to_host
()
{
#ifdef DLIB_USE_CUDA
// TODO
#endif
}
const
float
*
host
()
const
...
...
@@ -89,12 +93,18 @@ namespace dlib
const
float
*
device
()
const
{
#ifndef DLIB_USE_CUDA
DLIB_CASSERT
(
false
,
"CUDA NOT ENABLED"
);
#endif
copy_to_device
();
return
data_device
.
get
();
}
float
*
device
()
{
#ifndef DLIB_USE_CUDA
DLIB_CASSERT
(
false
,
"CUDA NOT ENABLED"
);
#endif
copy_to_device
();
host_current
=
false
;
return
data_device
.
get
();
...
...
@@ -108,7 +118,9 @@ namespace dlib
{
if
(
!
device_current
)
{
#ifdef DLIB_USE_CUDA
// TODO, cudamemcpy()
#endif
device_current
=
true
;
}
}
...
...
@@ -117,7 +129,9 @@ namespace dlib
{
if
(
!
host_current
)
{
#ifdef DLIB_USE_CUDA
// TODO, cudamemcpy()
#endif
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