diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2026-03-02 13:35:05 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@nekernel.org> | 2026-03-02 13:35:05 +0100 |
| commit | fe6ba8bd1a59f48000e7cd04a5f7ae10592dc25b (patch) | |
| tree | 5d7d3525d684bcf49a43bc3d5ef5e0efd5bf3fea | |
| parent | 59a0b4bbc6ecbda41c81dee514fcc13f4168a917 (diff) | |
wip: example: add new examples for future nectar backend.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
| -rw-r--r-- | example/example_02_nectar/example.nc | 5 | ||||
| -rw-r--r-- | example/example_05_asm_gpu/.keep | 0 | ||||
| -rw-r--r-- | example/example_06_nectar_gpu/example.nc | 7 | ||||
| -rw-r--r-- | include/GenericsLibrary/pstd.nhh | 17 |
4 files changed, 26 insertions, 3 deletions
diff --git a/example/example_02_nectar/example.nc b/example/example_02_nectar/example.nc index c41223b..46cbd25 100644 --- a/example/example_02_nectar/example.nc +++ b/example/example_02_nectar/example.nc @@ -2,10 +2,9 @@ extern sleep; extern putchar; const main() { - sleep(0x1); - putchar(0x0, '!'); + sleep(1); + putchar(0, '!'); let foo := 42; - return foo; } diff --git a/example/example_05_asm_gpu/.keep b/example/example_05_asm_gpu/.keep new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/example/example_05_asm_gpu/.keep diff --git a/example/example_06_nectar_gpu/example.nc b/example/example_06_nectar_gpu/example.nc new file mode 100644 index 0000000..d21003c --- /dev/null +++ b/example/example_06_nectar_gpu/example.nc @@ -0,0 +1,7 @@ +extern palloc; // parallel alloc + +const main() { + palloc(0, 0, 0); + return 0; +} + diff --git a/include/GenericsLibrary/pstd.nhh b/include/GenericsLibrary/pstd.nhh new file mode 100644 index 0000000..5df5232 --- /dev/null +++ b/include/GenericsLibrary/pstd.nhh @@ -0,0 +1,17 @@ +// Copyright 2026, Amlal El Mahrouss (amlal@nekernel.org) +// Licensed under the Apache License, Version 2.0 (See accompanying +// file LICENSE or copy at http://www.apache.org/licenses/LICENSE-2.0) +// Official repository: https://github.com/nekernel-org/nectar + +#pragma once + +extern __nrt_palloc; + +#define PALLOC_INVALID 0 + +let palloc(let type, let sz, let align := 0) +{ + return __nrt_palloc(type, sz, align); +} + + |
