From d75064b5007efd4609aa5524e98ee13d914154ff Mon Sep 17 00:00:00 2001
From: foreman
Date: Wed, 19 Nov 2014 10:38:39 -0500
Subject: [PATCH] P4 to Git Change 1098569 by mbareghe@mbareghe_staging_win30
on 2014/11/19 10:23:56
EPR #409840 - [CQE OCL][LNX][QR] OpenCL SPIR Conf test "Compile_and_link" failed in all Asics due to CL#1098110 - Set the IR type to SPIR only for single SPIR modules.
Affected files ...
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpuprogram.cpp#184 edit
[ROCm/clr commit: f324bf5f808975313028d3b1fda7883022ef4ef7]
---
projects/clr/rocclr/runtime/device/gpu/gpuprogram.cpp | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/projects/clr/rocclr/runtime/device/gpu/gpuprogram.cpp b/projects/clr/rocclr/runtime/device/gpu/gpuprogram.cpp
index dcd9562bcb..b72f10b4e5 100644
--- a/projects/clr/rocclr/runtime/device/gpu/gpuprogram.cpp
+++ b/projects/clr/rocclr/runtime/device/gpu/gpuprogram.cpp
@@ -725,6 +725,8 @@ NullProgram::linkImpl(const std::vector& inputPrograms,
if (libs.size() > 0 && err == ACL_SUCCESS) do {
unsigned int numLibs = libs.size() - 1;
+ bool resultIsSPIR = (llvmBinaryIsSpir[0] && numLibs == 0);
+
if (numLibs > 0) {
err = aclLink(dev().compiler(), libs[0], numLibs, &libs[1],
ACL_TYPE_LLVMIR_BINARY, "-create-library", NULL);
@@ -739,7 +741,7 @@ NullProgram::linkImpl(const std::vector& inputPrograms,
size_t size = 0;
const void* llvmir = aclExtractSection(dev().compiler(), libs[0],
- &size, llvmBinaryIsSpir[0]?aclSPIR:aclLLVMIR, &err);
+ &size, resultIsSPIR?aclSPIR:aclLLVMIR, &err);
if (err != ACL_SUCCESS) {
LogWarning("aclExtractSection failed");
break;