mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-29 09:03:14 +08:00
feature: check graph capture restrictions
Related-To: NEO-15377 Signed-off-by: Naklicki, Mateusz <mateusz.naklicki@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
a503776008
commit
0913ef4e7a
@@ -43,7 +43,7 @@ ze_result_t ZE_APICALL zeCommandListBeginGraphCaptureExp(ze_command_list_handle_
|
||||
return ZE_RESULT_ERROR_INVALID_ARGUMENT;
|
||||
}
|
||||
|
||||
if (cmdList->getCaptureTarget() != nullptr) {
|
||||
if (cmdList->isCapturing() || !cmdList->isImmediateType() || cmdList->isInSynchronousMode()) {
|
||||
return ZE_RESULT_ERROR_INVALID_ARGUMENT;
|
||||
}
|
||||
|
||||
@@ -68,12 +68,12 @@ ze_result_t ZE_APICALL zeCommandListBeginCaptureIntoGraphExp(ze_command_list_han
|
||||
return ZE_RESULT_ERROR_INVALID_ARGUMENT;
|
||||
}
|
||||
|
||||
if (cmdList->getCaptureTarget() != nullptr) {
|
||||
if (cmdList->isCapturing()) {
|
||||
return ZE_RESULT_ERROR_INVALID_ARGUMENT;
|
||||
}
|
||||
|
||||
auto graph = L0::Graph::fromHandle(hGraph);
|
||||
if (nullptr == graph) {
|
||||
if (nullptr == graph || !graph->empty()) {
|
||||
return ZE_RESULT_ERROR_INVALID_ARGUMENT;
|
||||
}
|
||||
|
||||
@@ -93,21 +93,22 @@ ze_result_t ZE_APICALL zeCommandListEndGraphCaptureExp(ze_command_list_handle_t
|
||||
return ZE_RESULT_ERROR_INVALID_ARGUMENT;
|
||||
}
|
||||
|
||||
if (nullptr == cmdList->getCaptureTarget()) {
|
||||
auto *graph = cmdList->getCaptureTarget();
|
||||
if (nullptr == graph || graph->hasUnjoinedForks()) {
|
||||
return ZE_RESULT_ERROR_INVALID_ARGUMENT;
|
||||
}
|
||||
|
||||
cmdList->getCaptureTarget()->stopCapturing();
|
||||
|
||||
if (nullptr == phGraph) {
|
||||
if (cmdList->getCaptureTarget()->wasPreallocated()) {
|
||||
if (graph->wasPreallocated()) {
|
||||
cmdList->setCaptureTarget(nullptr);
|
||||
return ZE_RESULT_SUCCESS;
|
||||
} else {
|
||||
return ZE_RESULT_ERROR_INVALID_ARGUMENT;
|
||||
}
|
||||
} else {
|
||||
*phGraph = cmdList->getCaptureTarget();
|
||||
*phGraph = graph->toHandle();
|
||||
cmdList->setCaptureTarget(nullptr);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user