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
# Makefile — C++ host loading Rust-compiled PTX via CUDA Driver API
#
# This builds a C++ program that loads PTX at runtime and launches kernels.
# The PTX comes from building Rust kernels with warp-types.
#
# Prerequisites:
# - CUDA Toolkit (nvcc, libcuda)
# - Rust nightly with rust-src (for building the Rust kernel crate)
#
# Usage:
# make # Build the C++ host program
# make ptx # Build Rust kernels to PTX
# make run # Build everything and run
# make clean # Remove build artifacts
NVCC ?=
CXXFLAGS =
LDFLAGS =
# Path to the Rust kernel PTX (from gpu-project example)
KERNEL_DIR =
PTX_PATH =
:
:
: # Build Rust kernels to PTX (requires nightly + rust-src)
:
# Build everything and run
: :