Skip to content

Commit

Permalink
Fixing USE_INTERACTIVE bug (#142)
Browse files Browse the repository at this point in the history
  • Loading branch information
gilbertlee-amd authored Nov 26, 2024
1 parent 9f68d14 commit 83fc9b3
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 23 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.56
### Fixed
- Fixed bug when using interactive mode. Interactive mode now starts prior to all warmup iterations

## v1.55
### Fixed
- Fixed missing header error when compiling on CentOS
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ else()
endif()
cmake_minimum_required(VERSION 3.5)

project(TransferBench VERSION 1.55.0 LANGUAGES CXX)
project(TransferBench VERSION 1.56.0 LANGUAGES CXX)

# Default GPU architectures to build
#==================================================================================================
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ endif

CXXFLAGS = -I$(ROCM_PATH)/include -lnuma -L$(ROCM_PATH)/lib -lhsa-runtime64
NVFLAGS = -x cu -lnuma -arch=native
COMMON_FLAGS = -g -O3 --std=c++20 -I./src/header -I./src/client -I./src/client/Presets
COMMON_FLAGS = -O3 --std=c++20 -I./src/header -I./src/client -I./src/client/Presets
LDFLAGS += -lpthread

all: $(EXE)
Expand Down
2 changes: 1 addition & 1 deletion src/client/Client.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ THE SOFTWARE.
#pragma once

// TransferBench client version
#define CLIENT_VERSION "1.55.00"
#define CLIENT_VERSION "1.56.00"

#include "TransferBench.hpp"
#include "EnvVars.hpp"
Expand Down
41 changes: 21 additions & 20 deletions src/header/TransferBench.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ namespace TransferBench
using std::set;
using std::vector;

constexpr char VERSION[] = "1.54";
constexpr char VERSION[] = "1.56";

/**
* Enumeration of supported Executor types
Expand Down Expand Up @@ -2226,6 +2226,26 @@ namespace {
}
}

// Pause before starting when running in iteractive mode
if (cfg.general.useInteractive) {
printf("Memory prepared:\n");

for (int i = 0; i < transfers.size(); i++) {
ExeInfo const& exeInfo = executorMap[transfers[i].exeDevice];
printf("Transfer %03d:\n", i);
for (int iSrc = 0; iSrc < transfers[i].srcs.size(); ++iSrc)
printf(" SRC %0d: %p\n", iSrc, transferResources[i]->srcMem[iSrc]);
for (int iDst = 0; iDst < transfers[i].dsts.size(); ++iDst)
printf(" DST %0d: %p\n", iDst, transferResources[i]->dstMem[iDst]);
}
printf("Hit <Enter> to continue: ");
if (scanf("%*c") != 0) {
printf("[ERROR] Unexpected input\n");
exit(1);
}
printf("\n");
}

// Perform iterations
size_t numTimedIterations = 0;
double totalCpuTimeSec = 0.0;
Expand All @@ -2234,25 +2254,6 @@ namespace {
if (cfg.general.numIterations > 0 && iteration >= cfg.general.numIterations) break;
if (cfg.general.numIterations < 0 && totalCpuTimeSec > -cfg.general.numIterations) break;

// Pause before starting first timed iteration in iteractive mode
if (cfg.general.useInteractive && iteration == 0) {
printf("Memory prepared:\n");

for (int i = 0; i < transfers.size(); i++) {
ExeInfo const& exeInfo = executorMap[transfers[i].exeDevice];
printf("Transfer %03d:\n", i);
for (int iSrc = 0; iSrc < transfers[i].srcs.size(); ++iSrc)
printf(" SRC %0d: %p\n", iSrc, exeInfo.resources[i].srcMem[iSrc]);
for (int iDst = 0; iDst < transfers[i].dsts.size(); ++iDst)
printf(" DST %0d: %p\n", iDst, exeInfo.resources[i].dstMem[iDst]);
}
printf("Hit <Enter> to continue: ");
if (scanf("%*c") != 0) {
printf("[ERROR] Unexpected input\n");
exit(1);
}
printf("\n");
}

// Start CPU timing for this iteration
auto cpuStart = std::chrono::high_resolution_clock::now();
Expand Down

0 comments on commit 83fc9b3

Please sign in to comment.