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
one
TransferBench
Commits
95a84559
Unverified
Commit
95a84559
authored
Oct 26, 2022
by
gilbertlee-amd
Committed by
GitHub
Oct 26, 2022
Browse files
v1.09 Extra interactive output (#7)
parent
ff2a96c9
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
15 deletions
+15
-15
CHANGELOG.md
CHANGELOG.md
+6
-0
EnvVars.hpp
EnvVars.hpp
+1
-1
TransferBench.cpp
TransferBench.cpp
+8
-14
No files found.
CHANGELOG.md
View file @
95a84559
# Changelog for TransferBench
# Changelog for TransferBench
## v1.09
### Added
-
Printing off src/dst memory addresses during interactive mode
### Changed
-
Switching to numa_set_preferred instead of set_mempolicy
## v1.08
## v1.08
### Changed
### Changed
-
Fixing handling of non-configured NUMA nodes
-
Fixing handling of non-configured NUMA nodes
...
...
EnvVars.hpp
View file @
95a84559
...
@@ -26,7 +26,7 @@ THE SOFTWARE.
...
@@ -26,7 +26,7 @@ THE SOFTWARE.
#include <algorithm>
#include <algorithm>
#include <random>
#include <random>
#include <time.h>
#include <time.h>
#define TB_VERSION "1.0
8
"
#define TB_VERSION "1.0
9
"
extern
char
const
MemTypeStr
[];
extern
char
const
MemTypeStr
[];
...
...
TransferBench.cpp
View file @
95a84559
...
@@ -292,6 +292,12 @@ void ExecuteTransfers(EnvVars const& ev,
...
@@ -292,6 +292,12 @@ void ExecuteTransfers(EnvVars const& ev,
// Pause before starting first timed iteration in interactive mode
// Pause before starting first timed iteration in interactive mode
if
(
verbose
&&
ev
.
useInteractive
&&
iteration
==
0
)
if
(
verbose
&&
ev
.
useInteractive
&&
iteration
==
0
)
{
{
printf
(
"Memory prepared:
\n
"
);
for
(
Transfer
&
transfer
:
transfers
)
{
printf
(
"Transfer %03d: SRC: %p DST: %p
\n
"
,
transfer
.
transferIndex
,
transfer
.
srcMem
,
transfer
.
dstMem
);
}
printf
(
"Hit <Enter> to continue: "
);
printf
(
"Hit <Enter> to continue: "
);
scanf
(
"%*c"
);
scanf
(
"%*c"
);
printf
(
"
\n
"
);
printf
(
"
\n
"
);
...
@@ -865,16 +871,9 @@ void AllocateMemory(MemType memType, int devIndex, size_t numBytes, void** memPt
...
@@ -865,16 +871,9 @@ void AllocateMemory(MemType memType, int devIndex, size_t numBytes, void** memPt
if
(
IsCpuType
(
memType
))
if
(
IsCpuType
(
memType
))
{
{
// Set numa policy prior to call to hipHostMalloc
// Set numa policy prior to call to hipHostMalloc
unsigned
long
nodemask
=
(
1ULL
<<
devIndex
);
numa_set_preferred
(
devIndex
);
long
retCode
=
set_mempolicy
(
MPOL_BIND
,
&
nodemask
,
sizeof
(
nodemask
)
*
8
);
if
(
retCode
)
{
printf
(
"[ERROR] Unable to set NUMA memory policy to bind to NUMA node %d
\n
"
,
devIndex
);
exit
(
1
);
}
// Allocate host-pinned memory (should respect NUMA mem policy)
// Allocate host-pinned memory (should respect NUMA mem policy)
if
(
memType
==
MEM_CPU_FINE
)
if
(
memType
==
MEM_CPU_FINE
)
{
{
HIP_CALL
(
hipHostMalloc
((
void
**
)
memPtr
,
numBytes
,
hipHostMallocNumaUser
));
HIP_CALL
(
hipHostMalloc
((
void
**
)
memPtr
,
numBytes
,
hipHostMallocNumaUser
));
...
@@ -897,12 +896,7 @@ void AllocateMemory(MemType memType, int devIndex, size_t numBytes, void** memPt
...
@@ -897,12 +896,7 @@ void AllocateMemory(MemType memType, int devIndex, size_t numBytes, void** memPt
CheckPages
((
char
*
)
*
memPtr
,
numBytes
,
devIndex
);
CheckPages
((
char
*
)
*
memPtr
,
numBytes
,
devIndex
);
// Reset to default numa mem policy
// Reset to default numa mem policy
retCode
=
set_mempolicy
(
MPOL_DEFAULT
,
NULL
,
8
);
numa_set_preferred
(
-
1
);
if
(
retCode
)
{
printf
(
"[ERROR] Unable reset to default NUMA memory policy
\n
"
);
exit
(
1
);
}
}
}
else
if
(
memType
==
MEM_GPU
)
else
if
(
memType
==
MEM_GPU
)
{
{
...
...
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