P4 to Git Change 1333167 by lmoriche@lmoriche_opencl_dev on 2016/10/28 02:41:50

SWDEV-105604 - [OCL-LC-PAL] OpenCL program manager for LC on PAL
	- Remove cl_khr_depth_images from the extension list for CL2.0 since it is already defined in opencl-c.h

Affected files ...

... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palcompiler.cpp#7 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palprogram.cpp#18 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palprogram.hpp#12 edit


[ROCm/clr commit: 47ec8d3e89]
Αυτή η υποβολή περιλαμβάνεται σε:
foreman
2016-10-28 02:55:43 -04:00
γονέας fc11a0036e
υποβολή 25f767027d
3 αρχεία άλλαξαν με 15 προσθήκες και 11 διαγραφές
@@ -135,7 +135,7 @@ HSAILProgram::compileImpl(
#endif
// Compile source to IR
compileOptions_.append(hsailOptions());
compileOptions_.append(hsailOptions(options));
errorCode = aclCompile(dev().compiler(), binaryElf_, compileOptions_.c_str(),
ACL_TYPE_OPENCL, ACL_TYPE_LLVMIR_BINARY, nullptr);
buildLog_ += aclGetCompilerLog(dev().compiler());
@@ -248,7 +248,7 @@ LightningProgram::compileImpl(
driverOptions.append(mCPU.str());
driverOptions.append(options->llvmOptions);
driverOptions.append(hsailOptions());
driverOptions.append(hsailOptions(options));
//Find the temp folder for the OS
std::string tempFolder = amd::Os::getEnvironment("TEMP");
@@ -598,7 +598,7 @@ HSAILProgram::linkImpl(amd::option::Options* options)
// Compilation from ACL_TYPE_HSAIL_TEXT to ACL_TYPE_CG in cases:
// 1. if the program is created with binary and contains only hsail text
case ACL_TYPE_HSAIL_TEXT: {
std::string curOptions = options->origOptionStr + hsailOptions();
std::string curOptions = options->origOptionStr + hsailOptions(options);
errorCode = aclCompile(dev().compiler(), binaryElf_,
curOptions.c_str(), continueCompileFrom, ACL_TYPE_CG, nullptr);
buildLog_ += aclGetCompilerLog(dev().compiler());
@@ -618,7 +618,7 @@ HSAILProgram::linkImpl(amd::option::Options* options)
return false;
}
if (finalize) {
std::string fin_options(options->origOptionStr + hsailOptions());
std::string fin_options(options->origOptionStr + hsailOptions(options));
// Append an option so that we can selectively enable a SCOption on CZ
// whenever IOMMUv2 is enabled.
if (dev().settings().svmFineGrainSystem_) {
@@ -681,7 +681,7 @@ HSAILProgram::linkImpl(amd::option::Options* options)
std::string kernelName(*it);
std::string openclKernelName = device::Kernel::openclMangledName(kernelName);
HSAILKernel *aKernel = new HSAILKernel(kernelName, this, options->origOptionStr + hsailOptions());
HSAILKernel *aKernel = new HSAILKernel(kernelName, this, options->origOptionStr + hsailOptions(options));
kernels()[kernelName] = aKernel;
amd::hsa::loader::Symbol *sym = executable_->GetSymbol("", openclKernelName.c_str(), agent, 0);
@@ -741,7 +741,7 @@ HSAILProgram::releaseClBinary()
}
std::string
HSAILProgram::hsailOptions()
HSAILProgram::hsailOptions(amd::option::Options* options)
{
std::string hsailOptions;
// Set options for the standard device specific options
@@ -767,9 +767,13 @@ HSAILProgram::hsailOptions()
iss.str(device().info().extensions_);
while (getline(iss, token, ' ')) {
if (!token.empty()) {
hsailOptions.append(" -D");
hsailOptions.append(token);
hsailOptions.append("=1");
#if defined(WITH_LIGHTNING_COMPILER)
// FIXME_lmoriche: opencl-c.h defines 'cl_khr_depth_images', so
// remove it from the command line. Should we fix opencl-c.h?
if (options->oVariables->CLStd[2] >= '2'
&& token == "cl_khr_depth_images") continue;
#endif // defined(WITH_LIGHTHNING_COMPILER)
hsailOptions.append(" -D").append(token).append("=1");
}
}
return hsailOptions;
@@ -1347,7 +1351,7 @@ LightningProgram::setKernels(
for (auto &kernelName : kernelNameList) {
auto kernel = new LightningKernel(
kernelName, this, options->origOptionStr + hsailOptions());
kernelName, this, options->origOptionStr + hsailOptions(options));
kernels()[kernelName] = kernel;
@@ -257,7 +257,7 @@ private:
protected:
//! Returns all the options to be appended while passing to the
//compiler library
std::string hsailOptions();
std::string hsailOptions(amd::option::Options* options);
//! Allocate kernel table
bool allocKernelTable();