PDA

View Full Version : About the section "OpenCL in Action by Matthew Scarpino"



Petr Schreiber
17-09-2012, 22:10
Using GPU for computations is very hot topic today, and ThinBASIC allows you to unleash the power of graphic card thanks to OpenCL headers (http://www.thinbasic.com/community/showthread.php?10159-OpenCL-Headers-Updated-Sep-15-2011), converted from Khronos C original.

Headers are one thing, understanding and ability to use the OpenCL technology other. After some years of search I found an excellent book on this technology, which leads you step by step, with lots of examples and good explanations.

The book is titled: "OpenCL in action" (http://www.manning.com/scarpino2/) and written by Matthew Scarpino.

I decided to convert the C examples from this book to ThinBASIC, to both demonstrate that conjunction of interpreters and high performance computing are not an oxymoron at all and to bring this publication a bit more into focus, because good learning books written with passion are very, very rare.

For the start I will publish each example in own thread, so we can discuss it more easily and to group possible derivative works in one stream, to see, where the OpenCL adventure will lead us...

Fasten your seatbelts, plug the GPUs well in the PCI-E slots, here comes the OpenCL :)


Petr

kryton9
18-09-2012, 22:14
Thanks Petr, looking forward to seeing how opencl works. The little I looked, it is scary! Scary enough, that it made shaders look easy :)

Petr Schreiber
19-09-2012, 08:29
OpenCL caused me a lot of gray hair when I started working with it back in 2010. It was in time drivers were buggy so I even learned some bad habits, because functions didn't work according to specs.

Going through this book in 2012 is very pleasant on the other side - it goes from simple stuff to more complex without big jumps, so you can understand what does what and why very easily.

The example from chapter 1 might look overhelming, but it is important to give overall idea.

Starting from chapter 2 (http://www.thinbasic.com/community/showthread.php?11863-Chapter-2-example-1-Testing-platform-extensions&p=87176#post87176) examples it goes from absolute basics, so it should be easy to follow.

The best is to get the book, it is really well written. I will try to comment the examples more too, but of course I cannot cite the whole book, that would get me in legal issues quite fast I am afraid :)


Petr