From f517eefd51ef895f494e4ef7371085d16d85a220 Mon Sep 17 00:00:00 2001
From: foreman
Date: Wed, 10 Sep 2014 15:04:08 -0400
Subject: [PATCH] P4 to Git Change 1075455 by shxiao@profilerworksp on
2014/09/10 14:12:27
EPR #403493 - Block index error for CI and VI, OCL code change
Problem description: The OCL implementation requires HSA to used different block index values for CI and VI. However, the same index value is used for the same counter block in both CI and VI, which in turn caused a segmentation fault.
Root cause: HSA implementation does not know this situation before hand.
Solution: Fix to use different counter block index in CI from that in VI
Functional area: HSA perf counter implementation...
Affected files ...
... //depot/stg/opencl/drivers/opencl/runtime/device/hsa/hsacounters.cpp#4 edit
---
rocclr/runtime/device/hsa/hsacounters.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/rocclr/runtime/device/hsa/hsacounters.cpp b/rocclr/runtime/device/hsa/hsacounters.cpp
index 0b9e2c1c73..448d7f6d03 100644
--- a/rocclr/runtime/device/hsa/hsacounters.cpp
+++ b/rocclr/runtime/device/hsa/hsacounters.cpp
@@ -40,7 +40,7 @@ PerfCounter::create(HsaPmu hsaPmu)
{
HsaStatus status;
hsaPmu_ = hsaPmu;
- HsaCounterBlockId blockIndex = static_cast(info()->blockIndex_);
+ uint32_t blockIndex = static_cast(info()->blockIndex_);
status = servicesapi->HsaPmuGetCounterBlockById(hsaPmu_, blockIndex, &counter_block_);
if (status != kHsaStatusSuccess) {
LogError("HsaPmuGetCounterBlockById, failed");