-
Notifications
You must be signed in to change notification settings - Fork 15
/
main.cpp
46 lines (36 loc) · 871 Bytes
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// file to just try out stuff
// mostly used for printf debugging (first iteration)
#include "miopen.hpp"
#include "tensor.hpp"
#include "utils.hpp"
#include "layers.hpp"
#include "multi_layers.hpp"
// cehck that I got the dimensions in `add_inplace` right
void check_add() {
Tensor x(2, 2, 1, 1);
x.fromHost({3, 4, 2, 1});
x.print_data();
Tensor y(2, 2, 1, 1);
y.fromHost({-3, .15, 2, 5});
y.print_data();
add_inplace(x, y);
x.print_data();
}
int main(int argc, char *argv[])
{
device_init();
// enable profiling
CHECK_MIO(miopenEnableProfiling(mio::handle(), true));
/*
TensorDesc input(32, 3, 8, 8);
Model m(input);
m.emplace<BatchNorm>();
m.init_forward();
for (int i = 0; i < 10; ++i) {
m.forward();
}
*/
check_add();
miopenDestroy(mio::handle());
return 0;
}