diff options
author | Miao Wang <miaowang@google.com> | 2020-01-21 14:59:54 -0800 |
---|---|---|
committer | Miao Wang <miaowang@google.com> | 2020-01-29 09:48:04 -0800 |
commit | 879701620e997b462fdbd66bc5963dba47399436 (patch) | |
tree | f9e2a5f8b9c669bb892d523dd9084f6a34355ca2 /nn/runtime/test/TestValidation.cpp | |
parent | 7b00faa4d25a3a93c38cc074be6e864db834343a (diff) | |
download | ml-879701620e997b462fdbd66bc5963dba47399436.tar.gz |
Update sync fence related APIs
- Allow ANeuralNetworksExecution_startComputeWithDependencies
to measure execution duration after all dependencies are done.
- Allow ANeuralNetworksExecution_startComputeWithDependencies
to specify post-gate-release timeout duration.
Bug: 142778241
Bug: 136739795
Test: mm
Test: NNAPI CTS & VTS tests
Change-Id: Ie32e30b7d1cb98882f3084c1741e975d3e39d970
Diffstat (limited to 'nn/runtime/test/TestValidation.cpp')
-rw-r--r-- | nn/runtime/test/TestValidation.cpp | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/nn/runtime/test/TestValidation.cpp b/nn/runtime/test/TestValidation.cpp index 82547940a..b4204becf 100644 --- a/nn/runtime/test/TestValidation.cpp +++ b/nn/runtime/test/TestValidation.cpp @@ -1126,7 +1126,7 @@ TEST_F(ValidationTestCompilation, ExecutionUsability) { { ANeuralNetworksEvent* event; ASSERT_EQ(ANeuralNetworksExecution_startComputeWithDependencies(execution, nullptr, - 0, &event), + 0, 0, &event), ANEURALNETWORKS_BAD_STATE); } }; @@ -1161,7 +1161,7 @@ TEST_F(ValidationTestCompilation, ExecutionUsability) { case ExecutionType::FENCED: { ANeuralNetworksEvent* event; ASSERT_EQ(ANeuralNetworksExecution_startComputeWithDependencies(execution, nullptr, - 0, &event), + 0, 0, &event), ANEURALNETWORKS_NO_ERROR); testTooLate(); ASSERT_EQ(ANeuralNetworksEvent_wait(event), ANEURALNETWORKS_NO_ERROR); @@ -1611,9 +1611,9 @@ TEST_F(ValidationTestExecution, FencedExecution) { EXPECT_EQ(ANeuralNetworksExecution_setOutput(execution1, 0, nullptr, output0, sizeof(output0)), ANEURALNETWORKS_NO_ERROR); ANeuralNetworksEvent* event1 = nullptr; - EXPECT_EQ( - ANeuralNetworksExecution_startComputeWithDependencies(execution1, nullptr, 0, &event1), - ANEURALNETWORKS_NO_ERROR); + EXPECT_EQ(ANeuralNetworksExecution_startComputeWithDependencies(execution1, nullptr, 0, 0, + &event1), + ANEURALNETWORKS_NO_ERROR); EXPECT_EQ(ANeuralNetworksEvent_getSyncFenceFd(event1, nullptr), ANEURALNETWORKS_UNEXPECTED_NULL); @@ -1622,16 +1622,17 @@ TEST_F(ValidationTestExecution, FencedExecution) { ANeuralNetworksExecution* execution2; ANeuralNetworksEvent* event2 = nullptr; EXPECT_EQ(ANeuralNetworksExecution_create(mCompilation, &execution2), ANEURALNETWORKS_NO_ERROR); - EXPECT_EQ(ANeuralNetworksExecution_startComputeWithDependencies(nullptr, &event1, 1, &event2), - ANEURALNETWORKS_UNEXPECTED_NULL); EXPECT_EQ( - ANeuralNetworksExecution_startComputeWithDependencies(execution2, nullptr, 1, &event2), - ANEURALNETWORKS_UNEXPECTED_NULL); - EXPECT_EQ( - ANeuralNetworksExecution_startComputeWithDependencies(execution2, &event1, 1, nullptr), + ANeuralNetworksExecution_startComputeWithDependencies(nullptr, &event1, 1, 0, &event2), ANEURALNETWORKS_UNEXPECTED_NULL); + EXPECT_EQ(ANeuralNetworksExecution_startComputeWithDependencies(execution2, nullptr, 1, 0, + &event2), + ANEURALNETWORKS_UNEXPECTED_NULL); + EXPECT_EQ(ANeuralNetworksExecution_startComputeWithDependencies(execution2, &event1, 1, 0, + nullptr), + ANEURALNETWORKS_UNEXPECTED_NULL); ANeuralNetworksEvent* wait_for_list[] = {event1, nullptr}; - EXPECT_EQ(ANeuralNetworksExecution_startComputeWithDependencies(execution2, wait_for_list, 2, + EXPECT_EQ(ANeuralNetworksExecution_startComputeWithDependencies(execution2, wait_for_list, 2, 0, &event2), ANEURALNETWORKS_UNEXPECTED_NULL); |