Runtime API and Driver API examples
Driver API example code based on code found at https://gist.github.com/tautologico/2879581
-
Ensure that you are in the driver_api folder
-
nvcc -o matSumKernel.fatbin -fatbin matSumKernel.cu -lcuda
-
nvcc -o drivertest.o -c drivertest.cpp -lcuda
-
nvcc -o drivertest drivertest.o -lcuda
-
./drivertest > output-fatbin.txt
- nvcc -o matSumKernel.ptx -ptx matSumKernel.cu -lcuda
- nvcc -o drivertest.o -c drivertest.cpp -lcuda
- nvcc -o drivertest drivertest.o -lcuda
- ./drivertest > output-ptx.txt
Runtime API example code based on code found at https://gist.github.com/al-indigo/4dd93d48a2886db6b1ac
- Ensure that you are in the runtime_api folder
- nvcc -o vector_add vector_add.cu
- ./vector_add > output-runtime.txt