P4 to Git Change 1787806 by yaxunl@yaxunl-lc10 on 2019/05/27 10:53:56
SWDEV-145570 - Support loading fat binary generated through --genco by hipModuleLoad.
hip-clang --genco generates fat binary instead of code object. To support that
we need to extract code object from fat binary in hipModuleLoadData. This is
needed for hipRTC since multiple GPU archs may be passed.
Affected files ...
... //depot/stg/opencl/drivers/opencl/api/hip/hip_module.cpp#27 edit
... //depot/stg/opencl/drivers/opencl/api/hip/hip_platform.cpp#31 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/devprogram.cpp#42 edit
... //depot/stg/opencl/drivers/opencl/runtime/utils/flags.hpp#308 edit
[ROCm/clr commit: bea21af6ad]
Cette révision appartient à :
1 Parent
5ff37a06a8
révision
8cd069e8ea
2 fichiers modifiés
+62
-23
Aucun fichier ne correspond à votre recherche
@@ -93,8 +93,16 @@ hipError_t hipModuleLoadData(hipModule_t *module, const void *image)
|
||||
HIP_RETURN(ihipModuleLoadData(module, image));
|
||||
}
|
||||
|
||||
extern bool __hipExtractCodeObjectFromFatBinary(const void* data,
|
||||
const std::vector<const char*>& devices,
|
||||
std::vector<std::pair<const void*, size_t>>& code_objs);
|
||||
|
||||
hipError_t ihipModuleLoadData(hipModule_t *module, const void *image)
|
||||
{
|
||||
std::vector<std::pair<const void*, size_t>> code_objs;
|
||||
if (__hipExtractCodeObjectFromFatBinary(image, {hip::getCurrentContext()->devices()[0]->info().name_}, code_objs))
|
||||
image = code_objs[0].first;
|
||||
|
||||
amd::Program* program = new amd::Program(*hip::getCurrentContext());
|
||||
if (program == NULL) {
|
||||
return hipErrorOutOfMemory;
|
||||
|
||||
Référencer dans un nouveau ticket
Bloquer un utilisateur