mcpp index

compat.cuda-runtime

Host NVIDIA driver runtime adapter for mcpp Linux applications

mcpp add compat.cuda-runtime@2026.09.05

用法

來自本倉庫自己的測試專案 —— CI 真的編譯並執行過,不是為了網站寫的。

// What compat.cuda-driver is asserted to do, and what it is not.
//
// A machine with no NVIDIA driver is a legitimate configuration and is what
// every runner in this repository is, so the test cannot require a device. It
// asserts the two properties that hold on both kinds of machine:
//
//   1. The package resolves, builds and links. That alone covers the failure
//      this package exists to prevent, because the failure is a LINK-time one:
//      an unversioned libcuda.so harvested into a directory mcpp puts on the
//      link line would be picked up by -lcuda and bind the build to one
//      machine's driver. The patterns are versioned precisely so that cannot
//      happen, and a build that links proves it did not.
//
//   2. Where a driver is present, the farm reaches it. Guarded on the driver
//      actually being there rather than skipped by a marker, so the assertion
//      is real on a machine with a GPU and vacuous on one without, and neither
//      case is reported as a pass of the other.
#include <cstdio>

// The adapter under test exists only on Linux, so the assertion does too. The
// file still compiles everywhere, which is what keeps it from rotting silently
// on the two platforms that do not exercise it.
// …

tests/examples/cuda-driver/tests/farm.cpp · 專案 tests/examples/cuda-driver

建置

targets
cuda_runtime (lib)
language
c++23
C standard
c11
import std
no

原始檔 (1)

  • mcpp_generated/cuda_runtime_empty.c

版本

版本平台 鏡像sha256
2026.09.05 最新 Linux 來源 b3e40c5bfed1…