Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
OpenCL "Hello World" (developer.apple.com)
32 points by pieter on Aug 28, 2009 | hide | past | favorite | 19 comments


[deleted]


Do you understand the problem that OpenCL is trying to solve? Literally printing "Hello World" would be a useless example. As others have noted the example is appropriate, as it preforms calculations on dataset, something that can potentially benefit greatly by accessing multiple CPUs.


Have you read the first sentence under the title?

This chapter guides you through the creation of a simple OpenCL application that performs calculations on a data set.


None of those examples actually demonstrate anything useful (except maybe the last one which I don't understand).


I can't wait to see some useful applications of this.


So am I.

But my second thought was "Oh my GOD, how many pages of text for a single loop to run?". I'm sure they'll improve the api (with a wrapper layer), but right now OpenCL will only be used by the more demanding of applications.

EDIT: Maybe that sounded wrong. For huge classes of problems this isn't an issue, but to really pull that power down to the everyday developer, an easier wrapper api will be needed.

I can see spreadsheets using this stuff, but not as it stands now. On the other hand a gpgpu raytracer could use opencl as it stands now.


Why not spreadsheets? The end-user would not be bothered with this stuff.


New drugs have been designed for a few years now using GPU computing.


New drugs may be required so programmers won't notice the monstrosities going on.

What's the deal with const char *KernelSource = HUGE_MULTILINE_STRING_WITH_EXPLICIT_\n ???

Its worse than SQL statements embedded inside GUI event handlers.


It's very similar to OpenGL actually. I can't defend their choice of syntax, but at least they're consistant.


That depends on the language bindings, I guess. In a language with first class expression trees (like s-expressions) you could do this cleanly.


I can't wait for support in other languages.


Khronos is working on C++ bindings. But having the core API in pure C should make adding bindings to other languages a (relatively) easy thing to do.


I can't wait for a nice DSL that will generate this boilerplate code for you...


No no! Wrong approach. You want the DSL to run your code, not to generate code you can't hope to understand.


Nobody can beat this masterpiece of classics:

int main(void) { printf("Hello, world!\n"); return 0; }


Maybe not in terms of execution time, but in maintainability and set-up time, nothing beats:

    echo Hello, world!


So how does Ruby's performance on vector code compare with OpenCL?


Yes, but what about: void main(void) { printf("Hello, world!\n"); }

;-)


Hello boilerplate.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: