Commit f47e3270 authored by Davis King's avatar Davis King

Finished the bindings in this file

parent 3e44d299
...@@ -24,6 +24,8 @@ namespace dlib { namespace tt ...@@ -24,6 +24,8 @@ namespace dlib { namespace tt
#ifdef DLIB_USE_CUDA #ifdef DLIB_USE_CUDA
cuda::gemm(beta, dest, alpha, lhs, trans_lhs, rhs, trans_rhs); cuda::gemm(beta, dest, alpha, lhs, trans_lhs, rhs, trans_rhs);
#else #else
if (beta != 0)
{
if (trans_lhs && trans_rhs) if (trans_lhs && trans_rhs)
dest = alpha*trans(mat(lhs))*trans(mat(rhs)) + beta*mat(dest); dest = alpha*trans(mat(lhs))*trans(mat(rhs)) + beta*mat(dest);
else if (!trans_lhs && trans_rhs) else if (!trans_lhs && trans_rhs)
...@@ -32,6 +34,18 @@ namespace dlib { namespace tt ...@@ -32,6 +34,18 @@ namespace dlib { namespace tt
dest = alpha*trans(mat(lhs))*mat(rhs) + beta*mat(dest); dest = alpha*trans(mat(lhs))*mat(rhs) + beta*mat(dest);
else else
dest = alpha*mat(lhs)*mat(rhs) + beta*mat(dest); dest = alpha*mat(lhs)*mat(rhs) + beta*mat(dest);
}
else
{
if (trans_lhs && trans_rhs)
dest = alpha*trans(mat(lhs))*trans(mat(rhs));
else if (!trans_lhs && trans_rhs)
dest = alpha*mat(lhs)*trans(mat(rhs));
else if (trans_lhs && !trans_rhs)
dest = alpha*trans(mat(lhs))*mat(rhs);
else
dest = alpha*mat(lhs)*mat(rhs);
}
#endif #endif
} }
...@@ -87,7 +101,7 @@ namespace dlib { namespace tt ...@@ -87,7 +101,7 @@ namespace dlib { namespace tt
{ {
DLIB_CASSERT(have_same_dimensions(dest,src) == true,""); DLIB_CASSERT(have_same_dimensions(dest,src) == true,"");
#ifdef DLIB_USE_CUDA #ifdef DLIB_USE_CUDA
//cuda::multiply(dest, src); cuda::multiply(dest, src);
#else #else
cpu::multiply(dest, src); cpu::multiply(dest, src);
#endif #endif
...@@ -104,7 +118,7 @@ namespace dlib { namespace tt ...@@ -104,7 +118,7 @@ namespace dlib { namespace tt
) )
{ {
#ifdef DLIB_USE_CUDA #ifdef DLIB_USE_CUDA
//cuda::affine_transform(dest,src,A,B); cuda::affine_transform(dest,src,A,B);
#else #else
cpu::affine_transform(dest,src,A,B); cpu::affine_transform(dest,src,A,B);
#endif #endif
...@@ -120,7 +134,7 @@ namespace dlib { namespace tt ...@@ -120,7 +134,7 @@ namespace dlib { namespace tt
) )
{ {
#ifdef DLIB_USE_CUDA #ifdef DLIB_USE_CUDA
//cuda::affine_transform(dest,src1,src2,A,B,C); cuda::affine_transform(dest,src1,src2,A,B,C);
#else #else
cpu::affine_transform(dest,src1,src2,A,B,C); cpu::affine_transform(dest,src1,src2,A,B,C);
#endif #endif
...@@ -138,7 +152,7 @@ namespace dlib { namespace tt ...@@ -138,7 +152,7 @@ namespace dlib { namespace tt
) )
{ {
#ifdef DLIB_USE_CUDA #ifdef DLIB_USE_CUDA
//cuda::affine_transform(dest,src1,src2,src3,A,B,C,D); cuda::affine_transform(dest,src1,src2,src3,A,B,C,D);
#else #else
cpu::affine_transform(dest,src1,src2,src3,A,B,C,D); cpu::affine_transform(dest,src1,src2,src3,A,B,C,D);
#endif #endif
...@@ -154,7 +168,7 @@ namespace dlib { namespace tt ...@@ -154,7 +168,7 @@ namespace dlib { namespace tt
) )
{ {
#ifdef DLIB_USE_CUDA #ifdef DLIB_USE_CUDA
//cuda::affine_transform(dest,src,A,B); cuda::affine_transform(dest,src,A,B);
#else #else
cpu::affine_transform(dest,src,A,B); cpu::affine_transform(dest,src,A,B);
#endif #endif
...@@ -172,7 +186,7 @@ namespace dlib { namespace tt ...@@ -172,7 +186,7 @@ namespace dlib { namespace tt
) )
{ {
#ifdef DLIB_USE_CUDA #ifdef DLIB_USE_CUDA
//cuda::batch_normalize(dest,means,vars,src,gamma,beta); cuda::batch_normalize(dest,means,vars,src,gamma,beta);
#else #else
cpu::batch_normalize(dest,means,vars,src,gamma,beta); cpu::batch_normalize(dest,means,vars,src,gamma,beta);
#endif #endif
...@@ -190,7 +204,7 @@ namespace dlib { namespace tt ...@@ -190,7 +204,7 @@ namespace dlib { namespace tt
) )
{ {
#ifdef DLIB_USE_CUDA #ifdef DLIB_USE_CUDA
//cuda::batch_normalize_conv(dest,means,vars,src,gamma,beta); cuda::batch_normalize_conv(dest,means,vars,src,gamma,beta);
#else #else
cpu::batch_normalize_conv(dest,means,vars,src,gamma,beta); cpu::batch_normalize_conv(dest,means,vars,src,gamma,beta);
#endif #endif
...@@ -204,7 +218,7 @@ namespace dlib { namespace tt ...@@ -204,7 +218,7 @@ namespace dlib { namespace tt
) )
{ {
#ifdef DLIB_USE_CUDA #ifdef DLIB_USE_CUDA
//cuda::threshold(data,thresh); cuda::threshold(data,thresh);
#else #else
cpu::threshold(data,thresh); cpu::threshold(data,thresh);
#endif #endif
......
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