MCPcopy Create free account
hub / github.com/ROCm/clr / hipStreamBeginCaptureToGraph

Function hipStreamBeginCaptureToGraph

hipamd/src/hip_graph.cpp:1142–1171  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1140}
1141
1142hipError_t hipStreamBeginCaptureToGraph(hipStream_t stream, hipGraph_t graph,
1143 const hipGraphNode_t* dependencies,
1144 const hipGraphEdgeData* dependencyData,
1145 size_t numDependencies, hipStreamCaptureMode mode) {
1146 HIP_INIT_API(hipStreamBeginCapture, stream, graph, dependencies, dependencyData, numDependencies,
1147 mode);
1148 if (dependencyData != nullptr) {
1149 return hipErrorNotSupported;
1150 } else if (graph == nullptr) {
1151 return hipErrorInvalidValue;
1152 } else if (dependencies == nullptr && numDependencies != 0) {
1153 return hipErrorInvalidValue;
1154 } else if (dependencies != nullptr && numDependencies == 0) {
1155 return hipErrorInvalidValue;
1156 }
1157 hip::Graph* g = reinterpret_cast<hip::Graph*>(graph);
1158 const std::vector<Node> nodes = g->GetNodes();
1159 for (auto& node : nodes) {
1160 g->AddManualNodeDuringCapture(node);
1161 }
1162 hipError_t status = hipStreamBeginCapture_common(stream, mode, graph);
1163 if (status != hipSuccess) {
1164 HIP_RETURN_DURATION(status);
1165 }
1166 if (dependencies != nullptr) {
1167 status = ihipStreamUpdateCaptureDependencies(stream, const_cast<hipGraphNode_t*>(dependencies),
1168 numDependencies, hipStreamSetCaptureDependencies);
1169 }
1170 HIP_RETURN_DURATION(status);
1171}
1172
1173hipError_t hipStreamBeginCapture_spt(hipStream_t stream, hipStreamCaptureMode mode) {
1174 HIP_INIT_API(hipStreamBeginCapture, stream, mode);

Callers

nothing calls this directly

Tested by

no test coverage detected