From f70dc3c2451bc2d187f05c4ba62dcc17a59b671e Mon Sep 17 00:00:00 2001 From: Ben Sander Date: Tue, 22 Mar 2016 09:27:10 -0500 Subject: [PATCH] Only include activity logger if CodeXL installed. Fix hipHostMalloc in hipBusBandwidth. [ROCm/clr commit: 004b4ada93d133850902538d3b46c6aa60d041e5] --- projects/clr/hipamd/bin/hipcc | 6 +++++- .../samples/1_Utils/hipBusBandwidth/hipBusBandwidth.cpp | 8 ++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/projects/clr/hipamd/bin/hipcc b/projects/clr/hipamd/bin/hipcc index fbb8aa9775..1c850bbfe0 100755 --- a/projects/clr/hipamd/bin/hipcc +++ b/projects/clr/hipamd/bin/hipcc @@ -79,7 +79,11 @@ if ($HIP_PLATFORM eq "hcc") { $HIPLDFLAGS .= " -L$HSA_PATH/lib -lhsa-runtime64 -lhc_am"; # Add trace marker library: - $HIPLDFLAGS .= " -L$marker_path/bin/x86_64 -lAMDTActivityLogger"; + + $marker_lib_path = "$marker_path/bin/x86_64"; + if (-e $marker_lib_path) { + $HIPLDFLAGS .= " -L$marker_lib_path -lAMDTActivityLogger"; + } # Add C++ libs for GCC. $HIPLDFLAGS .= " -lstdc++"; diff --git a/projects/clr/hipamd/samples/1_Utils/hipBusBandwidth/hipBusBandwidth.cpp b/projects/clr/hipamd/samples/1_Utils/hipBusBandwidth/hipBusBandwidth.cpp index 2230a8eef7..faff9ba6e9 100644 --- a/projects/clr/hipamd/samples/1_Utils/hipBusBandwidth/hipBusBandwidth.cpp +++ b/projects/clr/hipamd/samples/1_Utils/hipBusBandwidth/hipBusBandwidth.cpp @@ -278,9 +278,9 @@ void RunBenchmark_D2H(ResultDatabase &resultDB) return; } numMaxFloats = 1024 * (sizes[nSizes-1]) / 4; - hipMallocHost((void**)&hostMem1, sizeof(float)*numMaxFloats); + hipHostMalloc((void**)&hostMem1, sizeof(float)*numMaxFloats); err1 = hipGetLastError(); - hipMallocHost((void**)&hostMem2, sizeof(float)*numMaxFloats); + hipHostMalloc((void**)&hostMem2, sizeof(float)*numMaxFloats); err2 = hipGetLastError(); } } @@ -413,8 +413,8 @@ void RunBenchmark_Bidir(ResultDatabase &resultDB) { while (1) { - hipError_t e1 = hipMallocHost((void**)&hostMem[0], sizeof(float) * numMaxFloats); - hipError_t e2 = hipMallocHost((void**)&hostMem[1], sizeof(float) * numMaxFloats); + hipError_t e1 = hipHostMalloc((void**)&hostMem[0], sizeof(float) * numMaxFloats); + hipError_t e2 = hipHostMalloc((void**)&hostMem[1], sizeof(float) * numMaxFloats); if ((e1 == hipSuccess) && (e2 == hipSuccess)) { break;