From 641fd3c85c3bfd5304dea8e2615c6e96d008af7a Mon Sep 17 00:00:00 2001
From: foreman
Date: Thu, 29 Mar 2018 13:50:06 -0400
Subject: [PATCH] P4 to Git Change 1534546 by emankov@em-hsa on 2018/03/29
13:38:05
SWDEV-143465 - HSAIL/AMDIL - Compiler Lib - Add missing error logging
Missing appendLogToCL is added to IsValidCompilationOption functions.
[testing] http://ocltc.amd.com:8111/viewModification.html?modId=100104&personal=true&tab=vcsModificationBuilds
[reviewed] by Stas (http://ocltc.amd.com/reviews/r/14522)
Affected files ...
... //depot/stg/opencl/drivers/opencl/compiler/legacy-lib/backends/common/v0_8/if_acl.cpp#12 edit
... //depot/stg/opencl/drivers/opencl/compiler/lib/backends/common/v0_8/if_acl.cpp#100 edit
---
rocclr/compiler/lib/backends/common/v0_8/if_acl.cpp | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/rocclr/compiler/lib/backends/common/v0_8/if_acl.cpp b/rocclr/compiler/lib/backends/common/v0_8/if_acl.cpp
index a78e58a3b6..a5443a5202 100644
--- a/rocclr/compiler/lib/backends/common/v0_8/if_acl.cpp
+++ b/rocclr/compiler/lib/backends/common/v0_8/if_acl.cpp
@@ -1418,7 +1418,7 @@ internal_compile_failure:
#define CONDITIONAL_CMP_ASSIGN(A, B, C) A = (A && B != A) ? (A) : (C)
acl_error
-IsValidCompilationOptions(aclBinary *bin, aclLogFunction compile_callback)
+IsValidCompilationOptions(aclCompiler *cl, aclBinary *bin, aclLogFunction compile_callback)
{
acl_error error_code = ACL_SUCCESS;
#if defined(WITH_TARGET_HSAIL)
@@ -1467,8 +1467,13 @@ IsValidCompilationOptions(aclBinary *bin, aclLogFunction compile_callback)
}
}
}
- if (ACL_SUCCESS != error_code && compile_callback) {
- compile_callback(error_msg.c_str(), error_msg.size());
+ if (ACL_SUCCESS != error_code) {
+ if (compile_callback) {
+ compile_callback(error_msg.c_str(), error_msg.size());
+ }
+ if (cl != NULL) {
+ appendLogToCL(cl, error_msg.c_str());
+ }
}
#endif
return error_code;
@@ -1490,7 +1495,7 @@ if_aclCompile(aclCompiler *cl,
((from == ACL_TYPE_HSAIL_TEXT || from == ACL_TYPE_HSAIL_BINARY) && !isHSAILTarget(bin->target))) {
return ACL_INVALID_BINARY;
}
- acl_error error_code = IsValidCompilationOptions(bin, compile_callback);
+ acl_error error_code = IsValidCompilationOptions(cl, bin, compile_callback);
if (error_code != ACL_SUCCESS) {
return error_code;
}