summaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2026-03-08 10:52:38 +0100
committerGitHub <noreply@github.com>2026-03-08 10:52:38 +0100
commit5bac3b38e326598cc85053a0e5c61db7010ed049 (patch)
tree26315ad1ed9ff551649154056a14980609c7c744 /include
parent97d846f41e2bccf7957983c03d1fe9867b789efb (diff)
parent00cea265f341a9f62f7183dc3d45dadfac1bcd97 (diff)
Merge pull request #45 from ocl-foss-org/update-allocator-op-example
[CHORE] Update example for allocator_op.
Diffstat (limited to 'include')
-rw-r--r--include/ocl/allocator_op.hpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/ocl/allocator_op.hpp b/include/ocl/allocator_op.hpp
index 43bc80b..84a949a 100644
--- a/include/ocl/allocator_op.hpp
+++ b/include/ocl/allocator_op.hpp
@@ -75,7 +75,7 @@ namespace ocl
template <typename... var_type>
auto construct_var(var_type&&... args)
{
- allocator_new alloc;
+ static allocator_new alloc;
typename allocator_new::lock_type lt{alloc.m_};
return std::shared_ptr<ret_type>(alloc.template var_alloc<var_type...>(std::forward<var_type...>(args)...), allocator_delete{});
}
@@ -83,7 +83,7 @@ namespace ocl
template <std::size_t N>
auto construct_array()
{
- allocator_new alloc;
+ static allocator_new alloc;
typename allocator_new::lock_type lt{alloc.m_};
return std::shared_ptr<ret_type>(alloc.template array_alloc<N>(), allocator_delete{});
}