You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/01-examples.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,6 +38,8 @@ examples.
38
38
| 09d |[`…/hip`](../examples/09-heterogeneous/hip/)| The same computation in HIP, reaching an NVIDIA device |`mcpp.rules.hip`, HIP as a header layer over the CUDA runtime, a two-chunk `accel`|
39
39
| 09e |[`…/multi-backend`](../examples/09-heterogeneous/multi-backend/)| Several backends in ONE artifact, chosen at run time — the library shape, not the program shape |`accel` as a set, `cfg(accelerator = "none")` and its negation, a dispatch chain, a module seam over a C island boundary |
40
40
| 09f |[`…/cann`](../examples/09-heterogeneous/cann/)| An Ascend C kernel behind the same seam. **Does not build yet** — its README names the two missing pieces | the `.asc` device extension, `op_kernel`/`op_host` as an island CANN already has, `accelerator = "none"` for the fallback |
41
+
| 10 |[`examples/10-graphics`](../examples/10-graphics/)| Graphics rather than compute: a rendering pipeline whose result is pixels |`mcpp.rules.spirv` for the vertex and fragment stages, offscreen rendering as the assertable form |
42
+
| 10a |[`…/offscreen`](../examples/10-graphics/offscreen/)| A triangle rasterised by Vulkan into a buffer, and the same triangle by a software rasteriser behind the same seam | two shader stages from one glob, a render pass with no window or swapchain, a pixel as the criterion |
Copy file name to clipboardExpand all lines: docs/20-heterogeneous-builds.md
+72-3Lines changed: 72 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -483,8 +483,8 @@ own denominator.
483
483
|---|---|---|---|---|
484
484
|`rules-cuda`|`mcpp.rules.cuda`| the project's own clang (`-x cuda`), or nvcc with a GCC toolchain |`xim:cuda-nvcc`, `xim:cuda-cudart`, `xim:libcurand`, `xim:cuda-cccl`|`cuda12.9+{sm_89} ptx>=89`|
485
485
|`rules-hip`|`mcpp.rules.hip`| the project's own clang (`-x cuda`) on the NVIDIA platform | the above plus `xim:hip-nvidia`|`hip, cuda12.9+{sm_89}`|
486
-
|`rules-sycl`|`mcpp.rules.sycl`| the `xim:dpcpp` payload's clang (`-fsycl`) |`xim:dpcpp`, `xim:gcc`, `xim:cuda-nvcc` for an NVIDIA target |`sycl` or `sycl, cuda12.9+{sm_89}`|
487
-
|`rules-spirv`|`mcpp.rules.spirv`|`glslangValidator` or `glslc`|`xim:glslang`or `xim:shaderc`|`vulkan1.2`|
486
+
|`rules-sycl`|`mcpp.rules.sycl`| the `xim:dpcpp` payload's clang (`-fsycl`) |`xim:dpcpp`; on Linux also `xim:gcc`,`xim:glibc`, `xim:linux-headers`;`xim:cuda-nvcc` for an NVIDIA target |`sycl` or `sycl, cuda12.9+{sm_89}`|
487
+
|`rules-spirv`|`mcpp.rules.spirv`|`glslangValidator` or `glslc`|`xim:glslang`on Linux, `xim:shaderc` on macOS and Windows|`vulkan1.2`|
488
488
|`rules-ascendc`|`mcpp.rules.ascendc`|`bisheng` (`-x asc`) from the CANN toolkit |`xim:cann-toolkit`|`ascend8.5+{dav-c220}`|
489
489
490
490
The payload column is what each rule declares for itself under
@@ -512,6 +512,61 @@ unwinder symbols they share. Nothing may cross the seam: a SYCL exception is
512
512
caught in the device translation unit and returned as a code, because the
513
513
runtime that threw it is not the one the caller would unwind with.
514
514
515
+
## Which platforms each lane reaches
516
+
517
+
A lane reaches a platform when three things hold there: the device compiler is
518
+
published for it, the runtime the produced artifact needs can be reached, and
519
+
the rule's own host-dependent code compiles for it. The third is the one that
520
+
is easy to assume. `mcpp:plugins` compiles every rule for every platform in its
521
+
CI matrix (`tests/all-rules-compile`, a fixture that names no accelerator, so
522
+
it downloads nothing and asks only whether the modules compile); that fixture
523
+
turned three latent host differences into compile errors on the runners that
524
+
had them, and none of the three had been visible to a Linux build.
525
+
526
+
| lane | Linux | macOS | Windows | what decides it |
527
+
|---|---|---|---|---|
528
+
|`rules-spirv`| yes | yes | yes | the shader compiler is published for all three: `xim:glslang` on Linux, `xim:shaderc` on macOS arm64 and Windows x86_64 |
529
+
|`rules-cuda`| yes | no | yes | NVIDIA publishes the redistributable components for Linux and Windows and has published no macOS toolkit since CUDA 10.2 |
530
+
|`rules-sycl`| yes | no | Level Zero and OpenCL only | Intel publishes `sycl_linux` and `sycl_windows` from one tag and nothing for macOS; upstream states that the CUDA and HIP plugins are not built for Windows, and the Windows asset carries only the Level Zero and OpenCL adapters |
531
+
|`rules-hip`| yes | no | no | the NVIDIA-platform header package is published for Linux alone; the AMD platform needs a ROCm runtime this ecosystem does not publish anywhere |
532
+
|`rules-ascendc`| yes | no | no | the CANN toolkit is published for Linux alone |
533
+
534
+
**A vendor that does not publish for a platform ends the question.** No amount
535
+
of engine work makes a CUDA toolkit exist for macOS. What the ecosystem can do
536
+
is state the boundary at the point where a build asks to cross it, which is
537
+
what each lane does: the SYCL rule refuses an ahead-of-time NVIDIA target on
538
+
Windows and names the upstream release note that decides it, rather than
539
+
compiling something the runtime cannot load.
540
+
541
+
**Where a lane reaches a platform, it reaches it the same way.** Four
542
+
differences are the whole of what a rule does differently per host, and each is
543
+
a property of the host rather than of the device:
544
+
545
+
-**The suffix on a program name.**`nvcc` and `nvcc.exe` are the same tool.
546
+
-**Where the libraries are.**`lib` and `lib64` on ELF hosts, `lib/x64` in
547
+
NVIDIA's Windows layout.
548
+
-**Which host compiler the device compiler drives.** On Windows the CUDA rule
549
+
takes its clang route whatever the project's compiler is: the nvcc route
550
+
compiles the host half through a compiler named by `-ccbin`, and on that host
551
+
the only one it accepts is MSVC's `cl.exe`, whose location is found by asking
552
+
the machine about its Visual Studio installation. The clang route drives no
553
+
second compiler and locates the MSVC headers itself.
554
+
-**Which of the host's libraries have to be kept out.** On Linux the SYCL rule
555
+
names `xim:gcc`, `xim:glibc` and `xim:linux-headers` because dpcpp's clang is
556
+
not the clang mcpp resolved and is configured with neither library. On
557
+
Windows there is one C++ runtime, MSVC's, and both compilers use it, so those
558
+
three declarations do not exist there -- requiring them would refuse a build
559
+
over three packages that this ecosystem does not publish for that platform
560
+
and that its compiler does not need.
561
+
562
+
**The runtime adapters are a Linux construction.**`compat:cuda-runtime`,
563
+
`compat:sycl-runtime` and `compat:vulkan-runtime` exist because an mcpp
564
+
artifact on Linux runs behind a private loader that does not consult
565
+
`/usr/lib`, so a vendor library installed by a driver package has to be brought
566
+
onto the artifact's own search path. macOS (dyld) and Windows (the PE loader)
567
+
have no such layer by construction, and a project targeting them declares no
568
+
adapter.
569
+
515
570
## What a framework looks like on top of this
516
571
517
572
The five lanes prove a rule package can drive five compilers, the newest of
@@ -558,6 +613,20 @@ past it is the framework's own selector rather than a change to the packaging.
558
613
## Not implemented
559
614
560
615
Device targets and the device linking they imply for the island shape, OpenMP
561
-
offload and stdpar, the AMD platform of HIP, and Metal. See
616
+
offload and stdpar, the AMD platform of HIP, and Metal.
617
+
618
+
Two further gaps are per-platform rather than per-model, and both are
619
+
publishing work rather than engine work. **HIP on Windows** needs Windows
620
+
sections for the NVIDIA-platform header package and for `cuda-profiler-api`,
621
+
plus a Windows form for the header-declaration step that today writes into a
622
+
Linux SubOS view. **The 13.x CUDA line on Windows** needs a Windows form for
623
+
the back-end reunification: on that line upstream splits `nvvm/` and `crt/` out
624
+
of `cuda_nvcc` into four separately published components, which the index
625
+
reunites with symlinks, and `ln` is not a command on that host. The 12.x line
626
+
keeps its back end inside the component and needs none of it, so that is the
627
+
line Windows carries, declared as a deliberate divergence in each recipe rather
628
+
than left to be read off the file.
629
+
630
+
See
562
631
`.agents/docs/2026-09-05-heterogeneous-build-ecosystem-design-v2.md` for the
563
632
design these follow from and the reason each is open.
0 commit comments