Thread: OpenCL for beginner

  1. #1
    Registered User
    Join Date
    Dec 2009
    Location
    Colorado
    Posts
    41

    OpenCL for beginner

    I am interested in parallel computing and want to learn more about using OpenCL to write programs to run on my GPU. I have found some sources of information and some sample code online but it seems pretty complicated. Are there any suggestions you guys have that would be a good starting point? Thanks

  2. #2
    spurious conceit MK27's Avatar
    Join Date
    Jul 2008
    Location
    segmentation fault
    Posts
    8,300
    If they are as generally pathetic as the GL community* in the standards they set vis "sample code online", then there often really is NO good starting point. These people could spend 3-5 pages making how to change a lightbulb "seem pretty complicated" and it still won't be done at the end.

    Usually, the hard part is dealing with this tedious and what often seems like intentionally dysfunctional documentation. Do not be discouraged however! The software itself works very well once you understand it (or at least, GL does). Just beware there are plenty of "commentators" around who perhaps want to defend their own territory by preventing you from doing that. Pathetic as it sounds, I have no doubt that it is very (and perhaps frequently) true.

    So good luck. There are NO standards on the web. If you think something is badly done after a few minutes, it is probably not going to get better. Unfortunately, the more esoteric the topic, the more often you will not have any choice in the matter. Since CL will only have a fraction the documentation that GL does, I promise you will find yourself between a rock and a hard place a lot getting info.

    Khronos's own stuff is probably going to be give you the best explanations of individual commands:

    OpenCL 1.0 Reference Pages

    Just they do not attempt to demonstrate any use of the commands in a "wholistic" context, such as complete working code, very much.

    *they are under the same management
    C programming resources:
    GNU C Function and Macro Index -- glibc reference manual
    The C Book -- nice online learner guide
    Current ISO draft standard
    CCAN -- new CPAN like open source library repository
    3 (different) GNU debugger tutorials: #1 -- #2 -- #3
    cpwiki -- our wiki on sourceforge

  3. #3
    Registered User
    Join Date
    Dec 2009
    Location
    Colorado
    Posts
    41
    That is what I was afraid of! Oh well, there is nothing wrong with a little (or a lot) of hard word

  4. #4
    Registered User
    Join Date
    Dec 2009
    Posts
    1
    I would definitely check out NVidia's OpenCL resources - certainly the most complete offerings I've found. In terms of it being difficult to learn, there's nothing to do but bite the bullet, grab some code and start trying to understand it

    I'm trying to rewire an open-source library to pass work off to GPUs via OpenCL and need to learn C++ and C as well as understand the specific code. No way to do it but dive in!

    If it's too tricky there's always Python: http://python-opencl.next-touch.com/

  5. #5
    Registered User
    Join Date
    Jan 2009
    Posts
    1,485
    I would definately look into these:

    OpenCL Tutorials | MacResearch

  6. #6
    Registered User jeffcobb's Avatar
    Join Date
    Dec 2009
    Location
    Henderson, NV
    Posts
    875

    Good Parallel Computing challenge

    Not OpenCL exactly but if you can get your hands on a PS3 you can learn to code for the CellBE (single central proc and 7 (usable) co-procs to code for). When you make something run on this and run well you will know parallel coding on a whole new level.

    I am not saying this is the only way; I am working on a swarm computing method on my own right now but being distributed it brings a different set of skills and challenges...
    C/C++ Environment: GNU CC/Emacs
    Make system: CMake
    Debuggers: Valgrind/GDB

  7. #7
    Registered User
    Join Date
    Dec 2009
    Location
    Colorado
    Posts
    41
    Hey Jeff, I just got a PS3 actually. It is a newer model though so I can't load YDL on it. Can I still write and run code on there with the standard PS software on there? I really like the idea of running code on there

  8. #8
    Registered User jeffcobb's Avatar
    Join Date
    Dec 2009
    Location
    Henderson, NV
    Posts
    875
    Quote Originally Posted by waterborne View Post
    Hey Jeff, I just got a PS3 actually. It is a newer model though so I can't load YDL on it. Can I still write and run code on there with the standard PS software on there? I really like the idea of running code on there
    My friend, that was one the area where Sony dropped the ball in later versions. I was an early adopter and had the Add Other OS option. The libraries were pretty lame and I had the chance rub shoulders with other companies like IBM and Toshiba working on an app framework .
    C/C++ Environment: GNU CC/Emacs
    Make system: CMake
    Debuggers: Valgrind/GDB

Popular pages Recent additions subscribe to a feed