Commit 2e639b80 authored by Davis King's avatar Davis King

Minor cuda stuff

parent d72caabb
...@@ -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 corresponding
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 thoses 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.
!*/ !*/
......
...@@ -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;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment