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

Minor cuda stuff

parent d72caabb
......@@ -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 corresponding
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.
!*/
......
......@@ -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;
}
}
......
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