Skip to content

Ios - #401

Open
Leonhardmaster2 wants to merge 9 commits into
ottolink-dev:mainfrom
Leonhardmaster2:ios
Open

Ios#401
Leonhardmaster2 wants to merge 9 commits into
ottolink-dev:mainfrom
Leonhardmaster2:ios

Conversation

@Leonhardmaster2

Copy link
Copy Markdown
Contributor

No description provided.

otto-link and others added 9 commits July 9, 2026 14:21
…s, and implement missing examples

- Add complete Doxygen comments to hydrology headers `drainage_basin.hpp` and `drainage_basin_cell_based.hpp`.
- Correct references and links to examples and output images across library headers (e.g. `statistics.hpp`, `transform.hpp`, `synthesis.hpp`, and `string_utils.hpp`).
- Generate and implement 21 missing example folders and source files matching header Doxygen `@include` tags.
- Fix API compilation issues in example files (updated `hmap::Texture` to `hmap::Tensor`, correct `hmap::Array` constructors, and added `init_opencl` where required).
- Optimize the `non_parametric_sampling` example settings to speed up compilation validation and execution.
- Run all examples and copy generated images to `docs/images/` for clean Doxygen output compilation.
The MSVC branch passed /Od via add_compile_options, which lands after the
per-config flags on the cl command line. MSVC takes the last optimization
flag, so /Od overrode Release's /O2 (cl warns D9025) and every Windows
build shipped the entire library compiled without optimization.

Drop /Od (each config's default now applies: /O2 Release, /Od Debug) and
add /fp:fast outside Debug to match the -ffast-math the GCC/Clang builds
already use.

Measured on a Windows 11 machine (RTX 5060, 6 cores), Hesiod headless
batch of the island bootstrap at 4096x4096: 47s before, 17.4s after
(2.7x), matching equivalent-hardware Linux times.
…ptimization

fix(cmake): stop disabling MSVC optimizations in Release builds
Bumps external/CLWrapper to include recent changes:
- Removed runtime kernel argument validation step.
- Renamed benchmark and unit test targets to prevent build conflicts.
- Disabled unit tests by default.
… kernel loading

Refactors `init_opencl` in `gpu_opencl.cpp` to:
- Use native `clwrapper::KernelManager` API (`clear_sources`, `set_build_options`, `add_kernel`, and `build_program`) instead of string accumulation.
- Introduce a local lambda helper `add(...)` to clean up kernel loading readability and reduce boilerplate around each `#include`.
- fix(cmake): match AppleClang so macOS gets -O3/-ffast-math (STREQUAL
  'Clang' silently skipped Apple's compiler, leaving macOS builds
  unoptimized; same bug class as the MSVC /Od fix in 7237678); guard
  optimization flags per-config and drop deprecated -Ofast
- perf(cmake): add -mcpu=apple-m1 tuning for arm64 macOS
- fix(cmake): OpenMP detection on macOS via Homebrew libomp hints;
  OpenMP becomes optional on macOS (still required elsewhere),
  conditional OpenMP::OpenMP_CXX link, multi-token flag splitting
- fix(cmake): detect keg-only opencl-headers/opencl-clhpp-headers and
  rebind stale Homebrew assimp libz.tbd path to the active SDK zlib
- perf(threading): distributed_tile_loop now uses dynamic work-pull
  scheduling (atomic task counter) instead of static strided
  partitioning; new recommended_thread_count() sizes the pool after
  Apple Silicon performance cores (hw.perflevel0.physicalcpu)
- fix(virtual_array): guard RamTileStorage lazy tile creation with a
  mutex (data race under VA_DISTRIBUTED) and make clone() lock-aware
- perf(openmp): init_openmp default changed from hardcoded 8 threads
  to omp_get_num_procs()
- docs/readme: macOS build instructions; ci: add macOS arm64 job

Measured on Apple M3 (2048^2 CPU kernels): 13.3x total speedup
(hydraulic_diffusion 42x, gradient_norm 21x, noise_fbm 6.6x);
ex_virtual_array 15/15 runtime checks pass, OpenMP 5.1 active,
OpenCL Apple M3 GPU verified.
Brings the INOUT/create_imagef/get_imagef Run API required by the
GPU-resident flow_simulation rewrite.
@otto-link

Copy link
Copy Markdown
Member

Hi, thanks for the PR!

A couple of requests:

  • Could you base your work on the dev branch instead of main? The main branch is currently quite a bit behind the latest development.
  • Could you also provide a more descriptive PR title and expand the description to explain the scope, purpose, and main changes introduced by the PR?

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants