GTC 2012 Program Guide - GPU Technology Conference
GTC 2012 Program Guide - GPU Technology Conference
GTC 2012 Program Guide - GPU Technology Conference
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
C++ Accelerated Massive Parallelism (C++ AMP)<br />
���������������������������������������������������������������<br />
What is C++ AMP, how can it help me, and where can I get it?<br />
C++ AMP is a key new C++ language feature plus an STL-like library. It's designed to help you increase the performance of<br />
����������������������������������������������������������������������������������������������������������������������<br />
���������������������������������������������������������������������������������������������������������������������������<br />
�������������������������������������������������������������������������������������������������������������������������<br />
���������������������������������������������������������������������������������������������������������������������<br />
���������������������������������������������������������������<br />
MICROSOFT Ad?<br />
What platforms and hardware does C++ AMP support?<br />
������������������������������������������������������������������������������������������������������������������������<br />
�����������������������������������������������������������������������������������������������������������������������<br />
����������������������������������������������������<br />
�������������������������������������������������������������������������������������������������������������������<br />
What new language feature does C++ AMP introduce?<br />
Microsoft added the restrict(amp)� ��������� ������ ���� ���� ������ ��� ���� ��������� ����������� ��������� ��� �������� ����� ����<br />
function can be executed on a C++ AMP accelerator. The restrict keyword instructs the compiler to statically check that the<br />
�����������������������������������������������������������������������������������������void myFunc() restrict(amp) {…}<br />
��������������������������������������������������������������������������������������������������������������������������<br />
for purposes that are unrelated to C++ AMP.<br />
What new classes (APIs) does C++ AMP introduce?<br />
��������������������������������������������������������������������������������������������������������������������<br />
���������������������������������������������������������������������������������������������������������������������<br />
��������������������������������������������������������������������������������������������������������������������������<br />
�����������������������������������������������������������������������������<br />
���������������������������������������������������������������������������������������������������<br />
What does C++ AMP code look like?<br />
�����������������������������������������������������������������������������������������������<br />
void AddArrays(int n, int m, int * pA, int * pB, int * pSum) {<br />
concurrency::array_view a(n, m, pA), b(n, m, pB), sum(n, m, pSum);<br />
concurrency::parallel_for_each(sum.extent, [=](concurrency::index i) restrict(amp)<br />
{<br />
sum[i] = a[i] + b[i];<br />
});<br />
}<br />
Follow our blog: ������������������������������������������<br />
Ask questions: ��������������������������������������������������������������������