| 577 | } |
| 578 | |
| 579 | hipError_t capturehipMemcpy2DToArrayAsync(hipStream_t& stream, hipArray_t& dst, size_t& wOffset, |
| 580 | size_t& hOffset, const void*& src, size_t& spitch, |
| 581 | size_t& width, size_t& height, hipMemcpyKind& kind) { |
| 582 | ClPrint(amd::LOG_DETAIL_DEBUG, amd::LOG_API, |
| 583 | "[hipGraph] Current capture node Memcpy2DFromArray on stream : %p", stream); |
| 584 | |
| 585 | // Skip zero-sized copies |
| 586 | if (width == 0 || height == 0) { |
| 587 | return hipSuccess; |
| 588 | } |
| 589 | |
| 590 | HIP_RETURN_ONFAIL(hipMemcpy2DValidateArray(dst, wOffset, hOffset, width, height)); |
| 591 | HIP_RETURN_ONFAIL(hipMemcpy2DValidateBuffer(src, spitch, width)); |
| 592 | |
| 593 | if (!hip::isValid(stream)) { |
| 594 | return hipErrorContextIsDestroyed; |
| 595 | } |
| 596 | hip::Stream* s = reinterpret_cast<hip::Stream*>(stream); |
| 597 | hip::GraphNode* pGraphNode; |
| 598 | hipMemcpy3DParms p = {}; |
| 599 | memset(&p, 0, sizeof(p)); |
| 600 | p.dstPos = {wOffset, hOffset, 0}; |
| 601 | p.kind = kind; |
| 602 | p.dstPtr.ptr = nullptr; |
| 603 | p.dstArray = dst; // Ignored. |
| 604 | |
| 605 | p.kind = kind; |
| 606 | p.srcPtr.ptr = const_cast<void*>(src); |
| 607 | p.srcArray = nullptr; // Ignored. |
| 608 | p.srcPtr.pitch = spitch; |
| 609 | p.extent = {width / hip::getElementSize(p.dstArray), height, 1}; |
| 610 | hipError_t status = |
| 611 | ihipGraphAddMemcpyNode(&pGraphNode, s->GetCaptureGraph(), s->GetLastCapturedNodes().data(), |
| 612 | s->GetLastCapturedNodes().size(), &p, true, s->DeviceId()); |
| 613 | if (status != hipSuccess) { |
| 614 | return status; |
| 615 | } |
| 616 | s->SetLastCapturedNode(pGraphNode); |
| 617 | return hipSuccess; |
| 618 | } |
| 619 | |
| 620 | hipError_t capturehipMemcpyParam2DAsync(hipStream_t& stream, const hip_Memcpy2D*& pCopy) { |
| 621 | ClPrint(amd::LOG_DETAIL_DEBUG, amd::LOG_API, |
nothing calls this directly
no test coverage detected