From 21c65c4b114a7800e8116b37ea0bd4725d76819f Mon Sep 17 00:00:00 2001 From: Alejandro Saucedo Date: Sat, 17 Oct 2020 19:27:07 +0100 Subject: [PATCH] Updated sample example to show async simple --- README.md | 6 +++++- docs/overview/advanced-examples.rst | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d0b8c64a6..c5d6981ed 100644 --- a/README.md +++ b/README.md @@ -89,7 +89,11 @@ int main() { std::vector(shader.begin(), shader.end())); // Sync the GPU memory back to the local tensor - mgr.evalOpDefault({ tensorA, tensorB }); + // You can run the job asynchronously with the Async function + mgr.evalOpAsyncDefault({ tensorA, tensorB }); + + // Await for the asynchonous default sequence to finish + mgr.evalOpAwaitDefault(); // Prints the output which is A: { 0, 1, 2 } B: { 3, 4, 5 } std::cout << fmt::format("A: {}, B: {}", diff --git a/docs/overview/advanced-examples.rst b/docs/overview/advanced-examples.rst index 0774c4658..8e10cc451 100644 --- a/docs/overview/advanced-examples.rst +++ b/docs/overview/advanced-examples.rst @@ -69,7 +69,11 @@ Pass compute shader data in glsl/hlsl text or compiled SPIR-V format (or as path std::vector(shader.begin(), shader.end())); // Sync the GPU memory back to the local tensor - mgr.evalOpDefault({ tensorA, tensorB }); + // You can run the job asynchronously with the Async function + mgr.evalOpAsyncDefault({ tensorA, tensorB }); + + // Await for the asynchonous default sequence to finish + mgr.evalOpAwaitDefault(); // Prints the output which is A: { 0, 1, 2 } B: { 3, 4, 5 } std::cout << fmt::format("A: {}, B: {}",