P4 to Git Change 1766106 by kjayapra@99_HIPWS_SLV_CHECKIN on 2019/04/04 18:07:26

SWDEV-144570 - Implementation of hipMemcpyToSymbol and simillar fns for PAL.

Affected files ...

... //depot/stg/opencl/drivers/opencl/api/hip/hip_internal.hpp#24 edit
... //depot/stg/opencl/drivers/opencl/api/hip/hip_module.cpp#22 edit
... //depot/stg/opencl/drivers/opencl/api/hip/hip_platform.cpp#26 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/devprogram.hpp#23 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palprogram.cpp#89 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palprogram.hpp#37 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocprogram.cpp#102 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocprogram.hpp#46 edit
... //depot/stg/opencl/drivers/opencl/runtime/platform/memory.cpp#135 edit
This commit is contained in:
foreman
2019-04-04 18:22:40 -04:00
rodzic b4b0b1f61d
commit 842094ccbf
6 zmienionych plików z 169 dodań i 8 usunięć
+25 -1
Wyświetl plik
@@ -113,12 +113,20 @@ bool Program::initClBinary(char* binaryIn, size_t size) {
return clBinary()->setBinary(bin, sz, (decryptedBin != nullptr));
}
bool Program::findGlobalSymbols(void** device_pptr, size_t* bytes, const char* global_name) const {
bool Program::createGlobalVarObj(amd::Memory** amd_mem_obj, void** device_pptr,
size_t* bytes, const char* global_name) const {
hsa_status_t status = HSA_STATUS_SUCCESS;
const roc::Device* roc_device = nullptr;
hsa_agent_t hsa_device;
hsa_symbol_kind_t sym_type;
hsa_executable_symbol_t global_symbol;
if (amd_mem_obj == nullptr) {
buildLog_ += "amd_mem_obj is null";
buildLog_ += "\n";
return false;
}
hsa_device= dev().getBackendDevice();
/* Find HSA Symbol by name */
@@ -170,6 +178,22 @@ bool Program::findGlobalSymbols(void** device_pptr, size_t* bytes, const char* g
return false;
}
roc_device = static_cast<const roc::Device*>(&dev());
*amd_mem_obj = new(roc_device->context()) amd::Buffer(roc_device->context(), 0, *bytes, *device_pptr);
if (*amd_mem_obj == nullptr) {
buildLog_ += "[OCL] Failed to create a mem object!";
buildLog_ += "\n";
return false;
}
if (!((*amd_mem_obj)->create(nullptr))) {
buildLog_ += "[OCL] failed to create a svm hidden buffer!";
buildLog_ += "\n";
(*amd_mem_obj)->release();
return false;
}
return true;
}