P4 to Git Change 1120039 by emankov@em-hsa-amd on 2015/02/09 06:57:34

EPR #414091 - Compiler Lib/HSAIL: Fix for -fno-bin-cg on multiple kernels

	[Problem] If CL or BRIG contains multiple kernels, compilation with option -fno-bin-cg leads to finalizer error.

	[Solution] Check that all kernels are finalized before deleting BRIG from BIF. Actual deletion occurs after finalizing the last kernel.

	[Misc]
	+ fix erroneous successful exit from finalizing BRIG -> ISA function when BRIG is not extracted successfully
	+ string constants for symbol prefixes replaced on using findBIF30SymStruct
	+ obsolete __AMP_ is removed from code
	+ cosmetic changes in hsail_be
	+ test for the fix is added: ursa.pl -t complib -M-fno-bin-cg-g_multiple_kernels

	[Tests] pre check-in, make smoke, ursa complib, bingen test (from Benjamin Coquelle)

	[Reviewers] Brian Sumner, Artem Tamazov, Matthew Arsenault

Affected files ...

... //depot/stg/opencl/drivers/opencl/compiler/lib/backends/common/v0_8/if_acl.cpp#60 edit
... //depot/stg/opencl/drivers/opencl/compiler/lib/backends/gpu/hsail_be.cpp#37 edit
... //depot/stg/opencl/drivers/opencl/compiler/lib/backends/gpu/hsail_be.hpp#13 edit
... //depot/stg/opencl/drivers/opencl/tests/hsa/src/complib/options/-fbin-cg-g/HelloWorld_Kernel_cl.cl#2 edit
... //depot/stg/opencl/drivers/opencl/tests/hsa/src/complib/options/-fbin-cg/HelloWorld_Kernel_cl.cl#2 edit
... //depot/stg/opencl/drivers/opencl/tests/hsa/src/complib/options/-fno-bin-cg-g/HelloWorld_Kernel_cl.cl#2 edit
... //depot/stg/opencl/drivers/opencl/tests/hsa/src/complib/options/-fno-bin-cg-g_multiple_kernels/MM_Kernels.cl#1 add
... //depot/stg/opencl/drivers/opencl/tests/hsa/src/complib/options/-fno-bin-cg/HelloWorld_Kernel_cl.cl#2 edit
... //depot/stg/opencl/drivers/opencl/tests/hsa/tlst/complib.tlst#6 edit
此提交包含在:
foreman
2015-02-09 07:02:35 -05:00
父節點 1c804f9643
當前提交 d68ce71f32
+3 -10
查看文件
@@ -1224,22 +1224,15 @@ aclCompileInternal(
}
}
// Convert the input string into the device ISA binary.
if (useISA) {
ald = cl->beAPI.init(cl, bin, compile_callback, &error_code);
// AMDIL: Convert the input string into the device ISA binary.
// HSAIL: Converting BRIG in bin into the device ISA binary; input string isn't used.
error_code = cl->beAPI.finalize(ald, dataStr.data(), dataStr.length());
#ifdef WITH_TARGET_HSAIL
if (isHSAILTarget(bin->target) && error_code == ACL_SUCCESS) {
amdcl::HSAIL *acl = reinterpret_cast<amdcl::HSAIL*>(cl->cgAPI.init(cl, bin, compile_callback, &error_code));
if ((!checkFlag(aclutGetCaps(bin), capSaveCG) || !acl->Options()->oVariables->BinCG) && !acl->IsGlobalVarInBRIG()) {
oclBIFSymbolID brigSectionSymbolId[] = {symBRIGStrtab, symHSABinary, symBRIGOperands, symDebugInfo};
int symCount = sizeof(brigSectionSymbolId) / sizeof(brigSectionSymbolId[PRE]);
for(int i=0; i<symCount; ++i) {
const oclBIFSymbolStruct* sym = findBIF30SymStruct(brigSectionSymbolId[i]);
assert(sym && "symbol not found");
cl->clAPI.remSym(cl, bin, sym->sections[PRE], sym->str[PRE]);
}
}
acl->deleteBRIG();
}
#endif
cl->beAPI.fini(ald);