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
b56d4817
Unverified
Commit
b56d4817
authored
Nov 10, 2024
by
gilbertlee-amd
Committed by
GitHub
Nov 10, 2024
Browse files
Allowing NULL memory type in sweep preset (#133)
parent
788840d0
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
7 deletions
+14
-7
CHANGELOG.md
CHANGELOG.md
+4
-0
src/TransferBench.cpp
src/TransferBench.cpp
+9
-6
src/include/EnvVars.hpp
src/include/EnvVars.hpp
+1
-1
No files found.
CHANGELOG.md
View file @
b56d4817
...
...
@@ -3,6 +3,10 @@
Documentation for TransferBench is available at
[
https://rocm.docs.amd.com/projects/TransferBench
](
https://rocm.docs.amd.com/projects/TransferBench
)
.
## v1.53
### Added
-
Added ability to specify NULL for sweep preset as source or destination memory type
## v1.52
### Added
-
Added USE_HSA_DMA env var to switch to using hsa_amd_memory_async_copy instead of hipMemcpyAsync for DMA execution
...
...
src/TransferBench.cpp
View file @
b56d4817
...
...
@@ -2799,7 +2799,7 @@ void RunSweepPreset(EnvVars const& ev, size_t const numBytesPerTransfer, int con
for
(
auto
src
:
ev
.
sweepSrc
)
{
MemType
const
srcType
=
CharToMemType
(
src
);
int
const
numDevices
=
IsGpuType
(
srcType
)
?
ev
.
numGpuDevices
:
ev
.
numCpuDevices
;
int
const
numDevices
=
(
srcType
==
MEM_NULL
)
?
1
:
IsGpuType
(
srcType
)
?
ev
.
numGpuDevices
:
ev
.
numCpuDevices
;
for
(
int
srcIndex
=
0
;
srcIndex
<
numDevices
;
++
srcIndex
)
srcList
.
push_back
(
std
::
make_pair
(
srcType
,
srcIndex
));
...
...
@@ -2811,7 +2811,7 @@ void RunSweepPreset(EnvVars const& ev, size_t const numBytesPerTransfer, int con
for
(
auto
dst
:
ev
.
sweepDst
)
{
MemType
const
dstType
=
CharToMemType
(
dst
);
int
const
numDevices
=
IsGpuType
(
dstType
)
?
ev
.
numGpuDevices
:
ev
.
numCpuDevices
;
int
const
numDevices
=
(
dstType
==
MEM_NULL
)
?
1
:
IsGpuType
(
dstType
)
?
ev
.
numGpuDevices
:
ev
.
numCpuDevices
;
for
(
int
dstIndex
=
0
;
dstIndex
<
numDevices
;
++
dstIndex
)
dstList
.
push_back
(
std
::
make_pair
(
dstType
,
dstIndex
));
...
...
@@ -2870,7 +2870,7 @@ void RunSweepPreset(EnvVars const& ev, size_t const numBytesPerTransfer, int con
// Skip this SRC if XGMI distance is already past limit
if
(
ev
.
sweepXgmiMax
>=
0
&&
isXgmiSrc
&&
numHopsSrc
>
ev
.
sweepXgmiMax
)
continue
;
}
else
if
(
useXgmiOnly
)
continue
;
else
if
(
srcList
[
j
].
first
!=
MEM_NULL
&&
useXgmiOnly
)
continue
;
tinfo
.
srcType
=
srcList
[
j
].
first
;
tinfo
.
srcIndex
=
srcList
[
j
].
second
;
...
...
@@ -2903,7 +2903,7 @@ void RunSweepPreset(EnvVars const& ev, size_t const numBytesPerTransfer, int con
}
// Skip this DST if it is not XGMI but only XGMI links may be used
if
(
useXgmiOnly
&&
!
isXgmiDst
)
continue
;
if
(
dstList
[
k
].
first
!=
MEM_NULL
&&
useXgmiOnly
&&
!
isXgmiDst
)
continue
;
// Skip this DST if total XGMI distance (SRC + DST) is less than min limit
if
(
ev
.
sweepXgmiMin
>
0
&&
(
numHopsSrc
+
numHopsDst
<
ev
.
sweepXgmiMin
))
continue
;
...
...
@@ -2920,6 +2920,9 @@ void RunSweepPreset(EnvVars const& ev, size_t const numBytesPerTransfer, int con
tinfo
.
dstType
=
dstList
[
k
].
first
;
tinfo
.
dstIndex
=
dstList
[
k
].
second
;
// Skip if there is no src and dst
if
(
tinfo
.
srcType
==
MEM_NULL
&&
tinfo
.
dstType
==
MEM_NULL
)
continue
;
possibleTransfers
.
push_back
(
tinfo
);
}
}
...
...
@@ -2978,8 +2981,8 @@ void RunSweepPreset(EnvVars const& ev, size_t const numBytesPerTransfer, int con
{
// Convert integer value to (SRC->EXE->DST) triplet
Transfer
transfer
;
transfer
.
numSrcs
=
1
;
transfer
.
numDsts
=
1
;
transfer
.
numSrcs
=
(
possibleTransfers
[
value
].
srcType
==
MEM_NULL
?
0
:
1
)
;
transfer
.
numDsts
=
(
possibleTransfers
[
value
].
dstType
==
MEM_NULL
?
0
:
1
)
;
transfer
.
srcType
=
{
possibleTransfers
[
value
].
srcType
};
transfer
.
srcIndex
=
{
possibleTransfers
[
value
].
srcIndex
};
transfer
.
exeType
=
possibleTransfers
[
value
].
exeType
;
...
...
src/include/EnvVars.hpp
View file @
b56d4817
...
...
@@ -29,7 +29,7 @@ THE SOFTWARE.
#include "Compatibility.hpp"
#include "Kernels.hpp"
#define TB_VERSION "1.5
2
"
#define TB_VERSION "1.5
3
"
extern
char
const
MemTypeStr
[];
extern
char
const
ExeTypeStr
[];
...
...
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