OpenCL 1.0 Support?

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
Num3
PureBasic Expert
PureBasic Expert
Posts: 2812
Joined: Fri Apr 25, 2003 4:51 pm
Location: Portugal, Lisbon
Contact:

OpenCL 1.0 Support?

Post by Num3 »

OpenCL™ is the first open, royalty-free standard for cross-platform, parallel programming of modern processors found in personal computers, servers and handheld/embedded devices. OpenCL (Open Computing Language) greatly improves speed and responsiveness for a wide spectrum of applications in numerous market categories from gaming and entertainment to scientific and medical software.
In plain english, "OpenCL gives any application access to the Graphical Processing Unit for non-graphical computing."

Since all new (AMD/NVIDIA) graphic cards support OpenCL, my request is...

Any chance for OpenCL API to be included has a library of Purebasic?

I believe PB would benefit a lot by allowing to use OpenCL from it's compiler!

Here's the quick guide http://www.khronos.org/files/opencl-qui ... e-card.pdf
And it's home http://www.khronos.org/opencl/
Fred
Administrator
Administrator
Posts: 18162
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: OpenCL 1.0 Support?

Post by Fred »

Feel free to import it via Import/endImport, creating program in CL language is far from easy and not beginners oriented ;).
Num3
PureBasic Expert
PureBasic Expert
Posts: 2812
Joined: Fri Apr 25, 2003 4:51 pm
Location: Portugal, Lisbon
Contact:

Re: OpenCL 1.0 Support?

Post by Num3 »

:lol:

Or that :wink: !

I'll sink into it this week end
DarkDragon
Addict
Addict
Posts: 2344
Joined: Mon Jun 02, 2003 9:16 am
Location: Germany
Contact:

Re: OpenCL 1.0 Support?

Post by DarkDragon »

Num3 wrote::lol:

Or that :wink: !

I'll sink into it this week end
Thanks. Maybe you could share your imports and defines with us? Btw.: They have idl files for the opengl headers, maybe they also have idl files for the opencl headers on their webpage. IDL is a general headerdefinition language, maybe you could try to be conform with that then.
bye,
Daniel
eriansa
Enthusiast
Enthusiast
Posts: 277
Joined: Wed Mar 17, 2004 12:31 am
Contact:

Re: OpenCL 1.0 Support?

Post by eriansa »

Could be the future! Now that octacores are coming and intel is giving alpha opencl free.

But man, I really do not understand how to use it ;-)
Blankname
Enthusiast
Enthusiast
Posts: 120
Joined: Sun Oct 14, 2012 9:11 am

Re: OpenCL 1.0 Support?

Post by Blankname »

eriansa wrote:Could be the future! Now that octacores are coming and intel is giving alpha opencl free.

But man, I really do not understand how to use it ;-)
Quite a long bump, but personally would see if anyone has made any headway with OpenCL and PureBasic. AMD is pushing their accelerated processors big time, and will be pushing even stronger ones for many years to come (Kaveri will have around 512 GCN cores!). So OpenCL is the future of high performance computing (at least for AMD as they push HSA). Would be nice to harness all that GPU horsepower with no PCIe latency in PureBasic. :twisted:
Fred
Administrator
Administrator
Posts: 18162
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: OpenCL 1.0 Support?

Post by Fred »

There some code here to get you started: http://www.purebasic.fr/english/viewtop ... lit=opencl
User avatar
Guimauve
Enthusiast
Enthusiast
Posts: 742
Joined: Wed Oct 22, 2003 2:51 am
Location: Canada

Re: OpenCL 1.0 Support?

Post by Guimauve »

Fred wrote:There some code here to get you started: http://www.purebasic.fr/english/viewtop ... lit=opencl
Yes but it didn't work. The code don't trigger any error but the calculation don't return the expected result and I don't know why.

It is because we have to use unsigned Quad to make it to work ? I don't know, you told me !

If someone can successfully make a working example, please let me know.

