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
77fb490d
Commit
77fb490d
authored
Nov 15, 2017
by
Ramesh Errabolu
Browse files
Update help screen with Validation Mode
parent
48f82ce6
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
10 deletions
+22
-10
main.cpp
main.cpp
+1
-1
rocm_bandwidth_test.cpp
rocm_bandwidth_test.cpp
+12
-6
rocm_bandwidth_test.hpp
rocm_bandwidth_test.hpp
+7
-2
rocm_bandwidth_test_report.cpp
rocm_bandwidth_test_report.cpp
+2
-1
No files found.
main.cpp
View file @
77fb490d
...
...
@@ -72,7 +72,7 @@ int main(int argc, char** argv) {
if
(
arg_cnt
!=
1
)
{
bw_test1
.
Display
();
bw_test1
.
Close
();
return
0
;
return
bw_test1
.
GetExitValue
()
;
}
// Run the second iteration of copy requests
...
...
rocm_bandwidth_test.cpp
View file @
77fb490d
...
...
@@ -49,6 +49,7 @@
#include <unistd.h>
#include <cctype>
#include <sstream>
#include <limits>
// The values are in megabytes at allocation time
const
uint32_t
RocmBandwidthTest
::
SIZE_LIST
[]
=
{
1
*
1024
,
...
...
@@ -296,6 +297,7 @@ void RocmBandwidthTest::RunCopyBenchmark(async_trans_t& trans) {
break
;
}
bool
verify
=
true
;
std
::
vector
<
double
>
cpu_time
;
std
::
vector
<
double
>
gpu_time
;
for
(
uint32_t
it
=
0
;
it
<
iterations
;
it
++
)
{
...
...
@@ -391,9 +393,9 @@ void RocmBandwidthTest::RunCopyBenchmark(async_trans_t& trans) {
// Compare output equals input
err_
=
(
hsa_status_t
)
memcmp
(
validation_src
,
validation_dst
,
curr_size
);
if
(
err_
!=
HSA_STATUS_SUCCESS
)
{
PrintCopyAccessError
(
src_idx
,
dst_idx
);
verify
=
false
;
exit_value_
=
err_
;
}
ErrorCheck
(
err_
);
}
}
...
...
@@ -404,12 +406,14 @@ void RocmBandwidthTest::RunCopyBenchmark(async_trans_t& trans) {
if
(
print_cpu_time_
==
false
)
{
if
(
trans
.
copy
.
uses_gpu_
)
{
// Get Gpu min copy time
trans
.
gpu_min_time_
.
push_back
(
GetMinTime
(
gpu_time
));
// Get Gpu mean copy time and store to the array
trans
.
gpu_avg_time_
.
push_back
(
GetMeanTime
(
gpu_time
));
// Get Gpu min and mean copy times
double
min_time
=
(
verify
)
?
GetMinTime
(
gpu_time
)
:
std
::
numeric_limits
<
double
>::
max
();
double
mean_time
=
(
verify
)
?
GetMeanTime
(
gpu_time
)
:
std
::
numeric_limits
<
double
>::
max
();
trans
.
gpu_min_time_
.
push_back
(
min_time
);
trans
.
gpu_avg_time_
.
push_back
(
mean_time
);
}
}
verify
=
true
;
// Clear the stack of cpu times
cpu_time
.
clear
();
...
...
@@ -523,6 +527,8 @@ RocmBandwidthTest::RocmBandwidthTest(int argc, char** argv) : BaseTest() {
bw_default_run_
=
getenv
(
"ROCM_BW_DEFAULT_RUN"
);
bw_blocking_run_
=
getenv
(
"ROCR_BW_RUN_BLOCKING"
);
skip_fine_grain_
=
getenv
(
"ROCM_SKIP_FINE_GRAINED_POOL"
);
exit_value_
=
0
;
}
RocmBandwidthTest
::~
RocmBandwidthTest
()
{
}
...
...
rocm_bandwidth_test.hpp
View file @
77fb490d
...
...
@@ -194,6 +194,9 @@ class RocmBandwidthTest : public BaseTest {
// @brief: Display the results
virtual
void
Display
()
const
;
// @brief: Return exit value, useful in case of error
int32_t
GetExitValue
()
{
return
exit_value_
;
}
private:
// @brief: Print Help Menu Screen
...
...
@@ -251,8 +254,8 @@ class RocmBandwidthTest : public BaseTest {
void
DisplayCopyTime
(
async_trans_t
&
trans
)
const
;
void
DisplayCopyTimeMatrix
(
bool
peak
)
const
;
void
DisplayValidationMatrix
()
const
;
private:
private:
// @brief: Validate the arguments passed in by user
bool
ValidateArguments
();
...
...
@@ -424,6 +427,8 @@ class RocmBandwidthTest : public BaseTest {
// static const uint32_t SIZE_LIST[4];
static
const
uint32_t
SIZE_LIST
[
20
];
// Exit value to return in case of error
int32_t
exit_value_
;
};
#endif // __ROC_BANDWIDTH_TEST_H__
rocm_bandwidth_test_report.cpp
View file @
77fb490d
...
...
@@ -344,9 +344,10 @@ void RocmBandwidthTest::DisplayValidationMatrix() const {
double
value
=
perf_matrix
[(
idx0
*
agent_index_
)
+
idx1
];
if
(
value
==
0
)
{
std
::
cout
<<
"N/A"
;
}
else
if
(
value
<
1
)
{
std
::
cout
<<
"FAIL"
;
}
else
{
std
::
cout
<<
"PASS"
;
// std::cout << perf_matrix[(idx0 * agent_index_) + idx1];
}
}
std
::
cout
<<
std
::
endl
;
...
...
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