P4 to Git Change 1487815 by emankov@em-hsa-lightning on 2017/11/28 16:19:33

SWDEV-134396 - cl_amd_assembly_program extension support. Part 2 of 4. Rocm Runtime: Compiler invocation.

	precheckin:
	http://ocltc.amd.com:8111/viewModification.html?modId=94552&personal=true&init=1&tab=vcsModificationBuilds

	reviewed by:
	German Andryeyev

Affected files ...

... //depot/stg/opencl/drivers/opencl/compiler/lib/include/v0_8/aclEnums.h#27 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/roccompiler.cpp#40 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocprogram.cpp#77 edit


[ROCm/clr commit: a5884cdbf4]
Tá an tiomantas seo le fáil i:
foreman tiomanta 2017-11-28 16:25:11 -05:00
1 tuismitheoir f898f91b38
tiomantas 8917c073fa
3 comhad athraithe
+144 -110

Níor tháinig aon chomhaid le do chuardach

@@ -165,13 +165,25 @@ bool HSAILProgram::compileImpl(const std::string& sourceCode,
#if defined(WITH_LIGHTNING_COMPILER)
bool LightningProgram::compileImpl(const std::string& sourceCode,
const std::vector<const std::string*>& headers,
const char** headerIncludeNames, amd::option::Options* options) {
const std::vector<const std::string*>& headers,
const char** headerIncludeNames, amd::option::Options* options) {
const char* xLang = options->oVariables->XLang;
if (xLang != nullptr) {
if (strcmp(xLang,"asm") == 0) {
clBinary()->elfOut()->addSection(amd::OclElf::SOURCE, sourceCode.data(), sourceCode.size());
return true;
} else if (!strcmp(xLang,"cl")) {
buildLog_ += "Unsupported language: \"" + std::string(xLang) + "\".\n";
return false;
}
}
using namespace amd::opencl_driver;
amd::opencl_driver::DataType inputType(DT_CL);
std::unique_ptr<Compiler> C(newCompilerInstance());
std::vector<Data*> inputs;
Data* input = C->NewBufferReference(DT_CL, sourceCode.c_str(), sourceCode.length());
Data* input = C->NewBufferReference(inputType, sourceCode.c_str(), sourceCode.length());
if (input == nullptr) {
buildLog_ += "Error while creating data from source code";
return false;
@@ -193,11 +205,6 @@ bool LightningProgram::compileImpl(const std::string& sourceCode,
std::string driverOptions(ostrstr.str());
const char* xLang = options->oVariables->XLang;
if (xLang != nullptr && strcmp(xLang, "cl")) {
buildLog_ += "Unsupported OpenCL language.\n";
}
// FIXME_Nikolay: the program manager should be setting the language
// driverOptions.append(" -x cl");