From 6576f848615755d00be0962cafebb8c24a5e4a38 Mon Sep 17 00:00:00 2001
From: foreman
Date: Wed, 20 Sep 2017 11:38:12 -0400
Subject: [PATCH] P4 to Git Change 1461094 by
akasauro@akasauro_fiji1_opencl_rocm on 2017/09/20 11:23:36
SWDEV-118564 - [OCL-LC-ROCm] Remove options, which have already been moved to AMDGPUToolChain by https://reviews.llvm.org/rL312524
In order to have similar set of optipons for online and offline compilation a mechanism of setting default options in AMDGPUToolChain was implemented by https://reviews.llvm.org/rL312524. That commit also sets two default options in AMDGPUToolChain: -m64 and -O3 (the latter only set if there is no -O{N} option in the args). The commit has already reached amd-common.
The current change relates to LC only and removes setting of -m64 from compileImpl_LC() as it is set later in TranslateArgs(); for online -O{N} is set as before by RT and stays unchanged in AMDGPUToolChain; for offline it is set to -O3 by TranslateArgs() if no -O{N} is passed through args.
Also remove comments regarding "-x cl" as it is now correctly set in OpenCL driver.
Review: http://ocltc.amd.com/reviews/r/13454/
Affected files ...
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palcompiler.cpp#18 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/roccompiler.cpp#36 edit
[ROCm/clr commit: a348a08391227076b612551fd3df0b83b83727fa]
---
projects/clr/rocclr/runtime/device/pal/palcompiler.cpp | 5 +----
projects/clr/rocclr/runtime/device/rocm/roccompiler.cpp | 5 +----
2 files changed, 2 insertions(+), 8 deletions(-)
diff --git a/projects/clr/rocclr/runtime/device/pal/palcompiler.cpp b/projects/clr/rocclr/runtime/device/pal/palcompiler.cpp
index 17de21fdd5..f16455aea1 100644
--- a/projects/clr/rocclr/runtime/device/pal/palcompiler.cpp
+++ b/projects/clr/rocclr/runtime/device/pal/palcompiler.cpp
@@ -229,11 +229,11 @@ bool LightningProgram::compileImpl(const std::string& sourceCode,
}
// Set the options for the compiler
+ // Some options are set in Clang AMDGPUToolChain (like -m64)
std::ostringstream ostrstr;
std::copy(options->clangOptions.begin(), options->clangOptions.end(),
std::ostream_iterator(ostrstr, " "));
- ostrstr << " -m" << sizeof(void*) * 8;
std::string driverOptions(ostrstr.str());
const char* xLang = options->oVariables->XLang;
@@ -241,9 +241,6 @@ bool LightningProgram::compileImpl(const std::string& sourceCode,
buildLog_ += "Unsupported OpenCL language.\n";
}
- // FIXME_Nikolay: the program manager should be setting the language
- // driverOptions.append(" -x cl");
-
driverOptions.append(" -cl-std=").append(options->oVariables->CLStd);
// Set the -O#
diff --git a/projects/clr/rocclr/runtime/device/rocm/roccompiler.cpp b/projects/clr/rocclr/runtime/device/rocm/roccompiler.cpp
index da821ae1ab..ab945f7206 100644
--- a/projects/clr/rocclr/runtime/device/rocm/roccompiler.cpp
+++ b/projects/clr/rocclr/runtime/device/rocm/roccompiler.cpp
@@ -71,11 +71,11 @@ bool HSAILProgram::compileImpl_LC(const std::string& sourceCode,
}
// Set the options for the compiler
+ // Some options are set in Clang AMDGPUToolChain (like -m64)
std::ostringstream ostrstr;
std::copy(options->clangOptions.begin(), options->clangOptions.end(),
std::ostream_iterator(ostrstr, " "));
- ostrstr << " -m" << sizeof(void*) * 8;
std::string driverOptions(ostrstr.str());
const char* xLang = options->oVariables->XLang;
@@ -83,9 +83,6 @@ bool HSAILProgram::compileImpl_LC(const std::string& sourceCode,
buildLog_ += "Unsupported OpenCL language.\n";
}
- // FIXME_Nikolay: the program manager should be setting the language
- // driverOptions.append(" -x cl");
-
driverOptions.append(" -cl-std=").append(options->oVariables->CLStd);
// Set the -O#