GPU Synthesis¶
GPU-accelerated synthesis functions are implemented in src/GPU_synthesis.cpp
using SYCL via AdaptiveCpp. These are the sorted variants of the standard
synthesis algorithms.
Overview¶
The sorted approach:
Sorts states by transition probability, enabling efficient parallel reduction
Removes the dependency on the GLPK linear programming library
Enables execution on GPUs (NVIDIA, Intel, etc.) via SYCL
All sorted synthesis functions are methods of the IMDP class.
See IMDP (class IMDP) for the full function signatures.
Usage¶
To use GPU synthesis:
Compute abstraction on CPU and save to HDF5 files
Update the Makefile: replace
IMDP.cppwithGPU_synthesis.cppand change--acpp-targetsto your GPU targetLoad abstraction from files and call sorted synthesis functions
IMDP imdp(dim_x, dim_u, dim_w);
// Load pre-computed data
imdp.loadStateSpace("ss.h5");
imdp.loadInputSpace("is.h5");
imdp.loadMinTransitionMatrix("minTM.h5");
imdp.loadMaxTransitionMatrix("maxTM.h5");
// ... load other vectors ...
// GPU-accelerated synthesis
imdp.infiniteHorizonReachControllerSorted(true);
imdp.saveController();
Makefile Configuration¶
CC = acpp
CFLAGS = --acpp-targets="cuda:sm_70" -O3 \
-lnlopt -lm \
-I/usr/include/hdf5/serial \
-L/usr/lib/x86_64-linux-gnu/hdf5/serial \
-lhdf5 -lgsl -lgslcblas \
-DH5_USE_110_API -larmadillo
SRCS = example.cpp ../../src/GPU_synthesis.cpp ../../src/MDP.cpp
Note: -lglpk is not needed for sorted synthesis.
See GPU Setup for full GPU setup instructions.