P4 to Git Change 1487653 by wchau@wchau_OCL_boltzmann on 2017/11/28 11:28:09
SWDEV-119491 - Add support for cl_amd_assembly_program extension This is a sub-task of SWDEV-134396. Part 1/4 of the required changes: (1) OpenCL API / Runtime, (2) ROCm Runtime - compiler invocation, (3) ROCm Driver, (4) Enabling Extension Affected files ... ... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_common.hpp#19 edit ... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_context.cpp#57 edit ... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_program.cpp#45 edit ... //depot/stg/opencl/drivers/opencl/api/opencl/khronos/headers/opencl1.2/CL/cl_ext.h#19 edit ... //depot/stg/opencl/drivers/opencl/api/opencl/khronos/headers/opencl2.0/CL/cl_ext.h#35 edit ... //depot/stg/opencl/drivers/opencl/api/opencl/khronos/headers/opencl2.1/CL/cl_ext.h#12 edit ... //depot/stg/opencl/drivers/opencl/api/opencl/khronos/headers/opencl2.2/CL/cl_ext.h#6 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/device.cpp#215 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/device.hpp#293 edit ... //depot/stg/opencl/drivers/opencl/runtime/platform/program.cpp#90 edit ... //depot/stg/opencl/drivers/opencl/runtime/platform/program.hpp#42 edit
Этот коммит содержится в:
@@ -52,7 +52,7 @@ cl_int Program::addDeviceProgram(Device& device, const void* image, size_t lengt
|
||||
if (image != NULL && !amd::isElfMagic((const char*)image)
|
||||
#if !defined(WITH_LIGHTNING_COMPILER)
|
||||
&& !aclValidateBinaryImage(
|
||||
image, length, isSPIRV_ ? BINARY_TYPE_SPIRV : BINARY_TYPE_ELF | BINARY_TYPE_LLVM)
|
||||
image, length, language_ == SPIRV ? BINARY_TYPE_SPIRV : BINARY_TYPE_ELF | BINARY_TYPE_LLVM)
|
||||
#endif // !defined(WITH_LIGHTNING_COMPILER)
|
||||
) {
|
||||
return CL_INVALID_BINARY;
|
||||
@@ -104,7 +104,7 @@ cl_int Program::addDeviceProgram(Device& device, const void* image, size_t lengt
|
||||
aclBinaryFini(binary);
|
||||
}
|
||||
#endif // defined(WITH_COMPILER_LIB)
|
||||
options->oVariables->BinaryIsSpirv = isSPIRV_;
|
||||
options->oVariables->BinaryIsSpirv = language_ == SPIRV;
|
||||
device::Program* program = rootDev.createProgram(options);
|
||||
if (program == NULL) {
|
||||
return CL_OUT_OF_HOST_MEMORY;
|
||||
@@ -210,7 +210,7 @@ cl_int Program::compile(const std::vector<Device*>& devices, size_t numHeaders,
|
||||
devProgram = getDeviceProgram(**it);
|
||||
}
|
||||
|
||||
if (devProgram->type() == device::Program::TYPE_INTERMEDIATE || isSPIRV_) {
|
||||
if (devProgram->type() == device::Program::TYPE_INTERMEDIATE || language_ == SPIRV) {
|
||||
continue;
|
||||
}
|
||||
// We only build a Device-Program once
|
||||
@@ -284,8 +284,8 @@ cl_int Program::link(const std::vector<Device*>& devices, size_t numInputs,
|
||||
bool found = false;
|
||||
for (size_t i = 0; i < numInputs; ++i) {
|
||||
Program& inputProgram = *inputPrograms[i];
|
||||
if (inputProgram.isSPIRV_) {
|
||||
parsedOptions.oVariables->BinaryIsSpirv = inputProgram.isSPIRV_;
|
||||
if (inputProgram.language_ == SPIRV) {
|
||||
parsedOptions.oVariables->BinaryIsSpirv = true;
|
||||
}
|
||||
deviceprograms_t inputDevProgs = inputProgram.devicePrograms();
|
||||
deviceprograms_t::const_iterator findIt = inputDevProgs.find(*it);
|
||||
@@ -492,6 +492,11 @@ cl_int Program::build(const std::vector<Device*>& devices, const char* options,
|
||||
|
||||
parsedOptions.oVariables->AssumeAlias = true;
|
||||
|
||||
if (language_ == Assembly) {
|
||||
constexpr char asmLang[] = "asm";
|
||||
parsedOptions.oVariables->XLang = asmLang;
|
||||
}
|
||||
|
||||
// We only build a Device-Program once
|
||||
if (devProgram->buildStatus() != CL_BUILD_NONE) {
|
||||
continue;
|
||||
|
||||
Ссылка в новой задаче
Block a user