@@ -40,12 +40,12 @@ module;
4040#include < dlfcn.h>
4141#endif
4242
43- export module example .rules.cuda;
43+ export module mcpplibs .rules.cuda;
4444
4545import std;
4646import mcpp;
4747
48- export namespace example ::rules::cuda {
48+ export namespace mcpplibs ::rules::cuda {
4949
5050enum class route { automatic, clang, nvcc };
5151
@@ -175,7 +175,7 @@ inline std::optional<toolkit> find_toolkit() {
175175 t.driver_dir = xpkg (" libcuda-host-link" );
176176 if (t.nvcc_root .empty () || t.cudart_root .empty ()) {
177177 std::println (std::cerr,
178- " example .rules.cuda: the toolkit is not declared.\n "
178+ " mcpplibs .rules.cuda: the toolkit is not declared.\n "
179179 " Name it under [xlings.workspace] and mcpp provisions it on first use:\n "
180180 " \" xim:cuda-nvcc\" = \" 12.9.86\"\n "
181181 " \" xim:cuda-cudart\" = \" 12.9.79\"\n "
@@ -399,15 +399,15 @@ inline std::vector<edge> plan(std::span<const std::string> sources, options opt
399399 std::vector<edge> out;
400400 const std::string root = mcpp::manifest_dir ();
401401 if (root.empty ()) {
402- std::println (std::cerr, " example .rules.cuda: no mcpp build context -- this runs from build.mcpp" );
402+ std::println (std::cerr, " mcpplibs .rules.cuda: no mcpp build context -- this runs from build.mcpp" );
403403 return out;
404404 }
405405 const auto tg = parse_target (mcpp::accel ());
406406 if (!tg.present || tg.archs .empty ()) {
407407 // C19: a device build that names no device is refused HERE, not at
408408 // run time as `no kernel image is available for execution`.
409409 std::println (std::cerr,
410- " example .rules.cuda: [build] accel names no CUDA architecture (accel = \" {}\" ).\n "
410+ " mcpplibs .rules.cuda: [build] accel names no CUDA architecture (accel = \" {}\" ).\n "
411411 " Write e.g. accel = \" cuda12.9+{{sm_89}} ptx>=89\" -- the set a build compiles\n "
412412 " for is a decision, and the machine's own hardware is a poor default for it." ,
413413 mcpp::accel ());
@@ -424,7 +424,7 @@ inline std::vector<edge> plan(std::span<const std::string> sources, options opt
424424 if (r == route::clang) {
425425 driver_cc = tcdir + " /bin/clang++" ;
426426 if (!std::filesystem::exists (driver_cc)) {
427- std::println (std::cerr, " example .rules.cuda: the clang route needs the toolchain's clang++ at {}" , driver_cc);
427+ std::println (std::cerr, " mcpplibs .rules.cuda: the clang route needs the toolchain's clang++ at {}" , driver_cc);
428428 return out;
429429 }
430430 front = { driver_cc, " -x" , " cuda" , " -std=c++17" , " -O2" , " -fPIC" ,
@@ -436,7 +436,7 @@ inline std::vector<edge> plan(std::span<const std::string> sources, options opt
436436 if (!std::filesystem::exists (tk->nvcc_root + " /bin/" + tool))
437437 mcpp::warning (std::format (" the toolkit payload has no {}; clang invokes it "
438438 " after generating PTX" , tool).c_str ());
439- std::println (" example .rules.cuda: clang route -- {} (toolkit {})" , driver_cc, tk->nvcc_root );
439+ std::println (" mcpplibs .rules.cuda: clang route -- {} (toolkit {})" , driver_cc, tk->nvcc_root );
440440 } else {
441441 // nvcc drives the toolchain's own compiler, and refuses one newer than
442442 // the bound its header states. Read the bound; if exceeded, pass the
@@ -449,7 +449,7 @@ inline std::vector<edge> plan(std::span<const std::string> sources, options opt
449449 // a GCC toolchain; with an LLVM toolchain the clang route is the
450450 // one to take, and it is the default.
451451 std::println (std::cerr,
452- " example .rules.cuda: the nvcc route needs a GCC host compiler; this project's "
452+ " mcpplibs .rules.cuda: the nvcc route needs a GCC host compiler; this project's "
453453 " toolchain is LLVM, whose clang uses libc++ and nvcc refuses it. Use the clang "
454454 " route (the default for an LLVM toolchain) or set [toolchain] to a gcc payload." );
455455 return out;
@@ -461,7 +461,7 @@ inline std::vector<edge> plan(std::span<const std::string> sources, options opt
461461 if (major_of (tg.version ) < 13
462462 && libc_declares_c23_pi_math (mcpp::toolchain_sysroot ())) {
463463 std::println (std::cerr,
464- " example .rules.cuda: toolkit {} redeclares the C23 functions cospi, sinpi and "
464+ " mcpplibs .rules.cuda: toolkit {} redeclares the C23 functions cospi, sinpi and "
465465 " rsqrt for the host without `noexcept`, and the C library this build compiles "
466466 " against declares them with it; nvcc's front end refuses the pair.\n "
467467 " Name a 13.x toolkit, whose headers leave them to the C library:\n "
@@ -496,7 +496,7 @@ inline std::vector<edge> plan(std::span<const std::string> sources, options opt
496496 driver_cc).c_str ());
497497 } else {
498498 std::println (std::cerr,
499- " example .rules.cuda: nvcc {} accepts gcc <= {} ({}), and this project's "
499+ " mcpplibs .rules.cuda: nvcc {} accepts gcc <= {} ({}), and this project's "
500500 " toolchain is gcc {}.\n "
501501 " Declare a gcc payload within the bound and the rule drives that one:\n "
502502 " [xlings.workspace]\n "
@@ -536,7 +536,7 @@ inline std::vector<edge> plan(std::span<const std::string> sources, options opt
536536 " nvcc cannot reach its own back-end: it invokes '{}' by name and that name "
537537 " does not resolve on the search path it states. On the 13.x line install "
538538 " xim:libnvvm beside xim:cuda-nvcc." , *missing).c_str ());
539- std::println (" example .rules.cuda: nvcc route -- {} with -ccbin {}" , tk->nvcc (), driver_cc);
539+ std::println (" mcpplibs .rules.cuda: nvcc route -- {} with -ccbin {}" , tk->nvcc (), driver_cc);
540540 }
541541
542542 // The link line gets its directories from here, not from the manifest: the
@@ -590,4 +590,4 @@ inline bool compile(options opt = {}) {
590590 return submit (edges);
591591}
592592
593- } // namespace example ::rules::cuda
593+ } // namespace mcpplibs ::rules::cuda
0 commit comments