Skip to content

Commit 9ec17d7

Browse files
Fixing some Makefile issues, Null memory parsing (#231)
1 parent fb07c30 commit 9ec17d7

5 files changed

Lines changed: 36 additions & 18 deletions

File tree

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@
33
Documentation for TransferBench is available at
44
[https://rocm.docs.amd.com/projects/TransferBench](https://rocm.docs.amd.com/projects/TransferBench).
55

6+
## v1.66.01
7+
## Fixed
8+
- Adding support for TheRock
9+
- Fixing parsing issue when using NULL memory type
10+
- Fixing CUAD compilation flags when enabling NIC/MPI
11+
## Modified
12+
- TransferBenchCuda must now be explicitly built with via 'make TransferBenchCuda'
13+
614
## v1.66.00
715
### Added
816
- Adding multi-node support

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ if (NOT CMAKE_TOOLCHAIN_FILE)
99
message(STATUS "CMAKE_TOOLCHAIN_FILE: ${CMAKE_TOOLCHAIN_FILE}")
1010
endif()
1111

12-
set(VERSION_STRING "1.66.00")
12+
set(VERSION_STRING "1.66.01")
1313
project(TransferBench VERSION ${VERSION_STRING} LANGUAGES CXX)
1414

1515
## Load CMake modules

Makefile

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,21 @@ SINGLE_KERNEL ?= 0
2626
# Default is the native GPU target
2727
GPU_TARGETS ?= native
2828

29+
EXE=TransferBench
2930
DEBUG ?= 0
3031

32+
# Only perform this check if 'make clean' is not the target
3133
ifeq ($(filter clean,$(MAKECMDGOALS)),)
32-
# Compile TransferBenchCuda if nvidia-smi returns successfully and nvcc detected
33-
ifeq ("$(shell nvidia-smi > /dev/null 2>&1 && test -e $(NVCC) && echo found)", "found")
34-
EXE=TransferBenchCuda
35-
CXX=$(NVCC)
34+
ifeq ($(MAKECMDGOALS),TransferBenchCuda)
35+
# Check for nvcc
36+
ifneq ($(shell test -e $(NVCC) && echo found), found)
37+
$(error "Could not find $(NVCC). Please set CUDA_PATH appropriately")
38+
else
39+
$(info Compiling TransferBenchCuda using $(NVCC))
40+
endif
41+
NVFLAGS = -x cu -lnuma -arch=native
3642
else
37-
EXE=TransferBench
43+
# Check for HIP compiler
3844
ifeq ("$(shell test -e $(HIPCC) && echo found)", "found")
3945
CXX=$(HIPCC)
4046
else ifeq ("$(shell test -e $(ROCM_PATH)/bin/hipcc && echo found)", "found")
@@ -44,18 +50,17 @@ ifeq ($(filter clean,$(MAKECMDGOALS)),)
4450
$(error "Could not find $(HIPCC) or $(ROCM_PATH)/bin/hipcc. Check if the path is correct if you want to build $(EXE)")
4551
endif
4652
GPU_TARGETS_FLAGS = $(foreach target,$(GPU_TARGETS),"--offload-arch=$(target)")
47-
endif
4853

49-
CXXFLAGS = -I$(ROCM_PATH)/include -I$(ROCM_PATH)/include/hip -I$(ROCM_PATH)/include/hsa
50-
HIPLDFLAGS= -lnuma -L$(ROCM_PATH)/lib -lhsa-runtime64 -lamdhip64
51-
HIPFLAGS = -Wall -x hip -D__HIP_PLATFORM_AMD__ -D__HIPCC__ $(GPU_TARGETS_FLAGS)
52-
ifneq ($(strip $(ROCM_DEVICE_LIB_PATH)),)
53-
HIPFLAGS += --rocm-device-lib-path=$(ROCM_DEVICE_LIB_PATH)
54+
CXXFLAGS = -I$(ROCM_PATH)/include -I$(ROCM_PATH)/include/hip -I$(ROCM_PATH)/include/hsa
55+
HIPLDFLAGS= -lnuma -L$(ROCM_PATH)/lib -lhsa-runtime64 -lamdhip64
56+
HIPFLAGS = -Wall -x hip -D__HIP_PLATFORM_AMD__ -D__HIPCC__ $(GPU_TARGETS_FLAGS)
57+
ifneq ($(strip $(ROCM_DEVICE_LIB_PATH)),)
58+
HIPFLAGS += --rocm-device-lib-path=$(ROCM_DEVICE_LIB_PATH)
59+
endif
5460
endif
55-
NVFLAGS = -x cu -lnuma -arch=native
5661

5762
ifeq ($(SINGLE_KERNEL), 1)
58-
CXXFLAGS += -DSINGLE_KERNEL
63+
COMMON_FLAGS += -DSINGLE_KERNEL
5964
endif
6065

6166
ifeq ($(DEBUG), 0)
@@ -79,7 +84,7 @@ ifeq ($(filter clean,$(MAKECMDGOALS)),)
7984
else ifeq ("$(shell echo '#include <infiniband/verbs.h>' | $(CXX) -E - 2>/dev/null | grep -c 'infiniband/verbs.h')", "0")
8085
$(info infiniband/verbs.h not found)
8186
else
82-
CXXFLAGS += -DNIC_EXEC_ENABLED
87+
COMMON_FLAGS += -DNIC_EXEC_ENABLED
8388
LDFLAGS += -libverbs
8489
NIC_ENABLED = 1
8590
endif
@@ -101,7 +106,7 @@ ifeq ($(filter clean,$(MAKECMDGOALS)),)
101106
$(info Unable to find mpi.h at $(MPI_PATH)/include. Please specify appropriate MPI_PATH)
102107
else
103108
MPI_ENABLED = 1
104-
CXXFLAGS += -DMPI_COMM_ENABLED -I$(MPI_PATH)/include
109+
COMMON_FLAGS += -DMPI_COMM_ENABLED -I$(MPI_PATH)/include
105110
LDFLAGS += -L/$(MPI_PATH)/lib -lmpi
106111
ifeq ($(DEBUG), 1)
107112
LDFLAGS += -lmpi_cxx

src/client/EnvVars.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ THE SOFTWARE.
4040
#include <random>
4141
#include <time.h>
4242

43-
#define CLIENT_VERSION "00"
43+
#define CLIENT_VERSION "01"
4444

4545
#include "TransferBench.hpp"
4646
using namespace TransferBench;

src/header/TransferBench.hpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1176,14 +1176,19 @@ namespace {
11761176
}
11771177

11781178
// Parse memory type
1179-
ERR_CHECK(CharToMemType(*ptr, w.memType));
1179+
ErrResult err = CharToMemType(*ptr, w.memType);
1180+
if (err.errType != ERR_NONE) {
1181+
return {err.errType, "Error parsing token [%s]: %s\n", token.c_str(), err.errMsg.c_str()};
1182+
}
11801183
ptr++; // Skip memory type
11811184

11821185
// Parse memory index
11831186
if (w.memType != MEM_NULL) {
11841187
ptr = ParseRange(ptr, -1, w.memIndices);
11851188
if (!ptr) return {ERR_FATAL, "Unable to parse device index in memory token %s", token.c_str()};
11861189
memDevices.push_back(w);
1190+
} else {
1191+
break;
11871192
}
11881193
}
11891194
return ERR_NONE;

0 commit comments

Comments
 (0)