Skip to content

Latest commit

 

History

History
115 lines (85 loc) · 2.39 KB

README.md

File metadata and controls

115 lines (85 loc) · 2.39 KB

compile command

run this command on the project directory. the compiled code and result will be in the out directory.

nvcc -O3 -o out/cuda source/main.cu `pkg-config --cflags --libs opencv4` --disable-warnings

run on CPU

./cuda --scene mesh.scene --obj subdiv.obj

run on CUDA

./cuda --scene mesh.scene --obj subdiv.obj --cuda

command line arguments

--scene <string:scene_file_name>
--obj <string:obj_file_name> [optional] 
--out <string:out_file_name> [optional] [default: "output.bmp"]
--threads <int:number_of_threads> [optional] [default: <all_cores_available>]
--width <int:width_of_image> [optional] [default: 1000]
--height <int:height_of_image> [optional] [default: 1000]
--shadow <bool:true|false> [optional] [default: false]
--cuda [optional] [default: false]

CUDA Speed Up

mesh 1000x1000

CPU (Multi thread): 36.255803 seconds
CUDA: 0.411442 seconds
speed up: x88.2

mesh 5000x5000

CPU (Single Core, Intel(R) Xeon(R) Gold 5218R): -
CPU (Multi Thread, Intel(R) Xeon(R) Gold 5218R): 535.287 seconds
CUDA (RTX A5500): 6.625 seconds
speed up: x80.8

Spheramid 5000x5000

CPU (Single Core, Intel(R) Xeon(R) Gold 5218R): 23.344 seconds
CPU (Multi Thread, Intel(R) Xeon(R) Gold 5218R): 1.385 seconds
CUDA (RTX A5500): 0.248 seconds

output exmaple

basic alt

spheramid alt

mesh alt