Presentation is loading. Please wait.

Presentation is loading. Please wait.

C++ AMP: Accelerated Massive Parallelism in Visual C++ 11 Kate Gregory Gregory Consulting

Similar presentations


Presentation on theme: "C++ AMP: Accelerated Massive Parallelism in Visual C++ 11 Kate Gregory Gregory Consulting"— Presentation transcript:

1

2 C++ AMP: Accelerated Massive Parallelism in Visual C++ 11 Kate Gregory Gregory Consulting www.gregcons.com/kateblog, @gregcons

3

4 Upload your final deck on the speaker portal on or before June 5, 2012 at 5 pm PT. PowerPoint presentations undergo a brief scrub process and are posted to CommNet for attendee access at least 48 hours prior to the session. No design support will be available onsite. The Scrub Process will include: Verification that required slides are included Remove any non-template logos and graphics from the walk-in slide Remove all comments, hidden slides and speaker notes from slides Set file properties box Reset printability to grayscale Notify Presentation Manager of any images identified as unlicensed for escalation Rename files to match naming convention Correct session title and session code to match printed Mini Guide and Schedule Builder Speakers, you must: Use the provided event template and associated colors, fonts, layout and transition slides Correct product names to follow applicable branding rules

5

6 demo Cartoonizer

7

8

9 images source: AMD

10

11

12 void AddArrays(int n, int * pA, int * pB, int * pSum) { for (int i=0; i<n; i++) { pSum[i] = pA[i] + pB[i]; } #include using namespace concurrency; void AddArrays(int n, int * pA, int * pB, int * pSum) { array_view a(n, pA); array_view b(n, pB); array_view sum(n, pSum); parallel_for_each( sum.extent, [=](index i) restrict(amp) { sum[i] = a[i] + b[i]; } ); } void AddArrays(int n, int * pA, int * pB, int * pSum) { for (int i=0; i<n; i++) { pSum[i] = pA[i] + pB[i]; }

13 void AddArrays(int n, int * pA, int * pB, int * pSum) { array_view a(n, pA); array_view b(n, pB); array_view sum(n, pSum); parallel_for_each( sum.extent, [=](index i) restrict(amp) { sum[i] = a[i] + b[i]; } ); } array_view variables captured and associated data copied to accelerator (on demand) restrict(amp): tells the compiler to check that this code conforms to C++ AMP language restrictions parallel_for_each: execute the lambda on the accelerator once per thread extent: the number and shape of threads to execute the lambda index: the thread ID that is running the lambda, used to index into data array_view: wraps the data to operate on the accelerator

14

15

16 vector v(10); extent e(2,5); array_view a(e, v); //above two lines can also be written //array_view a(2,5,v); index i(1,3); int o = a[i]; // or a[i] = 16; //or int o = a(1, 3);

17 demo Matrix Multiplication

18

19

20

21 vector v(8 * 12); extent e(8,12); accelerator acc = … array a(e,acc.default_view); copy_async(v.begin(), v.end(), a); parallel_for_each(e, [&](index idx) restrict(amp) { a[idx] += 1; }); copy(a, v.begin());

22

23

24 array_view data(2, 6, p_my_data); parallel_for_each( data.extent.tile (), [=] (tiled_index t_idx)… { … }); T T

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40 http://blogs.msdn.com/nativeconcurrency/

41

42 Breakout Sessions (session codes and titles) Hands-on Labs (session codes and titles) Product Demo Stations (demo station title and location) Related Certification Exam Find Me Later At… Required Slide *delete this box when your slide is finalized Speakers, please list the Breakout Sessions, Labs, Demo Stations and Certification Exams that relate to your session. Also indicate when they can find you staffing in the TLC.

43 Resource 1 Resource 2 Resource 3 Resource 4 Required Slide *delete this box when your slide is finalized Track PMs will supply the content for this slide, which will be inserted during the final scrub.

44 Connect. Share. Discuss. http://northamerica.msteched.com Learning Microsoft Certification & Training Resources www.microsoft.com/learning TechNet Resources for IT Professionals http://microsoft.com/technet Resources for Developers http://microsoft.com/msdn

45 Required Slide Complete an evaluation on CommNet and enter to win!

46 Scan the Tag to evaluate this session now on myTechEd Mobile Required Slide *delete this box when your slide is finalized Your MS Tag will be inserted here during the final scrub.

47 play, fun, entertainment notebook, learning mouselearn, ideasfile, papershare, concepts share, speech bubble thought bubble search, learning coffee, work, office computer monitor luggage, travel badge, registration global, locationthe cloudairplane, travel this way, look here twitterdecorative arrowthis way, arrowBirds of a feather finance, calculator this way, arrowhands-on labsthis way, connect

48 play, fun, entertainment notebook, learning mouselearn, ideasfile, papershare, concepts share, speech bubble thought bubble search, learning coffee, work, office computer monitor luggage, travel badge, registration global, locationthe cloudairplane, travel twitterdecorative arrowthis way, arrowBirds of a feather finance, calculator this way, arrowhands-on labsthis way, connect this way, look here

49 Slide for Showing Developer’s Software Code Use this layout to show software code The font is Consolas, a monospace font The slide doesn’t use bullets but levels can be indented using the “Increase List Level” icon on the Home menu

50 demo Name Title Group Demo Title

51


Download ppt "C++ AMP: Accelerated Massive Parallelism in Visual C++ 11 Kate Gregory Gregory Consulting"

Similar presentations


Ads by Google