From 00cea265f341a9f62f7183dc3d45dadfac1bcd97 Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Sun, 8 Mar 2026 10:51:08 +0100 Subject: [CHORE] Update example for allocator_op. Signed-off-by: Amlal El Mahrouss --- example/allocator_op_example/example.cpp | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'example/allocator_op_example/example.cpp') diff --git a/example/allocator_op_example/example.cpp b/example/allocator_op_example/example.cpp index 665df0b..ca192ff 100644 --- a/example/allocator_op_example/example.cpp +++ b/example/allocator_op_example/example.cpp @@ -5,15 +5,28 @@ #include #include +#include +#include /// \brief Allocation of ints example. -int main() +int task() { ocl::allocator int_alloc; auto foo = int_alloc.construct_array<1>(); - *foo = 67; - ocl::io::print(*foo); + *foo = 109000; + ocl::io::println(*foo); return EXIT_SUCCESS; } + +int main() +{ + auto ret = std::async(std::launch::deferred, task); + auto ret2 = std::async(std::launch::deferred, task); + auto ret3 = std::async(std::launch::deferred, task); + + ret.get(); + ret2.get(); + ret3.get(); +} -- cgit v1.2.3