Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
gaoqiong
MIGraphX
Commits
64370f87
Commit
64370f87
authored
Aug 10, 2018
by
Paul
Browse files
Show program name
parent
4e14ec8e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
9 deletions
+13
-9
test/gpu/miopen.cpp
test/gpu/miopen.cpp
+13
-9
No files found.
test/gpu/miopen.cpp
View file @
64370f87
...
@@ -14,26 +14,27 @@
...
@@ -14,26 +14,27 @@
#include "test.hpp"
#include "test.hpp"
#include "verify.hpp"
#include "verify.hpp"
auto
&
handlers
()
#ifdef __clang__
{
#pragma clang diagnostic push
static
std
::
array
<
std
::
function
<
void
()
>
,
2
>
x
=
{};
#pragma clang diagnostic ignored "-Wglobal-constructors"
return
x
;
#endif
}
struct
auto_print
struct
auto_print
{
{
static
std
::
array
<
std
::
function
<
void
()
>
,
2
>
handlers
;
migraph
::
program
&
p
;
migraph
::
program
&
p
;
int
index
;
int
index
;
auto_print
(
migraph
::
program
&
pp
,
int
i
)
:
p
(
pp
),
index
(
i
)
auto_print
(
migraph
::
program
&
pp
,
int
i
)
:
p
(
pp
),
index
(
i
)
{
{
handlers
()
[
index
]
=
[
this
]
{
std
::
cout
<<
p
<<
std
::
endl
;
};
handlers
[
index
]
=
[
this
]
{
std
::
cout
<<
p
<<
std
::
endl
;
};
}
}
~
auto_print
()
~
auto_print
()
{
{
handlers
()
[
index
]
=
[]
{};
handlers
[
index
]
=
[]
{};
}
}
};
};
std
::
array
<
std
::
function
<
void
()
>
,
2
>
auto_print
::
handlers
=
{};
template
<
class
V
>
template
<
class
V
>
migraph
::
argument
run_cpu
()
migraph
::
argument
run_cpu
()
...
@@ -71,15 +72,17 @@ template <class V>
...
@@ -71,15 +72,17 @@ template <class V>
void
verify_program
()
void
verify_program
()
{
{
std
::
set_terminate
(
+
[]
{
std
::
set_terminate
(
+
[]
{
std
::
cout
<<
"FAILED: "
<<
migraph
::
get_type_name
<
V
>
()
<<
std
::
endl
;
try
try
{
{
std
::
rethrow_exception
(
std
::
current_exception
());
std
::
rethrow_exception
(
std
::
current_exception
());
}
}
catch
(
const
std
::
exception
&
e
)
catch
(
const
std
::
exception
&
e
)
{
{
std
::
cout
<<
"what(): "
<<
e
.
what
()
<<
std
::
endl
;
std
::
cout
<<
"
what(): "
<<
e
.
what
()
<<
std
::
endl
;
}
}
for
(
auto
&&
handle
:
handlers
())
std
::
cout
<<
std
::
endl
;
for
(
auto
&&
handle
:
auto_print
::
handlers
)
handle
();
handle
();
});
});
auto
cpu_arg
=
run_cpu
<
V
>
();
auto
cpu_arg
=
run_cpu
<
V
>
();
...
@@ -90,6 +93,7 @@ void verify_program()
...
@@ -90,6 +93,7 @@ void verify_program()
std
::
cout
<<
"FAILED: "
<<
migraph
::
get_type_name
<
V
>
()
<<
std
::
endl
;
std
::
cout
<<
"FAILED: "
<<
migraph
::
get_type_name
<
V
>
()
<<
std
::
endl
;
}
}
});
});
std
::
set_terminate
(
nullptr
);
}
}
struct
test_literals
struct
test_literals
...
...
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