From eb443eed01fc94a11400a1dc892c3dcbd88bc9f2 Mon Sep 17 00:00:00 2001
From: foreman
Date: Mon, 7 Jul 2014 11:50:43 -0400
Subject: [PATCH] P4 to Git Change 1052695 by jatang@jatang-opencl-hsa-stg1 on
2014/07/07 11:41:00
EPR #375978 - Print 3-component vectors correctly.
Simplify the change.
Affected files ...
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpuprintf.cpp#35 edit
[ROCm/clr commit: 3e434ca28953097ba71c21d5e3d9ab63d082b1be]
---
projects/clr/rocclr/runtime/device/gpu/gpuprintf.cpp | 11 ++---------
1 file changed, 2 insertions(+), 9 deletions(-)
diff --git a/projects/clr/rocclr/runtime/device/gpu/gpuprintf.cpp b/projects/clr/rocclr/runtime/device/gpu/gpuprintf.cpp
index 45c7eb23e6..7981c7b452 100644
--- a/projects/clr/rocclr/runtime/device/gpu/gpuprintf.cpp
+++ b/projects/clr/rocclr/runtime/device/gpu/gpuprintf.cpp
@@ -488,18 +488,11 @@ PrintfDbg::outputDbgBuffer(const PrintfInfo& info, const uint32_t* workitemData,
i += amd::alignUp(length, sizeof(uint32_t)) / sizeof(uint32_t);
}
else {
- size_t elemSize;
+ // 3-component vector's size is defined as 4 * size of each scalar component
+ size_t elemSize = info.arguments_[j] / (vectorSize == 3 ? 4 : vectorSize);
size_t k = i * sizeof(uint32_t);
std::string elementStr = fmt.substr(idPos, fmt.size());
- if (vectorSize == 3) {
- // 3-component vector's size is defined as 4 * size of each scalar component
- elemSize = info.arguments_[j] / 4;
- }
- else {
- elemSize = info.arguments_[j] / vectorSize;
- }
-
// Print first element with full string
if (0 == outputArgument(fmt, printFloat, elemSize, &s[i])) {
return;