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
gaoqiong
MIGraphX
Commits
55b87a67
Commit
55b87a67
authored
Oct 03, 2023
by
Brian Pickrell
Browse files
added more details to threading test
parent
f6b08c2a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
3 deletions
+17
-3
test/targets.cpp
test/targets.cpp
+17
-3
No files found.
test/targets.cpp
View file @
55b87a67
...
...
@@ -54,12 +54,26 @@ TEST_CASE(targets)
TEST_CASE
(
concurrent_targets
)
{
std
::
vector
<
std
::
thread
>
threads
;
#ifdef HAVE_GPU
std
::
string
target_name
=
"gpu"
;
#elif defined(HAVE_CPU)
std
::
string
target_name
=
"cpu"
;
#elif defined(HAVE_FPGA)
std
::
string
target_name
=
"fpga"
;
#else
std
::
string
target_name
=
"ref"
;
#endif
auto
n_threads
=
std
::
thread
::
hardware_concurrency
()
*
4
;
for
(
auto
i
=
0u
;
i
<
1000
;
i
++
)
for
(
auto
i
=
0u
;
i
<
n_threads
;
i
++
)
{
auto
thread_body
=
[]()
{
auto
ref_target
=
migraphx
::
make_target
(
"ref"
);
auto
thread_body
=
[
&
target_name
]()
{
auto
ref_target
=
migraphx
::
make_target
(
target_name
);
migraphx
::
register_target
(
ref_target
);
EXPECT
(
test
::
throws
([
&
]
{
ref_target
=
migraphx
::
make_target
(
"xyz"
);
}));
migraphx
::
get_targets
();
};
threads
.
emplace_back
(
thread_body
);
...
...
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