ssloy/tinyrenderer

slower result when using omp

Opened this issue · 7 comments

when writting the Triangle() function ,i get a much slower result when i used omp parallel,(2 times slower infact),
fd653ba9ace43bf3f707a4f73c0e103

is it because the variable "image" was locked when it was been written that other threads can't use it ,which resulted in a slower speed than serial computing?

Is the behavior same with a simple #pragma omp parallel for ?
(i mean without collapse/scheduling)

Is the behavior same with a simple #pragma omp parallel for ? (i mean without collapse/scheduling)

yes it is, i've tried a simple #pragma omp parallel for but with the same result

I am curious. Can you try the code from master branch in my repository with and without this #pragma ?

#pragma omp parallel for

I am curious. Can you try the code from master branch in my repository with and without this #pragma ?

#pragma omp parallel for

i've tried yours now and it's performing as it should be (faster with omp) , maybe i've written my code wrongly ,

i see nothing wrong with your code, if you find the problem please share