From bf9217468e63510c44d42907bb0dee7e6ac2127b Mon Sep 17 00:00:00 2001
From: foreman
Date: Thu, 1 Dec 2016 14:54:04 -0500
Subject: [PATCH] P4 to Git Change 1348313 by gandryey@gera-w8 on 2016/12/01
14:38:56
SWDEV-98415 - [CQE OCL][OpenCL on PAL] Failures/Crash is observed with multiple modules of ocltst
- Fix a regression with oflline compilation. Mark null program.
Affected files ...
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palprogram.cpp#26 edit
---
rocclr/runtime/device/pal/palprogram.cpp | 3 +++
1 file changed, 3 insertions(+)
diff --git a/rocclr/runtime/device/pal/palprogram.cpp b/rocclr/runtime/device/pal/palprogram.cpp
index 714dca7af3..19f4fc38c4 100644
--- a/rocclr/runtime/device/pal/palprogram.cpp
+++ b/rocclr/runtime/device/pal/palprogram.cpp
@@ -166,6 +166,7 @@ HSAILProgram::HSAILProgram(NullDevice& device)
, loaderContext_(this)
{
memset(&binOpts_, 0, sizeof(binOpts_));
+ isNull_ = true;
binOpts_.struct_size = sizeof(binOpts_);
binOpts_.elfclass = LP64_SWITCH(ELFCLASS32, ELFCLASS64);
binOpts_.bitness = ELFDATA2LSB;
@@ -754,9 +755,11 @@ HSAILProgram::hsailOptions(amd::option::Options* options)
int major, minor;
::sscanf(device().info().version_, "OpenCL %d.%d ", &major, &minor);
+#ifdef WITH_LIGHTNING_COMPILER
std::stringstream ss;
ss << " -D__OPENCL_VERSION__=" << (major * 100 + minor * 10);
hsailOptions.append(ss.str());
+#endif
if (device().info().imageSupport_ && options->oVariables->ImageSupport) {
hsailOptions.append(" -D__IMAGE_SUPPORT__=1");