Difference between revisions of "User:Vasco.costa/GSoC15/logs"

From BRL-CAD
Line 35: Line 35:
 
** https://sourceforge.net/p/brlcad/patches/346/
 
** https://sourceforge.net/p/brlcad/patches/346/
  
* Made patch for ELL (Generalized Ellipsoid) and ARB8 (Arbitrary Polyhedron) OCL shots:
+
* Made patch for ELL (Generalized Ellipsoid) and ARB8 (Arbitrary Polyhedron) OCL shots.
 +
* ''M1 complete: ELL, ARB8 shot routines in OCL''.
 
** https://sourceforge.net/p/brlcad/patches/370/
 
** https://sourceforge.net/p/brlcad/patches/370/
* ''M1 complete: ELL, ARB8 shot routines in OCL''.
 
  
 
* Tried out a bunch of code browsing tools (cscope, LXR, doxygen, etc). The NetBeans IDE seems the most promising.
 
* Tried out a bunch of code browsing tools (cscope, LXR, doxygen, etc). The NetBeans IDE seems the most promising.
Line 109: Line 109:
 
* OCL TOR (Torus) shot routine. Includes the higher order equation solver code.
 
* OCL TOR (Torus) shot routine. Includes the higher order equation solver code.
  
* ''M6: TOR and TGC shot routines in OCL.''
+
* ''M6: TOR and TGC shot routines in OCL''.
 
** https://sourceforge.net/p/brlcad/patches/393/
 
** https://sourceforge.net/p/brlcad/patches/393/

Revision as of 00:07, 29 July 2015

Community Bonding Period

I made two patches for OpenCL (OCL) shot code. One patch refactors the existing SPH (Sphere) shot code, and the another patch implements EHY (Elliptical Hyperboloid) shot code.

Background Research

Development Status

Milestone Description Status
M0 patch with EHY shot routine in OCL. DONE
M1 patch with ELL and ARB8 shot routines in OCL. DONE
M2 patch to refactor dispatcher, shoot, optical renderer to process many rays in parallel in C when rendering an image or block. INCOMPLETE
M3 patch with grid spatial partitioning in OCL. DONE
M4 patch to add GPU side database storage of OCL implemented primitives SPH. EHY, ELL, ARB8 . DONE
M5 patch to port compute intensive or critical parts of the dispatcher, boolean evaluation, optical renderer to OCL. ?
M6 patch with TOR and TGC shot routines in OCL. IN PROGRESS
M7 patch with BOT shot routine in OCL. CANCELLED

Development Phase

Week 1 : 25-31 May

  • Created some example .g files in mged for the primitives to be implemented this week. The Quick Reference Card proved to be quite useful.
  • Do the matrix ops for EHY (Elliptical Hyperboloid) in the OCL side.
  • Tried out a bunch of code browsing tools (cscope, LXR, doxygen, etc). The NetBeans IDE seems the most promising.

Week 2 : 1-7 Jun

  • Read code to better understand the main rendering loop. It seems to be something like this:
do_frame() → do_run() → worker()* → do_pixel()* → rt_shootray()* → rt_*_shot()
The code is recursive (which is problematic for OCL). I'll work on a simplified version of the rendering loop which only does the primary rays in C as a first approach. After I get the non-recursive parallel friendly C code I'll work on the OCL port.
  • Updated project proposal on Google Melange.
  • Upgraded Ubuntu and GCC.
  • Made simple ray generation code in C.
  • Made simple frame buffer write code in C.
  • Made simple diffuse shading code in C.

Week 3 : 8-14 Jun

  • Added the main boolean weaving code to our minimal renderer.
  • Eliminated some gotos and made the code more thread safe.
  • The simple renderer patches are in the mailing-list.

Week 4 : 15-21 Jun

  • Added OpenMP compile support. Use OpenMP constructs to launch the rendering threads. This work still has some bugs in it.
  • Alpha M2 patch. in mailing-list.
  • Read code to better understand the main spatial partition construction routines. They seem to be something like this:
rt_prep_parallel() → rt_cut_it() → rt_nugrid_cut()
We need something less complex that is more amenable to porting to OCL. So I will be implementing the Lagae & Dutré compact grid construction algorithm published at EGSR. First I will program in ANSI C then I will port the code to OpenCL.
  • Started work on M3: grid spatial partitioning in OCL.
  • ANSI C Lagae & Dutré grid construction code.

Week 5 : 22-28 Jun

  • Took time off from the project to go to the CGI'15 conference.

Week 6 : 29 Jun-5 Jul

  • GSoC Midterm Evaluations.

Weeks 7-8 : 6 Jul-12 Jul, 13 Jul-19 Jul

  • Evaluating algorithms for grid construction.
  • Selecting OCL kernels we can use to support grid construction. It seems PyOpenCL has some kernels we could use. Now the question is how to extricate the OpenCL/C from the Python...

Weeks 9-10 : 20 Jul-26 Jul, 27 Jul-2 Aug

  • Implemented GPU side solid database storage infrastructure.
  • The OCL EHY shot code now uses the GPU solid database instead of creating the input buffers on every call.
The code allows the primitive to decide how it is stored without imposing a convention. So one can use SoA, AoS, or whatever to store the data.
  • Implemented GPU side solid database storage for SPH, ELL, ARB8.
  • Extracted out some duplicated OCL code.
  • OCL TOR (Torus) shot routine. Includes the higher order equation solver code.