CUDA Ray Tracer
Available targets for make:
RayTracer- multithreaded CPU implementationRayTracerCuda- CUDA implementation (requires CUDA libraries installed)
Debug
mkdir Debug
cd Debug
cmake -DCMAKE_BUILD_TYPE=Debug ..
makeRelease
mkdir Release
cd Release
cmake -DCMAKE_BUILD_TYPE=Release ..
makeCMake flags
CMAKE_BUILD_TYPE=[Debug|Release]- target build typeCUDA_HOST_COMPILER=path/to/gcc- path to CUDA-compatible compiler, by default points toCMAKE_C_COMPILERCUDA_TOOLKIT_ROOT_DIR=path/to/cuda- path to CUDA installation directory
Enter the build directory:
# CPU
./RayTracer > image.ppm
# CUDA, requires raytracing.ptx to run
./RayTracerCuda > image.ppmEach program can read config from file, for example:
cd Release
./RayTracer ../resources/RayTracerConfig.example > image.ppmSee format of the config file in resources/RayTracerConfig.example.
If no file is specified, default config is used (same as in the example config).
All source files should comply with .clang-format configuration.
Run clang-format on each file before commit or add git hook to run it automatically:
cp -i resources/pre-commit .git/hooks/and follow displayed instructions.