Page 1 of 2 12 LastLast
Results 1 to 10 of 18

Thread: OpenCL: "Hello World" adapted from Apple code [Updated Sep 04 2011]

  1. #1
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,128
    Rep Power
    732

    OpenCL: "Hello World" adapted from Apple code [Updated Sep 04 2011]

    Hi,

    after brief pause here comes next journey to the realm of OpenCL.
    This time it is adaptation of Apple "OpenCL Hello World" code.

    The current situation with drivers on OpenCL is quite terrifying, even this official example didn't run here, and I had to do few tweaks to make it work. For this reason I am very curious about your experience with the code.

    Lesson learned - avoid at any cost situation, where your application should rely on technique described in specification as "implementation defined".

    Another funny thing which occurs with this example is that it has some precision problems, for 3 digits after dot ok, but the rest is usually slightly imprecise. Maybe it is caused by fact thinBASIC used EXT precision during calculations.

    Important note: The code requires the OpenCL headers.

    Have fun,
    Petr

    P.S. Should be the Apple notice kept in this modified version? I do not understand clearly what they are saying there.
    Attached Images Attached Images
    Attached Files Attached Files
    Last edited by Petr Schreiber; 04-09-2011 at 18:08.
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  2. #2

    Re: OpenCL: "Hello World" adapted from Apple code

    Hi Petr,

    I get correct 1009/1024 computed 1009/1024

  3. #3
    thinBasic MVPs kryton9's Avatar
    Join Date
    Nov 2006
    Location
    Naples, Florida & Duluth, Georgia
    Age
    67
    Posts
    3,869
    Rep Power
    404

    Re: OpenCL: "Hello World" adapted from Apple code

    Petr, did you join the Apple world as Mike Hartlef and my Nephew have?
    Acer Notebook: Win 10 Home 64 Bit, Core i7-4702MQ @ 2.2Ghz, 12 GB RAM, nVidia GTX 760M and Intel HD 4600
    Raspberry Pi 3: Raspbian OS use for Home Samba Server and Test HTTP Server

  4. #4
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,128
    Rep Power
    732

    Re: OpenCL: "Hello World" adapted from Apple code

    Charles,

    thank you, I get the same result 1009/1024.
    When you look at the numbers they are not that much off topic, but still...

    Hehe Kent, no no, here you can still hear about people with iPhone from legends rather than seeing somebody actually have it
    I just desperately seek for working OpenCL code, but so far any code I pick, I always have to amend it.
    Did it ran on your nvidia? It did for me under 196.21, but not sure about older drivers.


    Petr

    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  5. #5
    thinBasic MVPs kryton9's Avatar
    Join Date
    Nov 2006
    Location
    Naples, Florida & Duluth, Georgia
    Age
    67
    Posts
    3,869
    Rep Power
    404

    Re: OpenCL: "Hello World" adapted from Apple code

    I get an error since I don't have the opencl.dll. I am doing my coding on my old gateway notebook, and that alas has an ATI Radeon Mobility.
    I need to read up on all these new opengl thingy's... opencl, opengl es to see what is what and if I need to download any of them.
    Acer Notebook: Win 10 Home 64 Bit, Core i7-4702MQ @ 2.2Ghz, 12 GB RAM, nVidia GTX 760M and Intel HD 4600
    Raspberry Pi 3: Raspbian OS use for Home Samba Server and Test HTTP Server

  6. #6

    Re: OpenCL: "Hello World" adapted from Apple code


    OpenCL is not quite the paragon of elegance we might hope for - far too many parameters to deal with. I suppose they are trying to cover all the options that might occur but it makes it hard for early adopters.

  7. #7
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,128
    Rep Power
    732

    Re: OpenCL: "Hello World" adapted from Apple code

    Hi Kent,

    GeForce 8xxx/9xxx/2xx+ is required, or Radeon HD 4xxx/5xxx series, both with the latest drivers.

    It is slightly confusing technology at the time, mostly due to little fragile implementations currently, but I found it quite exciting to explore and it is indeed very fast once you understand the basic rules.

    It seems with ATi you can use both CPU and GPU as devices, with Nvidia it seems only GPUs are supported, as there is no Nvidia CPU

    I am curious if Intel will enter this area... I hope it won't end as their promised OpenGL 3.x support.


    Petr
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  8. #8
    thinBasic MVPs kryton9's Avatar
    Join Date
    Nov 2006
    Location
    Naples, Florida & Duluth, Georgia
    Age
    67
    Posts
    3,869
    Rep Power
    404

    Re: OpenCL: "Hello World" adapted from Apple code

    I think all of these guys in the cutting edge see the big paradigm shift coming. Multi-Core everywhere and on all sorts of devices. The tegra 2 is a dual core with incredible battery life. Look at the left side bar from this link, it gives you an idea where we are and will be computing instead of the desktop.
    http://www.nvidia.com/object/tegra_250.html

    I can see why OpenCL is here now, just not sure which direction to go right now... just sort of sitting back and watching on a daily basis at the big changes coming this year.
    Acer Notebook: Win 10 Home 64 Bit, Core i7-4702MQ @ 2.2Ghz, 12 GB RAM, nVidia GTX 760M and Intel HD 4600
    Raspberry Pi 3: Raspbian OS use for Home Samba Server and Test HTTP Server

  9. #9
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,128
    Rep Power
    732

    Re: OpenCL: "Hello World" adapted from Apple code

    Hi Kent,

    yes, very nice device. But once you touch the GPGPU with tens or even hundreds of little dedicated compute devices ... 2 cores is not enough

    I updated the code.
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  10. #10
    thinBasic MVPs kryton9's Avatar
    Join Date
    Nov 2006
    Location
    Naples, Florida & Duluth, Georgia
    Age
    67
    Posts
    3,869
    Rep Power
    404

    Re: OpenCL: "Hello World" adapted from Apple code

    What I am saying Petr is that this is the trend. The dual core tegra 2, is 2 arm processors and a gpu able to run unreal engine 3. Next year we might see the Tegra 4, quad core.. and so on. People are liking not being tethered to their desks and the new input that the processors are now able to process, multi-touch and tilt and acceleration sensors make using the devices very easy and intuitive.

    I am seeing it with my family members who stumbled with the mouse and never really did anything with their computers besides surf the web and check email. They never used their webcams, they couldn't put their photos into attachments etc. But now with these new devices they are able to do all of the above and are actually enjoying and thrilled by it.

    Anyways I am glad you took on OpenCL as I think it will be very very useful soon everywhere.
    Acer Notebook: Win 10 Home 64 Bit, Core i7-4702MQ @ 2.2Ghz, 12 GB RAM, nVidia GTX 760M and Intel HD 4600
    Raspberry Pi 3: Raspbian OS use for Home Samba Server and Test HTTP Server

Page 1 of 2 12 LastLast

Members who have read this thread: 0

There are no members to list at the moment.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •