P4 to Git Change 1548476 by cpaquot@cpaquot-ocl-lc-lnx on 2018/05/01 15:50:51

SWDEV-145570 - [HIP]
	Added support for null stream avoiding creating/destroying dummy streams.
	Added basic event class for hipEvent* support.
	Refactored some common functionality: No more direct access to g_context.
	Support hipStreamSynchronize(0).

Affected files ...

... //depot/stg/opencl/drivers/opencl/api/hip/hip_context.cpp#9 edit
... //depot/stg/opencl/drivers/opencl/api/hip/hip_device_runtime.cpp#7 edit
... //depot/stg/opencl/drivers/opencl/api/hip/hip_event.cpp#3 edit
... //depot/stg/opencl/drivers/opencl/api/hip/hip_event.hpp#1 add
... //depot/stg/opencl/drivers/opencl/api/hip/hip_internal.hpp#8 edit
... //depot/stg/opencl/drivers/opencl/api/hip/hip_memory.cpp#15 edit
... //depot/stg/opencl/drivers/opencl/api/hip/hip_module.cpp#8 edit
... //depot/stg/opencl/drivers/opencl/api/hip/hip_platform.cpp#9 edit
... //depot/stg/opencl/drivers/opencl/api/hip/hip_stream.cpp#4 edit
... //depot/stg/opencl/drivers/opencl/api/hip/hip_texture.cpp#7 edit
This commit is contained in:
foreman
2018-05-01 18:10:09 -04:00
vanhempi dc1497535d
commit 61378a359c
10 muutettua tiedostoa jossa 177 lisäystä ja 126 poistoa
+5 -5
Näytä tiedosto
@@ -68,7 +68,7 @@ extern "C" hipModule_t __hipRegisterFatBinary(const void* data)
return nullptr;
}
amd::Program* program = new amd::Program(*g_context);
amd::Program* program = new amd::Program(*hip::getCurrentContext());
if (!program)
return nullptr;
@@ -84,15 +84,15 @@ extern "C" hipModule_t __hipRegisterFatBinary(const void* data)
std::string target(desc->triple + sizeof(OPENMP_AMDGCN_AMDHSA_TRIPLE),
desc->tripleSize - sizeof(OPENMP_AMDGCN_AMDHSA_TRIPLE));
if (target.compare(g_context->devices()[0]->info().name_))
if (target.compare(hip::getCurrentContext()->devices()[0]->info().name_))
continue;
const void *image = reinterpret_cast<const void*>(
reinterpret_cast<uintptr_t>(obheader) + desc->offset);
size_t size = desc->size;
if (CL_SUCCESS == program->addDeviceProgram(*g_context->devices()[0], image, size) &&
CL_SUCCESS == program->build(g_context->devices(), nullptr, nullptr, nullptr))
if (CL_SUCCESS == program->addDeviceProgram(*hip::getCurrentContext()->devices()[0], image, size) &&
CL_SUCCESS == program->build(hip::getCurrentContext()->devices(), nullptr, nullptr, nullptr))
break;
}
@@ -372,7 +372,7 @@ const std::vector<hipModule_t>& modules() {
std::string target(desc->triple + sizeof(HCC_AMDGCN_AMDHSA_TRIPLE),
desc->tripleSize - sizeof(HCC_AMDGCN_AMDHSA_TRIPLE));
if (!target.compare(g_context->devices()[0]->info().name_)) {
if (!target.compare(hip::getCurrentContext()->devices()[0]->info().name_)) {
hipModule_t module;
if (hipSuccess == hipModuleLoadData(&module, reinterpret_cast<const void*>(
reinterpret_cast<uintptr_t>(obheader) + desc->offset)))