P4 to Git Change 2062258 by cpaquot@cpaquot-ocl-lc-lnx on 2020/01/23 16:04:59
SWDEV-145570 - [hip] hipMallocManaged
Basic implementation of hipMallocManaged behaving like hipHostMalloc for hipMemAttachGlobal.
Return hipErrorInvalidValue for the hipMemAttachHost for now.
Affected files ...
... //depot/stg/opencl/drivers/opencl/api/hip/hip_hcc.def.in#39 edit
... //depot/stg/opencl/drivers/opencl/api/hip/hip_hcc.map.in#37 edit
... //depot/stg/opencl/drivers/opencl/api/hip/hip_memory.cpp#97 edit
[ROCm/hip commit: 2fb1d6a604]
Этот коммит содержится в:
@@ -75,6 +75,7 @@ hipIpcOpenMemHandle
|
||||
hipMalloc
|
||||
hipMalloc3D
|
||||
hipMalloc3DArray
|
||||
hipMallocManaged
|
||||
hipArrayCreate
|
||||
hipArray3DCreate
|
||||
hipMallocArray
|
||||
|
||||
@@ -76,6 +76,7 @@ global:
|
||||
hipMalloc;
|
||||
hipMalloc3D;
|
||||
hipMalloc3DArray;
|
||||
hipMallocManaged;
|
||||
hipArrayCreate;
|
||||
hipArray3DCreate;
|
||||
hipMallocArray;
|
||||
|
||||
@@ -214,6 +214,17 @@ hipError_t hipHostMalloc(void** ptr, size_t sizeBytes, unsigned int flags) {
|
||||
HIP_RETURN(ihipMalloc(ptr, sizeBytes, ihipFlags));
|
||||
}
|
||||
|
||||
hipError_t hipMallocManaged(void** devPtr, size_t size,
|
||||
unsigned int flags) {
|
||||
HIP_INIT_API(hipMallocManaged, devPtr, size, flags);
|
||||
|
||||
if (flags != hipMemAttachGlobal) {
|
||||
HIP_RETURN(hipErrorInvalidValue);
|
||||
}
|
||||
|
||||
HIP_RETURN(ihipMalloc(devPtr, size, CL_MEM_SVM_FINE_GRAIN_BUFFER));
|
||||
}
|
||||
|
||||
hipError_t hipFree(void* ptr) {
|
||||
HIP_INIT_API(hipFree, ptr);
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user