Editing User:Michaljagielski/proposal
From BRL-CAD
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 19: | Line 19: | ||
OpenCL GPGPU Raytracing | OpenCL GPGPU Raytracing | ||
==Brief summary of Project== | ==Brief summary of Project== | ||
− | BRL-CAD objects are made from about two dozens of primitives. During work they are displayed | + | BRL-CAD objects are made from about two dozens of primitives. During work they are displayed only as some kind of net but there is moment, when we want get more precise and more realistic view of our project. Raytracing for most of primitives is implemented only on CPU. GPU is definetely better for this task, so in my project I will rewrite C code of raytracer to OpenCL. When GPU is not accessible on computer OpenCL also will be fast, because it can be launched on multi-core CPU. |
− | |||
− | When GPU is not accessible on computer OpenCL also will be fast, because it can be launched on multi-core CPU. | ||
==Project Description (Detailed)== | ==Project Description (Detailed)== | ||
===Primitives=== | ===Primitives=== | ||
− | Some | + | I divided large primitives set in five categories. Some of them in one group can be very similar (for example ellipsoids), but there is also a lot of individual shapes (dsp, ars). I will divide whole task on subtasks in respect of shapes similarity. |
− | === | + | ===Actual state of raytracing=== |
− | In BRL-CAD each primitive have their own raytracing function. There exist only one example of OpenCL raytracer in | + | In BRL-CAD each primitive have their own raytracing function. There exist only one example of OpenCL raytracer - in ellipsoids sph primitive raytracing is written in OpenCL. It will be my starting point (and it's great lesson of BRL-CAD coding style). So on first place I will write raytracer to ell (and next ellg, ell1, part), because it's more similar to sph than other primitive. Next category will be cylinders-like and cones-like primitives. Next will be torus-like (with one hole), polyhedra and last, most challenging in my opinion some of unique shapes. |
I will work on branch available in http://svn.code.sf.net/p/brlcad/code/brlcad/branches/opencl/ there also is sph raytrace example: http://svn.code.sf.net/p/brlcad/code/brlcad/branches/opencl/src/librt/primitives/sph/ . After I complete a project every primitive should have file structure as sph. | I will work on branch available in http://svn.code.sf.net/p/brlcad/code/brlcad/branches/opencl/ there also is sph raytrace example: http://svn.code.sf.net/p/brlcad/code/brlcad/branches/opencl/src/librt/primitives/sph/ . After I complete a project every primitive should have file structure as sph. | ||
===Algorithm=== | ===Algorithm=== | ||
− | I think that there is no too much to talk about algorithm, I will try generally rewrite C algorithms in more efficient OpenCL algorithm. Algorithm for every primitive is described with desired | + | I think that there is no too much to talk about algorithm, I will try generally rewrite C algorithms in more efficient OpenCL algorithm. Algorithm for every primitive is described with desired amout of details in name_of_primitive.c almost on beginning. I think it's unnecessary to paste it here. |
===Computing device=== | ===Computing device=== | ||
− | + | When all primitives have OpenCL raytracing during program execution I can check if GPU device is accessible and if not, lauch raytracer kernel on CPU. | |
+ | |||
+ | ===Documentation=== | ||
+ | As I realized in BRL-CAD is used doxygen system, so of course I will also document my work in this program. | ||
===Deliverables=== | ===Deliverables=== | ||
− | Great speedup of scenes raytracing in BRL-CAD. For this moment it's | + | Great speedup of scenes raytracing in BRL-CAD. For this moment it's very slow (I have quite fast computer but even for relatively simple scenes raytracing takes about second.) |
+ | |||
==Working Schedule== | ==Working Schedule== | ||
Line 47: | Line 49: | ||
*Fixing at least 1-2 bugs to get familiar with devlopment system. | *Fixing at least 1-2 bugs to get familiar with devlopment system. | ||
*Deeper understanding of BRL-CAD usage (for example completing user tutorial) | *Deeper understanding of BRL-CAD usage (for example completing user tutorial) | ||
− | *Preparing set of function used to kernel | + | *Preparing set of function used to kernel lauching. I suppose, that should be new file with: |
**CL device selecting | **CL device selecting | ||
**Kernel reading and loading to memory | **Kernel reading and loading to memory | ||
Line 54: | Line 56: | ||
===May 19 - August 4 (Development)=== | ===May 19 - August 4 (Development)=== | ||
# week - rt_ell_shot OpenCL kernel. Of course I will have library to handle OpenCL calls so it should be useful in same week. | # week - rt_ell_shot OpenCL kernel. Of course I will have library to handle OpenCL calls so it should be useful in same week. | ||
− | # week - rhc and rpc ray shooting | + | # week - rhc and rpc ray shooting kernerls. |
− | # week - start of rt_tgc_shoot kernel (and 4 other primitives, that are special cases of tgc: rcc, rec,tec,trc). This primitive could be hard to implement | + | # week - start of rt_tgc_shoot kernel (and 4 other primitives, that are special cases of tgc: rcc, rec,tec,trc) |
− | + | # week - finishing rt_tgc_shoot. This primitive could be hard to implement, so I think I should reserve more time to it. | |
− | # week - ehy and epa primitives (It should be relatively easy to write). | + | # week - ehy and epa primitives (It should be relatively easy to write). Start raytracing of simple torus (tor). |
− | # week - | + | # week - finishing tor and kernel for eto primitive. I should also start first really hard raytracing - pipe primitive. |
− | + | //Under construction - sorry :) | |
− | + | ||
− | + | Attempt to rest of primitives if I won't complete raytracer for any primitive I will end it after August 18 (but of course I will do my best to finish all raytracers befor August 4) | |
− | + | ||
=== August 4 - August 18 (Finalising) === | === August 4 - August 18 (Finalising) === | ||
*During these two weeks I will test once more raytracers and benchmark it on some real examples. | *During these two weeks I will test once more raytracers and benchmark it on some real examples. | ||
− | *Final code submission with Google. | + | *Final code submission with Google. |
==Time Availability== | ==Time Availability== | ||
*During summer holidays (after about 21st June) I will be completly free | *During summer holidays (after about 21st June) I will be completly free | ||
− | * | + | *I can devote up to 60 hrs/week. I can working in every time of day (or night) |
− | *In 16th June - | + | *In 16th June - 21st June I have final exams. It's possible that I have a little less time in this term, but I will make up for this time. |
− | * | + | *Befor 16th June I have university courses, but I specially take only three in this semester to participate in GSoC |
==Why BRL-CAD?== | ==Why BRL-CAD?== | ||
− | As I wrote before I like GPGPU and you need somebody to speedup some part of your program. What is more, I know how expensive can be CAD software and I think that this initiative (BRL-CAD) is really important | + | As I wrote before I like GPGPU and you need somebody to speedup some part of your program. What is more, I know how expensive can be CAD software and I think that this initiative (BRL-CAD) is really important. |
==Why you?== | ==Why you?== | ||
− | I'm good in C/C++ coding and GPU programming | + | I'm good in C/C++ coding and GPU programming. In addition to that I'm really hard working and stubborn when I want to reach some target. I think This project is quite mached to my skills and interest so BRL-CAD can be noticeable beter thanks to mine work. |
Furthermore I always want to participate in any open source community so I will stay with you after GSoC ends. | Furthermore I always want to participate in any open source community so I will stay with you after GSoC ends. | ||
− | |||
− | |||
− | |||
− |