From 87f42bdb73c739d266b2a1c618b4dd91fa0460ab Mon Sep 17 00:00:00 2001 From: foreman Date: Wed, 28 Feb 2018 13:07:35 -0500 Subject: [PATCH] P4 to Git Change 1520850 by kzhuravl@kzhuravl-fiji-ocllc on 2018/02/28 13:01:41 SWDEV-129762 - Remove following macros that are passed through the command line to the lightning compiler: -D__AMD__=1 -D__devicename=1 -D__devicename__=1 -DFP_FAST_FMA=1 -DFP_FAST_FMAF=1 Affected files ... ... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palprogram.cpp#54 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocprogram.cpp#79 edit --- rocclr/runtime/device/pal/palprogram.cpp | 4 ++++ rocclr/runtime/device/rocm/rocprogram.cpp | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/rocclr/runtime/device/pal/palprogram.cpp b/rocclr/runtime/device/pal/palprogram.cpp index b8d664c3c1..989ead020c 100644 --- a/rocclr/runtime/device/pal/palprogram.cpp +++ b/rocclr/runtime/device/pal/palprogram.cpp @@ -714,10 +714,12 @@ void HSAILProgram::releaseClBinary() { std::string HSAILProgram::hsailOptions(amd::option::Options* options) { std::string hsailOptions; +#ifndef WITH_LIGHTNING_COMPILER hsailOptions.append(" -D__AMD__=1"); hsailOptions.append(" -D__").append(device().info().name_).append("__=1"); hsailOptions.append(" -D__").append(device().info().name_).append("=1"); +#endif int major, minor; ::sscanf(device().info().version_, "OpenCL %d.%d ", &major, &minor); @@ -732,6 +734,7 @@ std::string HSAILProgram::hsailOptions(amd::option::Options* options) { hsailOptions.append(" -D__IMAGE_SUPPORT__=1"); } +#ifndef WITH_LIGHTNING_COMPILER // Set options for the standard device specific options // All our devices support these options now if (dev().settings().reportFMAF_) { @@ -740,6 +743,7 @@ std::string HSAILProgram::hsailOptions(amd::option::Options* options) { if (dev().settings().reportFMA_) { hsailOptions.append(" -DFP_FAST_FMA=1"); } +#endif uint clcStd = (options->oVariables->CLStd[2] - '0') * 100 + (options->oVariables->CLStd[4] - '0') * 10; diff --git a/rocclr/runtime/device/rocm/rocprogram.cpp b/rocclr/runtime/device/rocm/rocprogram.cpp index 10c6d6d0e1..fc91ff0179 100644 --- a/rocclr/runtime/device/rocm/rocprogram.cpp +++ b/rocclr/runtime/device/rocm/rocprogram.cpp @@ -312,10 +312,12 @@ std::string Program::preprocessorOptions(amd::option::Options* options) { // Set options for the standard device specific options +#ifndef WITH_LIGHTNING_COMPILER optionsStr.append(" -D__AMD__=1"); optionsStr.append(" -D__").append(device().info().name_).append("__=1"); optionsStr.append(" -D__").append(device().info().name_).append("=1"); +#endif int major, minor; ::sscanf(device().info().version_, "OpenCL %d.%d ", &major, &minor); @@ -328,6 +330,7 @@ std::string Program::preprocessorOptions(amd::option::Options* options) { optionsStr.append(" -D__IMAGE_SUPPORT__=1"); } +#ifndef WITH_LIGHTNING_COMPILER // This is just for legacy compiler code // All our devices support these options now if (options->oVariables->FastFMA) { @@ -336,6 +339,7 @@ std::string Program::preprocessorOptions(amd::option::Options* options) { if (options->oVariables->FastFMAF) { optionsStr.append(" -DFP_FAST_FMAF=1"); } +#endif uint clcStd = (options->oVariables->CLStd[2] - '0') * 100 + (options->oVariables->CLStd[4] - '0') * 10;