-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathmcpp.toml
More file actions
84 lines (75 loc) · 3.64 KB
/
Copy pathmcpp.toml
File metadata and controls
84 lines (75 loc) · 3.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
[package]
name = "sycl-saxpy"
namespace = "example"
version = "0.1.0"
description = "A SYCL kernel behind a seam module, reaching an NVIDIA device, with a CPU fallback"
# BOTH, for the reason the HIP example records: the glob below names the NVIDIA
# target the SYCL unit is compiled for, so `cuda` is a backend this package's
# sources are written for.
accelerators = ["sycl", "cuda"]
[language]
standard = "c++23"
modules = true
import_std = true
# The C++ half is mcpp's own clang. The device half cannot be: SYCL needs a
# compiler with the SYCL front end, which is what the dpcpp payload is, and
# that second compiler is the entire reason this rule exists.
[toolchain]
default = "llvm@22.1.8"
[build-dependencies.mcpp]
plugins = { version = "0.5.2", features = ["rules-sycl", "tools-island"], host-module = true }
# The SYCL runtime, on the artifact's runtime search path. mcpp's private
# loader does not consult /usr/lib, so `libsycl.so.9` -- which the rule
# satisfied at LINK time from the payload -- would not be found at run time.
#
# ONE compat entry, and that is the point of where the boundary was drawn. The
# SYCL runtime's CUDA back end dlopens the driver, so `compat:sycl-runtime`
# carries that hop itself from 2026.09.07 on. A project that writes SYCL does
# not have to know CUDA is underneath it.
#
# 2026.09.10 is the version at which it carries the WHOLE hop. Until then it
# linked one driver library by name, and the adapter needs two: the second was
# missing, the CUDA back end did not load, and the program aborted with no
# message (#596). The farm now mirrors what the driver sentinel publishes
# rather than naming a file.
[dependencies.compat]
sycl-runtime = "2026.09.11"
# NO [xlings.workspace]. `mcpp.rules.sycl` declares all five payloads this lane
# needs, each closing one hole the host would otherwise fill: `dpcpp` (the
# compiler, a host-axis entry -- it runs here whatever it is asked to emit);
# `gcc`, `glibc` and `linux-headers` (the C++ and C libraries the SYCL unit is
# compiled against -- dpcpp's clang is configured with neither, so left alone
# its include search list reaches /usr/include with no ecosystem library on it,
# which is measurable in `clang -v` and invisible on the command line); and
# `cuda-nvcc` for the NVIDIA back end's libdevice, declared only when the accel
# actually names cuda.
#
# The C library entries are UNPINNED there for a reason worth keeping: its
# version is the runtime binding's choice, not the project's, and a pinned entry
# resolves for exactly that version or for nothing.
#
# To pin a different version, write the same entry here and it wins. Needs mcpp
# 2026.9.7.1 and mcpp:plugins 0.3.0.
[build]
# Two chunks: the programming model, and the device. Written `sycl` alone, the
# unit is compiled to SPIR-V and the runtime picks a device at run time; with
# the second chunk it is compiled ahead of time for that architecture.
accel = "sycl, cuda12.9+{sm_89}"
sources = [
"src/*.cppm",
"src/*.cpp",
{ glob = "src/kernels/**/*.sycl", accel = "sycl, cuda12.9+{sm_89}" },
]
# NO `include_dirs`. This project has no header of its own: the one the
# island reads is generated, and `build.mcpp` puts its directory on the
# include path.
# `-lsycl` and the libstdc++ half are NOT here: they are consequences of the
# compiler the rule chose, so the rule puts them on the link line itself
# through `mcpp::link_lib`. A manifest that named them would be stating a fact
# about a compiler it did not select.
# The CPU-only variant: the same seam, a host implementation behind it.
[target.'cfg(not(accelerator = "sycl"))'.build]
sources = ["src/cpu/*.cpp"]
[targets.sycl-saxpy]
kind = "bin"
main = "src/main.cpp"