Best regards
Guimauve
Dear Optimist, Pessimist,
and Realist,

While you guys were
busy arguing about the
glass of water, I DRANK IT !

Sincerely,
the Opportunist
User avatar
Danilo
Addict
Addict
Posts: 3036
Joined: Sat Apr 26, 2003 8:26 am
Location: Planet Earth

Re: OpenCL 1.0 Support?

Post by Danilo »

Guimauve wrote:
Fred wrote:There some code here to get you started: http://www.purebasic.fr/english/viewtop ... lit=opencl
Yes but it didn't work. The code don't trigger any error but the calculation don't return the expected result and I don't know why.

It is because we have to use unsigned Quad to make it to work ? I don't know, you told me !

If someone can successfully make a working example, please let me know.
I think you need to look at the ATI/AMD, NVIDIA and INTEL software development kits for OpenCL
and use the functions from their SDKs, not OpenCL directly. ( links at http://en.wikipedia.org/wiki/Opencl )
OpenCL is the low level API that the manufacturers use for their implementation and SDKs, no?
User avatar
Guimauve
Enthusiast
Enthusiast
Posts: 742
Joined: Wed Oct 22, 2003 2:51 am
Location: Canada

Re: OpenCL 1.0 Support?

Post by Guimauve »

No, if you use their SDK (AMD/ATI or NVIDIA) if you create a program with one of them it will not work with the other one and vice versa. So it's better to use OpenCL directly.

My question is : What happen when the OpenCL command need an unsigned Int64 and you pass a PB Quad (signed Int 64) as parameter ?

This is why I wish to have a PB equivalent of all types available in C/C++. But Yes PureBasic is a Basic language and should limited to basic programming only so please forget this Feature Request.

Best regards
Guimauve
Dear Optimist, Pessimist,
and Realist,

While you guys were
busy arguing about the
glass of water, I DRANK IT !

Sincerely,
the Opportunist
User avatar
Shield
Addict
Addict
Posts: 1021
Joined: Fri Jan 21, 2011 8:25 am
Location: 'stralia!
Contact:

Re: OpenCL 1.0 Support?

Post by Shield »

Nothing happens. They are exactly the same from the point of view of the CPU. The only difference is the interpretation. You need to make sure the bits are set correctly and that you interpret them the right way.
Image
Blog: Why Does It Suck? (http://whydoesitsuck.com/)
"You can disagree with me as much as you want, but during this talk, by definition, anybody who disagrees is stupid and ugly."
- Linus Torvalds
User avatar
Guimauve
Enthusiast
Enthusiast
Posts: 742
Joined: Wed Oct 22, 2003 2:51 am
Location: Canada

Re: OpenCL 1.0 Support?

Post by Guimauve »

Shield wrote:You need to make sure the bits are set correctly and that you interpret them the right way.
That my point, we have to "Set" the sign bit manually while other language, like C/C++, it's done in background. But as I said PureBasic is a Basic language and should be limited to basic programming only.

Best regards
Guimauve
Dear Optimist, Pessimist,
and Realist,

While you guys were
busy arguing about the
glass of water, I DRANK IT !

Sincerely,
the Opportunist
User avatar
Shield
Addict
Addict
Posts: 1021
Joined: Fri Jan 21, 2011 8:25 am
Location: 'stralia!
Contact:

Re: OpenCL 1.0 Support?

Post by Shield »

Of course it is easier if you have those types available.
But this feature request has been made in the stone age and we still haven't gotten unsigned types
except those for characters. Maybe they will come some day. :wink:
Image
Blog: Why Does It Suck? (http://whydoesitsuck.com/)
"You can disagree with me as much as you want, but during this talk, by definition, anybody who disagrees is stupid and ugly."
- Linus Torvalds
Fred
Administrator
Administrator
Posts: 18162
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: OpenCL 1.0 Support?

Post by Fred »

You can check the topic for a full example: http://www.purebasic.fr/english/viewtop ... 12&t=53249
Post Reply