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
wangsen
rocm_bandwidth_test
Commits
b74d4cf7
Commit
b74d4cf7
authored
Dec 17, 2018
by
Ramesh Errabolu
Browse files
Trigger bidirectional copy from host
parent
6c478599
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
4 deletions
+24
-4
rocm_bandwidth_test.cpp
rocm_bandwidth_test.cpp
+24
-4
No files found.
rocm_bandwidth_test.cpp
View file @
b74d4cf7
...
@@ -235,6 +235,7 @@ void RocmBandwidthTest::RunCopyBenchmark(async_trans_t& trans) {
...
@@ -235,6 +235,7 @@ void RocmBandwidthTest::RunCopyBenchmark(async_trans_t& trans) {
hsa_signal_t
signal_fwd
;
hsa_signal_t
signal_fwd
;
hsa_signal_t
signal_rev
;
hsa_signal_t
signal_rev
;
hsa_signal_t
validation_signal
;
hsa_signal_t
validation_signal
;
hsa_signal_t
signal_start_bidir
;
uint32_t
src_idx
=
trans
.
copy
.
src_idx_
;
uint32_t
src_idx
=
trans
.
copy
.
src_idx_
;
uint32_t
dst_idx
=
trans
.
copy
.
dst_idx_
;
uint32_t
dst_idx
=
trans
.
copy
.
dst_idx_
;
uint32_t
src_dev_idx_fwd
=
pool_list_
[
src_idx
].
agent_index_
;
uint32_t
src_dev_idx_fwd
=
pool_list_
[
src_idx
].
agent_index_
;
...
@@ -267,6 +268,11 @@ void RocmBandwidthTest::RunCopyBenchmark(async_trans_t& trans) {
...
@@ -267,6 +268,11 @@ void RocmBandwidthTest::RunCopyBenchmark(async_trans_t& trans) {
buf_dst_rev
,
dst_pool_rev
,
buf_dst_rev
,
dst_pool_rev
,
src_agent_rev
,
dst_agent_rev
,
src_agent_rev
,
dst_agent_rev
,
signal_rev
);
signal_rev
);
// Create a signal to begin bidir copy operations
// @TODO: replace it with a signal pool call
err_
=
hsa_signal_create
(
1
,
0
,
NULL
,
&
signal_start_bidir
);
ErrorCheck
(
err_
);
}
}
if
(
validate_
)
{
if
(
validate_
)
{
...
@@ -309,6 +315,7 @@ void RocmBandwidthTest::RunCopyBenchmark(async_trans_t& trans) {
...
@@ -309,6 +315,7 @@ void RocmBandwidthTest::RunCopyBenchmark(async_trans_t& trans) {
hsa_signal_store_relaxed
(
signal_fwd
,
1
);
hsa_signal_store_relaxed
(
signal_fwd
,
1
);
if
(
bidir
)
{
if
(
bidir
)
{
hsa_signal_store_relaxed
(
signal_rev
,
1
);
hsa_signal_store_relaxed
(
signal_rev
,
1
);
hsa_signal_store_relaxed
(
signal_start_bidir
,
1
);
}
}
if
(
validate_
)
{
if
(
validate_
)
{
...
@@ -324,19 +331,32 @@ void RocmBandwidthTest::RunCopyBenchmark(async_trans_t& trans) {
...
@@ -324,19 +331,32 @@ void RocmBandwidthTest::RunCopyBenchmark(async_trans_t& trans) {
// Start the timer and launch forward copy operation
// Start the timer and launch forward copy operation
timer
.
StartTimer
(
index
);
timer
.
StartTimer
(
index
);
if
(
bidir
==
false
)
{
err_
=
hsa_amd_memory_async_copy
(
buf_dst_fwd
,
dst_agent_fwd
,
err_
=
hsa_amd_memory_async_copy
(
buf_dst_fwd
,
dst_agent_fwd
,
buf_src_fwd
,
src_agent_fwd
,
buf_src_fwd
,
src_agent_fwd
,
curr_size
,
0
,
NULL
,
signal_fwd
);
curr_size
,
0
,
NULL
,
signal_fwd
);
}
else
{
err_
=
hsa_amd_memory_async_copy
(
buf_dst_fwd
,
dst_agent_fwd
,
buf_src_fwd
,
src_agent_fwd
,
curr_size
,
1
,
&
signal_start_bidir
,
signal_fwd
);
}
ErrorCheck
(
err_
);
ErrorCheck
(
err_
);
// Launch reverse copy operation if it is bidirectional
// Launch reverse copy operation if it is bidirectional
if
(
bidir
)
{
if
(
bidir
)
{
err_
=
hsa_amd_memory_async_copy
(
buf_dst_rev
,
dst_agent_rev
,
err_
=
hsa_amd_memory_async_copy
(
buf_dst_rev
,
dst_agent_rev
,
buf_src_rev
,
src_agent_rev
,
buf_src_rev
,
src_agent_rev
,
curr_size
,
0
,
NULL
,
signal_rev
);
curr_size
,
1
,
&
signal_start_bidir
,
signal_rev
);
ErrorCheck
(
err_
);
ErrorCheck
(
err_
);
}
}
// Signal the bidir copies to begin
if
(
bidir
)
{
hsa_signal_store_relaxed
(
signal_start_bidir
,
0
);
}
if
(
bw_blocking_run_
==
NULL
)
{
if
(
bw_blocking_run_
==
NULL
)
{
// Wait for the forward copy operation to complete
// Wait for the forward copy operation to complete
...
...
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