I can hear you already. Why would anyone want to do that!
I found a simple raytracing app that output images to png files created via a cuda raytrace routine.
I tried to add a SDL window so i could see the cuda generated images directly.
My first problem is the SDL2 headers have conflict with the CUDA headers. So I hand built my own SDL2 header (copying only what is necessary). I tested the customer header on a SDL2 hello world program and it worked!
I managed to get it to compile but it refuses to link with undefined references to all SDL2 functions.
g++ -Wall -Wextra -Ofast -m64 -o “tracecudasdl2” -Wl,–start-group “tmp/tmpxft_00004fe9_00000000-18_tracecudasdl2_dlink.o” “tmp/tmpxft_00004fe9_00000000-16_tracecudasdl2.o” -lSDL2 “-L/usr/local/cuda/bin/…//lib64/stubs” “-L/usr/local/cuda/bin/…//lib64” -lcudadevrt -lcudart_static -lrt -lpthread -ldl -Wl,–end-group