[Cg1] Re: C++ Standard - Ray Tracer

Arsène Pérard-Gayot perard at cg.uni-saarland.de
Thu Jan 30 17:13:11 CET 2020


Hello,

I really suggest using OpenMP. Tile parallelization is just placing  
the following pragma in front of your rendering loop:

#pragma omp parallel for collapse(2) schedule(dynamic)
for (int y = 0; y < height; ++y) {
     for (int x = 0; x < width; ++x) {

Either way, your renderer should compile without my intervention: I  
cannot spend 10mins for each submission just to make sure things  
compile. Just make sure that things work. If push comes to shove,  
submit the non-parallel version.

Best regards,
   Arsène Pérard-Gayot

Quoting Lukas Selvaggio <s8luselv at stud.uni-saarland.de>:

> Hello again,
> I just saw the problem is not actually the C++ standard per se, but  
> the GCC version that's running on the test bench is outdated and is  
> not C++17 feature complete. Namely the "Standardization of the  
> Parallelism TS" is only support from GCC 9 onwards and in addition  
> to that you'd have to link Intel's tbb libary. Is this going to be  
> an issue and should I just provide my previous renderer  
> implementation and only use the new one for rendering my image  
> locally?
>
> Best Regards,
> Lukas Selvaggio
>
>
> Zitat von Arsène Pérard-Gayot <perard at cg.uni-saarland.de>:
>
>> Hello,
>>
>> You should be able to do that by setting CMAKE_CXX_STANDARD to 17  
>> in the main CMakeLists.txt. Tests should still function properly.  
>> Note that threads are a C++ 11 feature, not C++ 17. You can also  
>> use OpenMP, which is probably going to give you better performance  
>> since it has a dynamic scheduling feature.
>>
>> Best regards,
>>  Arsène Pérard-Gayot
>>
>> Quoting Lukas Selvaggio <s8luselv at stud.uni-saarland.de>:
>>
>>> Hi,
>>> I was wondering if we're allowed to use newer standards of C++ in  
>>> our ray tracer. I implemented basic tiled rendering using C++17  
>>> thread library features, doing it in older standards is much more  
>>> tedious.
>>>
>>> Best Regards,
>>> Lukas Selvaggio
>>>
>>>
>>> _______________________________________________
>>> Cg1 mailing list
>>> Cg1 at cg.uni-saarland.de
>>> http://mail.cg.uni-saarland.de/mailman/listinfo/cg1
>>
>>
>>
>> _______________________________________________
>> Cg1 mailing list
>> Cg1 at cg.uni-saarland.de
>> http://mail.cg.uni-saarland.de/mailman/listinfo/cg1
>
>
>
> _______________________________________________
> Cg1 mailing list
> Cg1 at cg.uni-saarland.de
> http://mail.cg.uni-saarland.de/mailman/listinfo/cg1





More information about the Cg1 mailing list