Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Photovore

macrumors regular
Dec 28, 2011
116
0
Eh, I think OpenMP is kind of done. I mean, it's easy to code for, but stuff like OpenCL is much more powerful. Yeah, OpenCL is more difficult to code, but it can scale way way better, especially for scientific uses.

My feeling from Apple is if you don't want to go all the way to OpenCL, they really want you to use libDispatch instead.

OpenCL is absolutely wonderful; I couldn't do my work without it. YES it was several mountains to climb in succession to get there. The first mountain was that I didn't know XCode! (was still doing dev under SheepShaver and CodeWarrior). Second mountain OCL itself. Third mountain rewriting to use vector types. But it was COMPLETELY worth the effort for my task.

Yep I did do Grand Central Dispatch first, to flex me muscles, and that did double my throughput on the CPU, but even just on the CPU, OpenCL doubled it again. And having access to the 1300 (albeit weaker) ALUs on the 5870 is New World time.

Looking forward to 7980 support and an Apple version of that card.

... and a note to FluJunkie: I'm in psychophysics myself (though that's not what I use OpenCL for). Most of the labs in my building, like mine, are 100% Mac. (Well, we do have a PC for eye tracking but I don't think it runs Windows -- some stripped-down customized DOS.) Mostly folks write their own software in MatLab. The software package (BrainSight) we use to aim magnetic pulses into the cortex, using prior MRI scans as a guide, runs on a Mac. Of course, we don't quite have grant money to throw away, so while we have a couple Pros and newer Minis, we're still using our G4 towers; my work desktop is a twin 2.4 GHz G4 "mirror door" that I remember being the fastest machine in the building when we bought it -- now seems suuuuper slow. But -- I guess in my rambling here, part of my point is that all of these labs have a heavy investment in home-developed software and will stick with Macs. MatLab under Windows exists but it's more difficult to run multiple screens, among other reasons; plus, non-trivially, most of us mac-heads would find switching to Windows to be an odious, noisome task, and would rather bend over and bite the tips off &**DS&SDF(ALKJAF:LJKSDFa;s.fd.as.df.... [signal lost]
 

deconstruct60

macrumors G5
Mar 10, 2009
12,264
3,861
Eh, I think OpenMP is kind of done. I mean, it's easy to code for, but stuff like OpenCL is much more powerful. Yeah, OpenCL is more difficult to code, but it can scale way way better, especially for scientific uses.

Those two overlap but there is are different. OpenCL has a "run this function written in this special dialect elsewhere" aspect to it. OpenMP is more make this shared memory code probable ( Cray , AIX , Linux , Mac OS X ) and isn't particularly driving a specific dialect.

My feeling from Apple is if you don't want to go all the way to OpenCL, they really want you to use libDispatch instead.

Apple wants you to write platform specific, non portable code. Not very surprising. Shades of the period of time where they went completely hostile to anything not written in Objective-C on iOS.
 

itsmrjon

macrumors regular
Jun 11, 2011
122
0
Chicago
Eh, I think OpenMP is kind of done. I mean, it's easy to code for, but stuff like OpenCL is much more powerful. Yeah, OpenCL is more difficult to code, but it can scale way way better, especially for scientific uses.

I don't really see how OpenCL can scale better. I do like the fact that you can do mixed CPU/GPU/APU programming from a single code without directives, however in terms of pure scalability shared memory is always fastest.

OpenCL's weakness is runtime compilation
CUDA's weakness is hardware dependency
OpenMP's weakness is distributed memory
MPI's weakness is communication overhead

But when you write a program that uses MPI to to communicate between nodes, OpenMP to parallelize operations on the node, and CUDA to take advantage of the GPUs on the node, you have a beast code.

OpenCL cannot do that.

The beauty of OpenCL is like what FaH accomplished. Truly distributed computing by using a wide variety of platforms from various volunteers across the world. It can be run on virtually any system or architecture. But, their computations lend themselves to this type of deployment, a low latency computation such as mine wouldn't benefit from this.

----
Lol this thread just got real. You don't see conversations like this often outside of the Mac Pro section. Most threads tend to be something like 'OMG! Apple is god and the iPhone is their gift to earth!'
 

goMac

Contributor
Apr 15, 2004
7,662
1,694
Apple wants you to write platform specific, non portable code. Not very surprising. Shades of the period of time where they went completely hostile to anything not written in Objective-C on iOS.

Actually not. Libdispatch is open source, with ports to BSD, Linux and Windows.

Still requires LLVM, but other platforms have it. The blocks makes it kind of an issue with non-Apple versions of GCC.

I don't really see how OpenCL can scale better. I do like the fact that you can do mixed CPU/GPU/APU programming from a single code without directives, however in terms of pure scalability shared memory is always fastest.

Sure, but if you're talking about a problem set that requires distributed computation, shared memory drops out of the equation anyway.

Shared memory is a bound on scalability.

OpenCL's weakness is runtime compilation
CUDA's weakness is hardware dependency
OpenMP's weakness is distributed memory
MPI's weakness is communication overhead

But when you write a program that uses MPI to to communicate between nodes, OpenMP to parallelize operations on the node, and CUDA to take advantage of the GPUs on the node, you have a beast code.

OpenCL cannot do that.

The beauty of OpenCL is like what FaH accomplished. Truly distributed computing by using a wide variety of platforms from various volunteers across the world. It can be run on virtually any system or architecture. But, their computations lend themselves to this type of deployment, a low latency computation such as mine wouldn't benefit from this.

Right, that's why I mentioned OpenCL being the best option. If you're working on really big problems beyond the scale of what your local CPUs are doing, you can toss the kernel and a portion of the problem set to your GPU, someone else's CPU, someone else's GPU, etc.

I would love to see a server platform who's sole job was to act as an general OpenCL host. Then we wouldn't have to worry about big iron being vendor specific or platform specific. You just have a host at the other end of the wire that accepts OpenCL kernels and data, and sends you the results back.

Which also would be a nice solution if the Mac Pro was discontinued. :) Wouldn't be a catch all. Some things that are good for distribution like compilation aren't good for OpenCL... But that sort of thing would be awesome for building a cluster around a bunch of Final Cut/After Effects/Avid users all sitting on a network together.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.