summaryrefslogtreecommitdiffhomepage
path: root/examples
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2025-12-14 13:12:14 +0100
committerAmlal El Mahrouss <amlal@nekernel.org>2025-12-14 13:12:14 +0100
commit0424f52c142e64cfadaa37288feee775fafc2bf0 (patch)
tree8d60109d4a53e1583cefc46a5bd0b8fe6cae7385 /examples
parent2448ac2ef13d96e4ef3b7a9a15ef1cfdc2195831 (diff)
feat! core: new ocl::allocator API (breaking changes) and example.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'examples')
-rw-r--r--examples/simple_allocator_op/CMakeLists.txt15
-rw-r--r--examples/simple_allocator_op/example.cc14
2 files changed, 29 insertions, 0 deletions
diff --git a/examples/simple_allocator_op/CMakeLists.txt b/examples/simple_allocator_op/CMakeLists.txt
new file mode 100644
index 0000000..fbda92b
--- /dev/null
+++ b/examples/simple_allocator_op/CMakeLists.txt
@@ -0,0 +1,15 @@
+
+cmake_minimum_required(VERSION 3.15...3.31)
+
+project(
+ AllocatorExample
+ VERSION 1.0
+ LANGUAGES CXX)
+
+find_package(Boost REQUIRED COMPONENTS container)
+
+add_executable(AllocatorExample example.cc)
+
+set_property(TARGET AllocatorExample PROPERTY CXX_STANDARD 20)
+target_include_directories(AllocatorExample PUBLIC ../../include/)
+target_link_libraries(AllocatorExample PRIVATE Boost::container)
diff --git a/examples/simple_allocator_op/example.cc b/examples/simple_allocator_op/example.cc
new file mode 100644
index 0000000..83be033
--- /dev/null
+++ b/examples/simple_allocator_op/example.cc
@@ -0,0 +1,14 @@
+#include <ocl/print.hpp>
+#include <ocl/allocator_op.hpp>
+
+/// @brief Basic Send test
+int main()
+{
+ ocl::allocator<int> int_alloc;
+ auto foo = int_alloc.construct_array<1>();
+
+ *foo = 67;
+ ocl::io::print(*foo);
+
+ return EXIT_SUCCESS;
+}