

AFDS11: Microsoft Announces C++ AMP, Competitor to OpenCL - johnrdavisjr
http://pcper.com/news/General-Tech/AFDS11-Microsoft-Announces-C-AMP-Competitor-OpenCL

======
scott_s
I don't know if it's accurate to say this is a competitor to OpenCL. We don't
have full details, but I wouldn't be surprised if this was _implemented using
OpenCL_. OpenCL is relatively low-level. It's quite un-friendly for developers
to use directly. It's much more reasonable for compilers to generate it, or
for libraries to build abstractions on top of it.

My dissertation work did a similar with with OpenMP-like syntax and semantics
built on top of the Cell's native API:
<http://people.cs.vt.edu/~scschnei/cellgen/> (And, actually, my compiler
generated code for a library that was a thin wrapper on top of the Cell's
native API itself - it's so low-level that it was easier to have another layer
of abstraction between my generated code and it.)

~~~
panic
OpenCL is a language designed for writing programs where performance is
important. I'm not sure how you could abstract away from it or compile down to
it without losing some control over the code's performance characteristics.

A compiler would be better off compiling directly to either native code (if
running on a CPU) or something like PTX (for NVidia GPUs).

~~~
scott_s
You'll probably lose _some_ performance, but you can also make
disproportionately large productivity gains. Performance loss generally isn't
the largest limitation, but rather _expressivity_. That is, by providing
higher-level abstractions, you're also saying "this is how you need to write
your computations." In other words, you define a programming model. If the
problem you want to solve does not cleanly map to that programming model, then
you can't use it.

We've been playing this game every since Fortran was first invented. Yeah, you
probably could get better performance if you wrote your application one level
of abstraction lower, but once you get a sufficiently sophisticated compiler,
the performance benefit is marginal compared to the programming time and
effort. Further, _libraries_ tend not to be written directly in assembly, and
will often rely on other libraries. I could see implementing something similar
to what MS showed purely as a C++ library.

------
regularfry
"another option with the full weight of Microsoft behind it"

Well, thank goodness for that. There was me thinking it might be a temporary
project to grab some developer mindshare to be dumped in a couple of years.

~~~
moondowner
Time will show if this statement will be true.

They've put weight on Silverlight as well and now they're ditching it for
HTML5.

~~~
phsr
Not entirely true. They are ditching it as a java write-once, run-everywhere
for the web platform. Windows Phone 7 relies heavily on it/WPF. And in a
corporate environment where everyone will be running IEx, it makes sense to
develop applications in it.

------
cageface
Just when I thought Microsoft had finally seen the virtue of contributing to
an existing standard instead of being different just for the sake of being
different. Surely the software industry as a whole would be better off if
Microsoft instead threw its weight into fixing whatever is wrong with OpenCL.

~~~
moondowner
True, why not utilize OpenCL but invent another alternative?

~~~
profquail
OpenCL is equivalent to OpenGL -- runs on Windows, Linux, etc. (even coming to
smartphones soon).

C++ AMP is based on the DirectCompute APIs in DirectX 11.

My $.02 -- maybe the target audience for C++ AMP is different than the target
audience for OpenCL. Before it was released, I really liked the idea of OpenCL
but in practice it doesn't really deliver very well (performance-wise)
compared to alternatives like nVidia CUDA, AMD APP (formerly Stream), and
DirectCompute.

~~~
andrewcooke
what? i've seen no performance difference between CUDA and OpenCL (targeting
NVidia hardware). they are so low level and so similar that it's hard to see
how there can be differences. what are you referring to?

~~~
profquail
The problem is this -- go ahead and take that OpenCL code and run it on some
non-nVidia hardware. For any reasonably complex code, it turns out that you
really need to optimize specifically for whatever hardware you're running on.
So, while you may be using a standardized API, you still have to write
specific versions of your code for each platform that you want to get the best
performance on.

IMO, developers would rather write against a non-standard API (a la C++ AMP)
that ran at a _consistently_ good performance level across all of their
targets (nVidia/AMD/Intel GPUs, multicore CPUs, etc.).

------
nvictor
wow didn't i just see AMD's announcement of OpenCL?

~~~
profquail
No, OpenCL's been out for a while now. AMD just announced they were releasing
a new set of developer tools for OpenCL.

<http://news.ycombinator.com/item?id=2660904>

