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
This commit is contained in:
@@ -75,6 +75,7 @@ hipIpcOpenMemHandle
|
|||||||
hipMalloc
|
hipMalloc
|
||||||
hipMalloc3D
|
hipMalloc3D
|
||||||
hipMalloc3DArray
|
hipMalloc3DArray
|
||||||
|
hipMallocManaged
|
||||||
hipArrayCreate
|
hipArrayCreate
|
||||||
hipArray3DCreate
|
hipArray3DCreate
|
||||||
hipMallocArray
|
hipMallocArray
|
||||||
|
|||||||
@@ -76,6 +76,7 @@ global:
|
|||||||
hipMalloc;
|
hipMalloc;
|
||||||
hipMalloc3D;
|
hipMalloc3D;
|
||||||
hipMalloc3DArray;
|
hipMalloc3DArray;
|
||||||
|
hipMallocManaged;
|
||||||
hipArrayCreate;
|
hipArrayCreate;
|
||||||
hipArray3DCreate;
|
hipArray3DCreate;
|
||||||
hipMallocArray;
|
hipMallocArray;
|
||||||
|
|||||||
@@ -214,6 +214,17 @@ hipError_t hipHostMalloc(void** ptr, size_t sizeBytes, unsigned int flags) {
|
|||||||
HIP_RETURN(ihipMalloc(ptr, sizeBytes, ihipFlags));
|
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) {
|
hipError_t hipFree(void* ptr) {
|
||||||
HIP_INIT_API(hipFree, ptr);
|
HIP_INIT_API(hipFree, ptr);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user