Skip to content

Commit

Permalink
IVGCVSW-8388 Adding missing deprecate flags to sample apps.
Browse files Browse the repository at this point in the history
The sample apps were not included in the original set of files updates
to account for 24.08 deprecation notices. This cause a nightly failure.

Signed-off-by: Colm Donelan <colm.donelan@arm.com>
Change-Id: Ic96cd3cde383f9f0fd9d1a825b99408f8e17f082
  • Loading branch information
Colm-in-Arm authored and nikraj01 committed May 15, 2024
1 parent 46dee40 commit 1999dac
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions samples/AsyncExecutionSample.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,10 @@ int main()
// Lambda function to execute the network. We use it as thread function.
auto execute = [&](unsigned int executionIndex)
{
ARMNN_NO_DEPRECATE_WARN_BEGIN
auto memHandle = run->CreateWorkingMemHandle(networkIdentifier);
run->Execute(*memHandle, inputTensors[executionIndex], outputTensors[executionIndex]);
ARMNN_NO_DEPRECATE_WARN_END
};

// Prepare some threads and let each execute the network with a different input
Expand Down
6 changes: 6 additions & 0 deletions samples/PreImportMemorySample.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,9 @@ int main()
// This function performs a thread safe execution of the network. Returns once execution is complete.
// Will block until this and any other thread using the same workingMem object completes.
// Execute with PreImported inputTensor1 as well as Non-PreImported inputTensor2
ARMNN_NO_DEPRECATE_WARN_BEGIN
runtime->Execute(*memHandle.get(), {}, {{2, outputTensor1}}, importedInputVec /* pre-imported ids */);
ARMNN_NO_DEPRECATE_WARN_END

// ImportOutputs separates the importing and mapping of OutputTensors from network execution.
// Allowing for a set of OutputTensors to be imported and mapped once, but used in execution many times.
Expand All @@ -99,8 +101,10 @@ int main()
// PreImport outputTensor1
std::vector<ImportedOutputId> importedOutputVec = runtime->ImportOutputs(networkIdentifier1, {output1});

ARMNN_NO_DEPRECATE_WARN_BEGIN
// Execute with Non-PreImported inputTensor1 as well as PreImported inputTensor2
runtime->Execute(*memHandle.get(), {{0, inputTensor1}}, {{2, outputTensor1}}, {1 /* pre-imported id */});
ARMNN_NO_DEPRECATE_WARN_END

// Clear the previously PreImportedInput with the network Id and inputIds returned from ImportInputs()
// Note: This will happen automatically during destructor of armnn::LoadedNetwork
Expand All @@ -110,8 +114,10 @@ int main()
// Note: This will happen automatically during destructor of armnn::LoadedNetwork
runtime->ClearImportedOutputs(networkIdentifier1, importedOutputVec);

ARMNN_NO_DEPRECATE_WARN_BEGIN
// Execute with Non-PreImported inputTensor1, inputTensor2 and the PreImported outputTensor1
runtime->Execute(*memHandle.get(), {{0, inputTensor1}, {1, inputTensor2}}, {{2, outputTensor1}});
ARMNN_NO_DEPRECATE_WARN_END

std::cout << "Your number was " << outputData1.data()[0] << std::endl;

Expand Down

0 comments on commit 1999dac

Please sign in to comment.