P4 to Git Change 1815146 by cpaquot@cpaquot-ocl-lc-lnx on 2019/06/12 13:43:33

SWDEV-192333 - [HIP] Implemented hipExtMallocWithFlags and hipExtGetLinkTypeAndHopCount

Affected files ...

... //depot/stg/opencl/drivers/opencl/api/hip/hip_device_runtime.cpp#16 edit
... //depot/stg/opencl/drivers/opencl/api/hip/hip_hcc.def.in#16 edit
... //depot/stg/opencl/drivers/opencl/api/hip/hip_hcc.map.in#18 edit
... //depot/stg/opencl/drivers/opencl/api/hip/hip_memory.cpp#59 edit


[ROCm/clr commit: 752a4e57b6]
This commit is contained in:
foreman
2019-06-13 12:47:17 -04:00
orang tua 90dcff1345
melakukan 072d96516e
4 mengubah file dengan 34 tambahan dan 0 penghapusan
@@ -476,3 +476,22 @@ hipError_t hipSetValidDevices ( int* device_arr, int len ) {
HIP_RETURN(hipErrorUnknown);
}
hipError_t hipExtGetLinkTypeAndHopCount(int device1, int device2, uint32_t* linktype, uint32_t* hopcount) {
HIP_INIT_API(device1, device2, linktype, hopcount);
const int numDevices = static_cast<int>(g_devices.size());
if ((device1 < 0) || (device1 >= numDevices) || (device2 < 0) || (device2 >= numDevices)) {
HIP_RETURN(hipErrorInvalidDevice);
}
if (linktype != nullptr) {
*linktype = 0;
}
if (hopcount != nullptr) {
*hopcount = 1;
}
HIP_RETURN(hipSuccess);
}
@@ -47,6 +47,8 @@ hipEventElapsedTime
hipEventQuery
hipEventRecord
hipEventSynchronize
hipExtGetLinkTypeAndHopCount
hipExtMallocWithFlags
hipExtModuleLaunchKernel
hipFree
hipFreeArray
@@ -48,6 +48,8 @@ global:
hipEventQuery;
hipEventRecord;
hipEventSynchronize;
hipExtGetLinkTypeAndHopCount;
hipExtMallocWithFlags;
hipExtModuleLaunchKernel;
hipFree;
hipFreeArray;
@@ -202,6 +202,17 @@ hipError_t ihipMemset(void* dst, int value, size_t valueSize, size_t sizeBytes,
return hipSuccess;
}
hipError_t hipExtMallocWithFlags(void** ptr, size_t sizeBytes, unsigned int flags) {
HIP_INIT_API(ptr, sizeBytes, flags);
if (flags != hipDeviceMallocDefault &&
flags != hipDeviceMallocFinegrained) {
HIP_RETURN(hipErrorInvalidValue);
}
HIP_RETURN(ihipMalloc(ptr, sizeBytes, (flags & hipDeviceMallocFinegrained)? CL_MEM_SVM_FINE_GRAIN_BUFFER : 0));
}
hipError_t hipMalloc(void** ptr, size_t sizeBytes) {
HIP_INIT_API(ptr, sizeBytes);