POV-Ray : Newsgroups : povray.off-topic : 99 lines of C++ for an unbiased ray tracer : Re: 99 lines of C++ for an unbiased ray tracer Server Time
4 Sep 2024 23:19:10 EDT (-0400)
  Re: 99 lines of C++ for an unbiased ray tracer  
From: Warp
Date: 14 Jan 2010 14:43:12
Message: <4b4f73cf@news.povray.org>
Vincent Le Chevalier <gal### [at] libertyallsurfspamfr> wrote:
> Darren New wrote:
> >> Line 79 means each row of pixels is computed in parallel, right?
> > 
> > Got me. It looks like someone is asking the compiler to do that if it can.
> > 

> It's using the OpenMP directives 
> (http://en.wikipedia.org/wiki/OpenMP)... I discovered that last year, 
> can be pretty useful and makes it quite easy to take advantage of 
> multiple cores when the algorithms are already mostly suited to being 
> run in parallel.

  The advantage of OpenMP is that the routine will run in parallel if
the compiler supports it, but if the compiler doesn't support OpenMP,
it doesn't matter: The program will still compile and work properly
(it will just be single-threaded). Compilers ignore #pragmas they don't
recognize (per the standard), so the addition #pragma openmp's don't
matter.

-- 
                                                          - Warp


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.