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: c166e2513c]
Bu işleme şunda yer alıyor:
foreman
2019-05-27 20:11:08 -04:00
ebeveyn d1055b522a
işleme f0480e79ce
2 değiştirilmiş dosya ile 16 ekleme ve 0 silme
+14
Dosyayı Görüntüle
@@ -1403,6 +1403,17 @@ bool Program::linkImpl(amd::option::Options* options) {
}
}
static void dumpCodeObject(const std::string& image) {
char fname[30];
static std::atomic<int> index;
sprintf(fname, "_code_object%04d.o", index++);
LogPrintfInfo("Code object saved in %s\n", fname);
std::ofstream ofs;
ofs.open(fname, std::ios::binary);
ofs << image;
ofs.close();
}
// ================================================================================================
#if defined(USE_COMGR_LIBRARY)
bool Program::linkImplLC(amd::option::Options* options) {
@@ -1445,6 +1456,9 @@ bool Program::linkImplLC(amd::option::Options* options) {
case ACL_TYPE_ISA: {
amd::Comgr::destroy_data_set(inputs);
binary_t isaBinary = binary();
if (OCL_DUMP_CODE_OBJECT) {
dumpCodeObject(std::string{(const char*)isaBinary.first, isaBinary.second});
}
return setKernels(options, const_cast<void *>(isaBinary.first), isaBinary.second);
break;
}
+2
Dosyayı Görüntüle
@@ -181,6 +181,8 @@ release(cstring, CUDA_VISIBLE_DEVICES, "", \
"Only devices whose index is present in the sequence are visible to HIP") \
release(bool, GPU_ENABLE_WGP_MODE, true, \
"Enables WGP Mode in HW if available") \
release(bool, OCL_DUMP_CODE_OBJECT, false, \
"Enable dump code object") \
namespace amd {