SWDEV-381402 - convert host_device to host_context of type amd::Context*

Change-Id: Ic1cb9a3fa64e16699fad7e9ec6679f1d34b14bef
This commit is contained in:
Ioannis Assiouras
2023-02-16 01:27:08 +00:00
parent 193c5e387e
commit 8b87ccb8cc
5 changed files with 9 additions and 9 deletions
+2 -2
View File
@@ -274,7 +274,7 @@ hipError_t ihipMalloc(void** ptr, size_t sizeBytes, unsigned int flags)
bool useHostDevice = (flags & CL_MEM_SVM_FINE_GRAIN_BUFFER) != 0;
amd::Context* curDevContext = hip::getCurrentDevice()->asContext();
amd::Context* amdContext = useHostDevice ? hip::host_device->asContext() : curDevContext;
amd::Context* amdContext = useHostDevice ? hip::host_context : curDevContext;
if (amdContext == nullptr) {
return hipErrorOutOfMemory;
@@ -1155,7 +1155,7 @@ hipError_t ihipHostRegister(void* hostPtr, size_t sizeBytes, unsigned int flags)
if (hostPtr == nullptr || sizeBytes == 0 || flags > 15) {
return hipErrorInvalidValue;
} else {
amd::Memory* mem = new (*hip::host_device->asContext()) amd::Buffer(*hip::host_device->asContext(),
amd::Memory* mem = new (*hip::host_context) amd::Buffer(*hip::host_context,
CL_MEM_USE_HOST_PTR | CL_MEM_SVM_ATOMICS, sizeBytes);
constexpr bool sysMemAlloc = false;