SWDEV-470372 - Added hipExtHostAlloc API

This change adds a new HIP API `hipExtHostAlloc` which preserves
the functionality of `hipHostMalloc`.

Change-Id: I13504c6fc13465ddd7aed329795bb4f2fef1baff
Tento commit je obsažen v:
Ioannis Assiouras
2024-08-01 00:54:31 +01:00
rodič bb52d9ed62
revize 2c84211b58
9 změnil soubory, kde provedl 71 přidání a 13 odebrání
+5 -2
Zobrazit soubor
@@ -347,6 +347,7 @@ hipError_t hipHostFree(void* ptr);
hipError_t hipHostGetDevicePointer(void** devPtr, void* hstPtr, unsigned int flags);
hipError_t hipHostGetFlags(unsigned int* flagsPtr, void* hostPtr);
hipError_t hipHostMalloc(void** ptr, size_t size, unsigned int flags);
hipError_t hipExtHostAlloc(void** ptr, size_t size, unsigned int flags);
hipError_t hipHostRegister(void* hostPtr, size_t sizeBytes, unsigned int flags);
hipError_t hipHostUnregister(void* hostPtr);
hipError_t hipImportExternalMemory(hipExternalMemory_t* extMem_out,
@@ -1026,6 +1027,7 @@ void UpdateDispatchTable(HipDispatchTable* ptrDispatchTable) {
ptrDispatchTable->hipHostGetDevicePointer_fn = hip::hipHostGetDevicePointer;
ptrDispatchTable->hipHostGetFlags_fn = hip::hipHostGetFlags;
ptrDispatchTable->hipHostMalloc_fn = hip::hipHostMalloc;
ptrDispatchTable->hipExtHostAlloc_fn = hip::hipExtHostAlloc;
ptrDispatchTable->hipHostRegister_fn = hip::hipHostRegister;
ptrDispatchTable->hipHostUnregister_fn = hip::hipHostUnregister;
ptrDispatchTable->hipImportExternalMemory_fn = hip::hipImportExternalMemory;
@@ -1870,6 +1872,7 @@ HIP_ENFORCE_ABI(HipDispatchTable, hipGraphExecNodeSetParams_fn, 457);
HIP_ENFORCE_ABI(HipDispatchTable, hipExternalMemoryGetMappedMipmappedArray_fn, 458)
HIP_ENFORCE_ABI(HipDispatchTable, hipDrvGraphMemcpyNodeGetParams_fn, 459)
HIP_ENFORCE_ABI(HipDispatchTable, hipDrvGraphMemcpyNodeSetParams_fn, 460)
HIP_ENFORCE_ABI(HipDispatchTable, hipExtHostAlloc_fn, 461)
// if HIP_ENFORCE_ABI entries are added for each new function pointer in the table, the number below
// will be +1 of the number in the last HIP_ENFORCE_ABI line. E.g.:
@@ -1877,9 +1880,9 @@ HIP_ENFORCE_ABI(HipDispatchTable, hipDrvGraphMemcpyNodeSetParams_fn, 460)
// HIP_ENFORCE_ABI(<table>, <functor>, 8)
//
// HIP_ENFORCE_ABI_VERSIONING(<table>, 9) <- 8 + 1 = 9
HIP_ENFORCE_ABI_VERSIONING(HipDispatchTable, 461)
HIP_ENFORCE_ABI_VERSIONING(HipDispatchTable, 462)
static_assert(HIP_RUNTIME_API_TABLE_MAJOR_VERSION == 0 && HIP_RUNTIME_API_TABLE_STEP_VERSION == 4,
static_assert(HIP_RUNTIME_API_TABLE_MAJOR_VERSION == 0 && HIP_RUNTIME_API_TABLE_STEP_VERSION == 5,
"If you get this error, add new HIP_ENFORCE_ABI(...) code for the new function "
"pointers and then update this check so it is true");
#endif