P4 to Git Change 1208096 by ashi1@ashi1_win50 on 2015/11/05 18:20:58

SWDEV-80864 - HSAIL Metadata Workgroup Size Hint and Vec Type Hint added to HSAIL Runtime

	Runtime changes required for the use of these two metadata:
	  - Runtime's gpukernel.cpp requires new aclQueries during HSAILKernel::Init
	    - One for quering WorkGroupSizeHint's array
	    - Two for size of VecTypeHint and fetching VecTypeHint's string
	  - initArgList needs to be moved to end of HSAILKernel::init to allow createSignature to get non empty values
	  - Compiler lib's workgroup hint (wsh) needs to match runtime's type (size_t)
	  - In Kernel constructor, instead of using memset which corrupts std::string, specifically set default workGroupInfo struct's variables

	Also fixed wavesPerSimdHint to use size_t to match runtime.
	Updated CLAssumptionCheck.cpp since aclMetadata structure was modified.

	Note: This is the runtime counterpart to submitted CL#1204512. (Post Review#8808, SWDEV-79695)

Affected files ...

... //depot/stg/opencl/drivers/opencl/compiler/legacy-lib/include/v0_8/aclStructs.h#5 edit
... //depot/stg/opencl/drivers/opencl/compiler/lib/include/v0_8/aclStructs.h#22 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/device.hpp#260 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpukernel.cpp#308 edit
... //depot/stg/opencl/drivers/opencl/tests/ocltst/module/complib/CLAssumptionCheck.cpp#48 edit
Этот коммит содержится в:
foreman
2015-11-05 18:28:26 -05:00
родитель 3e4332a85f
Коммит b9fcb50bbc
3 изменённых файлов: 68 добавлений и 6 удалений
+36 -3
Просмотреть файл
@@ -3440,9 +3440,6 @@ HSAILKernel::init(amd::hsa::loader::Symbol *sym, bool finalize)
if (error != ACL_SUCCESS) {
return false;
}
// Set the argList
initArgList(reinterpret_cast<const aclArgData*>(aclArgList));
delete [] aclArgList;
size_t sizeOfWorkGroupSize;
error = aclQueryInfo(dev().hsaCompiler(), prog().binaryElf(),
@@ -3527,6 +3524,42 @@ HSAILKernel::init(amd::hsa::loader::Symbol *sym, bool finalize)
waveLimiter_.enable(dev().settings().ciPlus_);
size_t sizeOfWorkGroupSizeHint = sizeof(workGroupInfo_.compileSizeHint_);
error = aclQueryInfo(dev().hsaCompiler(), prog().binaryElf(),
RT_WORK_GROUP_SIZE_HINT, openClKernelName.c_str(),
workGroupInfo_.compileSizeHint_, &sizeOfWorkGroupSizeHint);
if (error != ACL_SUCCESS) {
return false;
}
size_t sizeOfVecTypeHint;
error = aclQueryInfo(dev().hsaCompiler(), prog().binaryElf(),
RT_VEC_TYPE_HINT, openClKernelName.c_str(),
NULL, &sizeOfVecTypeHint);
if (error != ACL_SUCCESS) {
return false;
}
if (0 != sizeOfVecTypeHint) {
char* VecTypeHint = new char[sizeOfVecTypeHint + 1];
if (NULL == VecTypeHint) {
return false;
}
error = aclQueryInfo(dev().hsaCompiler(), prog().binaryElf(),
RT_VEC_TYPE_HINT, openClKernelName.c_str(),
VecTypeHint, &sizeOfVecTypeHint);
if (error != ACL_SUCCESS) {
return false;
}
VecTypeHint[sizeOfVecTypeHint] = '\0';
workGroupInfo_.compileVecTypeHint_ = std::string(VecTypeHint);
delete [] VecTypeHint;
}
// Set the argList
initArgList(reinterpret_cast<const aclArgData*>(aclArgList));
delete [] aclArgList;
return true;
}