c35ba37287
On StreamBegincapture captures the parameters passed to APIs and respective node will be created and added to graph All parameters are passed to STREAM_CAPTURE macro, it checks if stream in capture mode and redirects the call to the capture function and returns Updated hipStream and hipEvent with capture parameters Added handling for hipStreamBeginCapture & hipStreamEndCapture Change-Id: Ic8926a7b4336c2cc81f0b3a9a224aa392c474134
49 行
2.6 KiB
C++
49 行
2.6 KiB
C++
/* Copyright (c) 2021-present Advanced Micro Devices, Inc.
|
|
|
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
of this software and associated documentation files (the "Software"), to deal
|
|
in the Software without restriction, including without limitation the rights
|
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
copies of the Software, and to permit persons to whom the Software is
|
|
furnished to do so, subject to the following conditions:
|
|
|
|
The above copyright notice and this permission notice shall be included in
|
|
all copies or substantial portions of the Software.
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
THE SOFTWARE. */
|
|
|
|
#pragma once
|
|
// forward declaration of capture methods
|
|
hipError_t capturehipLaunchKernel(hipStream_t& stream, const void*& hostFunction, dim3& gridDim,
|
|
dim3& blockDim, void**& args, size_t& sharedMemBytes);
|
|
|
|
hipError_t capturehipMemcpy3DAsync(hipStream_t& stream, const hipMemcpy3DParms*& p);
|
|
|
|
hipError_t capturehipMemcpyAsync(hipStream_t& stream, void*& dst, const void*& src,
|
|
size_t& sizeBytes, hipMemcpyKind& kind);
|
|
|
|
hipError_t capturehipMemcpyFromSymbolAsync(hipStream_t& stream, void*& dst, const void*& symbol,
|
|
size_t& sizeBytes, size_t& offset, hipMemcpyKind& kind);
|
|
|
|
hipError_t capturehipMemcpyToSymbolAsync(hipStream_t& stream, const void*& symbol, const void*& src,
|
|
size_t& sizeBytes, size_t& offset, hipMemcpyKind& kind);
|
|
|
|
hipError_t capturehipMemsetAsync(hipStream_t& stream, void*& dst, int& value, size_t& valueSize,
|
|
size_t& sizeBytes);
|
|
|
|
hipError_t capturehipMemset2DAsync(hipStream_t& stream, void*& dst, size_t& pitch, int& value,
|
|
size_t& width, size_t& height);
|
|
|
|
hipError_t capturehipMemset3DAsync(hipStream_t& stream, hipPitchedPtr& pitchedDevPtr, int& value,
|
|
hipExtent& extent);
|
|
|
|
hipError_t capturehipEventRecord(hipStream_t& stream, hipEvent_t& event);
|
|
|
|
hipError_t capturehipStreamWaitEvent(hipEvent_t& event, hipStream_t& stream, unsigned int& flags);
|