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
ca11ff49
Commit
ca11ff49
authored
Nov 21, 2015
by
Davis King
Browse files
Added more stuff to tests
parent
5f5c46f4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
dlib/test/cublas.cpp
dlib/test/cublas.cpp
+6
-0
No files found.
dlib/test/cublas.cpp
View file @
ca11ff49
...
...
@@ -47,6 +47,7 @@ namespace
matrix
<
float
>
truth
=
2
*
mat
(
c
)
+
trans
(
mat
(
a
))
*
trans
(
mat
(
b
));
a
.
async_copy_to_device
();
b
.
async_copy_to_device
();
c
.
async_copy_to_device
();
cuda
::
gemm
(
2
,
c
,
1
,
a
,
true
,
b
,
true
);
DLIB_TEST
(
max
(
abs
(
truth
-
mat
(
c
)))
<
1e-6
);
}
...
...
@@ -59,6 +60,7 @@ namespace
matrix
<
float
>
truth
=
2
*
mat
(
c
)
+
trans
(
mat
(
a
))
*
mat
(
b
);
a
.
async_copy_to_device
();
b
.
async_copy_to_device
();
c
.
async_copy_to_device
();
cuda
::
gemm
(
2
,
c
,
1
,
a
,
true
,
b
,
false
);
DLIB_TEST
(
max
(
abs
(
truth
-
mat
(
c
)))
<
1e-6
);
}
...
...
@@ -71,6 +73,7 @@ namespace
matrix
<
float
>
truth
=
2
*
mat
(
c
)
+
mat
(
a
)
*
trans
(
mat
(
b
));
a
.
async_copy_to_device
();
b
.
async_copy_to_device
();
c
.
async_copy_to_device
();
cuda
::
gemm
(
2
,
c
,
1
,
a
,
false
,
b
,
true
);
DLIB_TEST
(
max
(
abs
(
truth
-
mat
(
c
)))
<
1e-6
);
}
...
...
@@ -83,6 +86,7 @@ namespace
matrix
<
float
>
truth
=
mat
(
c
)
+
mat
(
a
)
*
trans
(
mat
(
b
));
a
.
async_copy_to_device
();
b
.
async_copy_to_device
();
c
.
async_copy_to_device
();
cuda
::
gemm
(
1
,
c
,
1
,
a
,
false
,
b
,
true
);
DLIB_TEST
(
max
(
abs
(
truth
-
mat
(
c
)))
<
1e-6
);
}
...
...
@@ -95,6 +99,7 @@ namespace
matrix
<
float
>
truth
=
2
*
mat
(
c
)
+
mat
(
a
)
*
mat
(
b
);
a
.
async_copy_to_device
();
b
.
async_copy_to_device
();
c
.
async_copy_to_device
();
cuda
::
gemm
(
2
,
c
,
1
,
a
,
false
,
b
,
false
);
DLIB_TEST
(
max
(
abs
(
truth
-
mat
(
c
)))
<
1e-6
);
}
...
...
@@ -104,6 +109,7 @@ namespace
c
=
std
::
numeric_limits
<
float
>::
infinity
();
a
=
matrix_cast
<
float
>
(
gaussian_randm
(
a
.
num_samples
(),
a
.
size
()
/
a
.
num_samples
()));
b
=
matrix_cast
<
float
>
(
gaussian_randm
(
b
.
num_samples
(),
b
.
size
()
/
b
.
num_samples
()));
a
.
async_copy_to_device
();
b
.
async_copy_to_device
();
c
.
async_copy_to_device
();
matrix
<
float
>
truth
=
mat
(
a
)
*
mat
(
b
);
...
...
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