From 275a36ee47d76333f4a23d350a2ce85d5f8ca10d Mon Sep 17 00:00:00 2001 From: Ben Sander Date: Sat, 13 Feb 2016 03:17:42 -0600 Subject: [PATCH] Enable -O3, style points on array size [ROCm/clr commit: 56b3d2e7c499996538786ed9d24bf9041df373ed] --- .../clr/hipamd/samples/1_Utils/hipBusBandwidth/Makefile | 3 ++- .../samples/1_Utils/hipBusBandwidth/hipBusBandwidth.cpp | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/projects/clr/hipamd/samples/1_Utils/hipBusBandwidth/Makefile b/projects/clr/hipamd/samples/1_Utils/hipBusBandwidth/Makefile index d233216313..77a92fb1a6 100644 --- a/projects/clr/hipamd/samples/1_Utils/hipBusBandwidth/Makefile +++ b/projects/clr/hipamd/samples/1_Utils/hipBusBandwidth/Makefile @@ -2,11 +2,12 @@ HIP_PATH?=$(shell hipconfig -p) HIPCC=$(HIP_PATH)/bin/hipcc EXE=hipBusBandwidth +CXXFLAGS = -O3 -g all: install $(EXE): hipBusBandwidth.cpp ResultDatabase.cpp - $(HIPCC) $^ -o $@ + $(HIPCC) $(CXXFLAGS) $^ -o $@ install: $(EXE) cp $(EXE) $(HIP_PATH)/bin diff --git a/projects/clr/hipamd/samples/1_Utils/hipBusBandwidth/hipBusBandwidth.cpp b/projects/clr/hipamd/samples/1_Utils/hipBusBandwidth/hipBusBandwidth.cpp index b847f8db40..d276725921 100644 --- a/projects/clr/hipamd/samples/1_Utils/hipBusBandwidth/hipBusBandwidth.cpp +++ b/projects/clr/hipamd/samples/1_Utils/hipBusBandwidth/hipBusBandwidth.cpp @@ -52,9 +52,9 @@ bool p_d2h = true; void RunBenchmark_H2D(ResultDatabase &resultDB) { // Sizes are in kb - int nSizes = 20; - int sizes[20] = {1,2,4,8,16,32,64,128,256,512,1024,2048,4096,8192,16384, - 32768,65536,131072,262144,524288}; + int sizes[] = {1,2,4,8,16,32,64,128,256,512,1024,2048,4096,8192,16384, 32768,65536,131072,262144,524288}; + int nSizes = sizeof(sizes) / sizeof(int); + long long numMaxFloats = 1024 * (sizes[nSizes-1]) / 4; hipSetDevice(p_device);