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
175ec1ae
Commit
175ec1ae
authored
Oct 24, 2020
by
Ramesh Errabolu
Browse files
Update how number of iterations is used in determining bandwidth
parent
eae85ad5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
9 deletions
+9
-9
base_test.hpp
base_test.hpp
+3
-3
rocm_bandwidth_test.cpp
rocm_bandwidth_test.cpp
+4
-4
rocm_bandwidth_test_report.cpp
rocm_bandwidth_test_report.cpp
+2
-2
No files found.
base_test.hpp
View file @
175ec1ae
...
...
@@ -56,7 +56,7 @@ class BaseTest {
public:
BaseTest
(
size_t
num
=
3
);
BaseTest
(
size_t
num
_iter
=
4
);
virtual
~
BaseTest
();
...
...
@@ -74,8 +74,8 @@ class BaseTest {
virtual
void
Display
()
const
=
0
;
// @Brief: Set number of iterations to run
void
set_num_iteration
(
size_t
num
)
{
num_iteration_
=
num
;
void
set_num_iteration
(
size_t
num
_iter
)
{
num_iteration_
=
num
_iter
;
return
;
}
...
...
rocm_bandwidth_test.cpp
View file @
175ec1ae
...
...
@@ -80,7 +80,7 @@ const size_t RocmBandwidthTest::LATENCY_SIZE_LIST[] = { 1,
256
*
1024
,
512
*
1024
};
uint32_t
RocmBandwidthTest
::
GetIterationNum
()
{
return
(
validate_
)
?
1
:
(
num_iteration_
*
1.2
+
1
);
return
(
validate_
)
?
1
:
(
num_iteration_
+
1
);
}
void
RocmBandwidthTest
::
AcquireAccess
(
hsa_agent_t
agent
,
void
*
ptr
)
{
...
...
@@ -816,7 +816,7 @@ RocmBandwidthTest::RocmBandwidthTest(int argc, char** argv) : BaseTest() {
// Initialize version of the test
version_
.
major_id
=
2
;
version_
.
minor_id
=
5
;
version_
.
step_id
=
0
;
version_
.
step_id
=
1
;
version_
.
reserved
=
0
;
// Test impact of sleep, temp code
...
...
@@ -824,10 +824,10 @@ RocmBandwidthTest::RocmBandwidthTest(int argc, char** argv) : BaseTest() {
bw_sleep_time_
=
getenv
(
"ROCM_BW_SLEEP_TIME"
);
if
(
bw_sleep_time_
!=
NULL
)
{
sleep_time_
=
atoi
(
bw_sleep_time_
);
if
((
sleep_time_
<
0
)
||
(
sleep_time_
>
6
0000
))
{
if
((
sleep_time_
<
0
)
||
(
sleep_time_
>
40
0000
))
{
std
::
cout
<<
"Unit of sleep time is defined as 10 microseconds"
<<
std
::
endl
;
std
::
cout
<<
"An input value of 10 implies sleep time of 100 microseconds"
<<
std
::
endl
;
std
::
cout
<<
"Value of ROCM_BW_SLEEP_TIME must be between [1,
6
0000
)
"
<<
sleep_time_
<<
std
::
endl
;
std
::
cout
<<
"Value of ROCM_BW_SLEEP_TIME must be between [1,
40
0000
]
"
<<
sleep_time_
<<
std
::
endl
;
exit
(
1
);
}
sleep_time_
*=
10
;
...
...
rocm_bandwidth_test_report.cpp
View file @
175ec1ae
...
...
@@ -134,9 +134,9 @@ double RocmBandwidthTest::GetMeanTime(std::vector<double>& vec) {
return
vec
.
at
(
0
);
}
// Number of elements is ONE plus number of iterations
std
::
sort
(
vec
.
begin
(),
vec
.
end
());
vec
.
erase
(
vec
.
begin
(),
vec
.
begin
()
+
num_iteration_
*
0.1
);
vec
.
erase
(
vec
.
begin
()
+
num_iteration_
,
vec
.
end
());
vec
.
erase
(
vec
.
end
()
-
1
);
double
mean
=
0.0
;
int
num
=
vec
.
size
();
...
...
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