mgpu IPC support fix

Change-Id: I12e4b2fd189c3658efd3b07defa18ece3853b0eb


[ROCm/clr commit: 4906cd5f0d]
Dieser Commit ist enthalten in:
Rahul Garg
2017-04-04 15:51:10 +05:30
Ursprung 82965fb2d6
Commit a14593b331
+9 -4
Datei anzeigen
@@ -1260,10 +1260,15 @@ hipError_t hipIpcOpenMemHandle(void** devPtr, hipIpcMemHandle_t handle, unsigned
ihipIpcMemHandle_t* iHandle = (ihipIpcMemHandle_t*) &handle;
//Attach ipc memory
hsa_status_t hsa_status =
hsa_amd_ipc_memory_attach((hsa_amd_ipc_memory_t*)&(iHandle->ipc_handle), iHandle->psize, 1, agent, devPtr);
if(hsa_status != HSA_STATUS_SUCCESS)
hipStatus = hipErrorMapBufferObjectFailed;
auto ctx= ihipGetTlsDefaultCtx();
{
LockedAccessor_CtxCrit_t crit(ctx->criticalData());
// the peerCnt always stores self so make sure the trace actually
hsa_status_t hsa_status =
hsa_amd_ipc_memory_attach((hsa_amd_ipc_memory_t*)&(iHandle->ipc_handle), iHandle->psize, crit->peerCnt(), crit->peerAgents(), devPtr);
if(hsa_status != HSA_STATUS_SUCCESS)
hipStatus = hipErrorMapBufferObjectFailed;
}
#else
hipStatus = hipErrorRuntimeOther;
#endif