/
Tarek Madkour			Daniel Griffing Tarek Madkour			Daniel Griffing

Tarek Madkour Daniel Griffing - PowerPoint Presentation

danika-pritchard
danika-pritchard . @danika-pritchard
Follow
395 views
Uploaded On 2016-07-17

Tarek Madkour Daniel Griffing - PPT Presentation

Group Program Manager QA Lead Microsoft Visual C Microsoft Visual C Modern C Development with Visual C 2013 Visual Studio 2013 Conformance Performance Productivity Services Mobile Devices ID: 408577

2013 amp debugging code amp 2013 code debugging http visual incl int libs return result static defined type types

Share:

Link:

Embed:

Download Presentation from below link

Download Presentation The PPT/PDF document "Tarek Madkour Daniel Griffing" is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.


Presentation Transcript

Slide1

Tarek Madkour Daniel GriffingGroup Program Manager QA LeadMicrosoft Visual C++ Microsoft Visual C++

Modern C++ Development

with Visual C++ 2013Slide2

Visual Studio 2013 Conformance Performance

Productivity

Services Mobile DevicesWhat’s Next

AgendaSlide3

Visual C++: CadenceFaster and more regular delivery cadence

Updates provide servicing fixes and new features

Additional out-of-band releasesCTP compiler with additional C++11/14 conformance

Rename refactoring

PDB-based project

PGO plug-in, SpeedCopOSS libraries

VS 2008

VS 2010

VS 2012

VS 2013

VS UpdatesSlide4

Visual Studio 2013C++11/14

Performance

ProductivityServicesMobile DevicesSlide5

Visual C++ ISO ConformanceTargeting C++14

Big step improvements in major releases

Incremental improvements in CTPsVS Updates focus on compatibilitySlide6

Explicit conversion

operators

Non-static data member

initializers

__func__

Extended

sizeof

Thread-safe

function local static

init

Inline namespaces

constexpr (incl.

ctors

, literal types)

Raw string literals

= default

Implicit move generation

alignof

alignas

Universal character names in literals

Expression SFINAE

Function template default arguments

=

delete

Ref-qualifiers:

& and && for *thisnoexcept (unconditional)noexcept (incl. conditional)C++11 preprocessor (incl. C++98 & C11)Delegating constructors“using” aliasesC++14 libs: type aliasesC++14 decltype(auto)Inheriting constructorschar16_t, char32_tAttributesC++98 two-phase lookupUniform init & initializer_listsC99 variable declsC99 _BoolC++14 auto function return type deductionUser-defined literalsthread_localC++14 generalized constexprVariadic templatesC99 compound literalsC++14 generic lambdas (partial)C++14 generalized lambda captureUnrestricted unionsC++14 variable templatesC++14 libs: cbegin/ greater<>/make_uniqueC99 designated initializersC++TS? async/await (partial)C++14 libs: std:: user-defined literalsconstexpr (except ctors, literal types)C++TS concepts lite

C++11/14Slide7

VC++ 2013

Explicit conversion

operators

Non-static data member

initializers

__func__

Extended

sizeof

Thread-safe

function local static

init

Inline namespaces

constexpr (incl.

ctors

, literal types)

Raw string literals

= default

Implicit move generation

alignof

alignas

Universal character names in literals

Expression SFINAE

Function template default arguments

=

delete

Ref-qualifiers: & and && for *thisnoexcept (unconditional)noexcept (incl. conditional)C++11 preprocessor (incl. C++98 & C11)Delegating constructors“using” aliasesC++14 libs: type aliasesC++14 decltype(auto)Inheriting constructorschar16_t, char32_tAttributesC++98 two-phase lookupUniform init & initializer_listsC99 variable declsC99 _BoolC++14 auto function return type deductionUser-defined literalsthread_localC++14 generalized constexprVariadic templatesC99 compound literalsC++14 generic lambdas (partial)C++14 generalized lambda captureUnrestricted unionsC++14 variable templatesC++14 libs: cbegin/ greater<>/make_uniqueC99 designated initializersC++TS? async/await (partial)C++14 libs: std:: user-defined literalsconstexpr (except ctors, literal types)

C++TS concepts lite

C++11/14Slide8

VC++ 2013

VC++ Nov 2013 CTP

Explicit conversion

operators

Non-static data member

initializers

__func__

Extended

sizeof

Thread-safe

function local static

init

Inline namespaces

constexpr (incl.

ctors

, literal types)

Raw string literals

= default

Implicit move generation

alignof

alignas

Universal character names in literals

Expression SFINAE

Function template default arguments

=

deleteRef-qualifiers: & and && for *thisnoexcept (unconditional)noexcept (incl. conditional)C++11 preprocessor (incl. C++98 & C11)Delegating constructors“using” aliasesC++14 libs: type aliasesC++14 decltype(auto)Inheriting constructorschar16_t, char32_tAttributesC++98 two-phase lookupUniform init & initializer_listsC99 variable declsC99 _BoolC++14 auto function return type deductionUser-defined literalsthread_localC++14 generalized constexprVariadic templatesC99 compound literalsC++14 generic lambdas (partial)C++14 generalized lambda captureUnrestricted unionsC++14 variable templatesC++14 libs: cbegin/ greater<>/make_uniqueC99 designated initializersC++TS? async/await (partial)C++14 libs: std:: user-defined literalsconstexpr (except

ctors

, literal types)C++TS concepts lite

C++11/14Slide9

VC++ 2013

VC++ Nov 2013 CTP

VC++ Next CTP

Explicit conversion

operators

Non-static data member

initializers

__func__

Extended

sizeof

Thread-safe

function local static

init

Inline namespaces

constexpr (incl.

ctors

, literal types)

Raw string literals

= default

Implicit move generation

alignof

alignas

Universal character names in literals

Expression SFINAE

Function template default arguments

= deleteRef-qualifiers: & and && for *thisnoexcept (unconditional)noexcept (incl. conditional)C++11 preprocessor (incl. C++98 & C11)Delegating constructors“using” aliasesC++14 libs: type aliasesC++14 decltype(auto)Inheriting constructorschar16_t, char32_tAttributesC++98 two-phase lookupUniform init & initializer_listsC99 variable declsC99 _BoolC++14 auto function return type deductionUser-defined literalsthread_localC++14 generalized constexprVariadic templatesC99 compound literalsC++14 generic lambdas (partial)C++14 generalized lambda captureUnrestricted unionsC++14 variable templatesC++14 libs: cbegin/ greater<>/make_uniqueC99 designated initializersC++TS? async/await (partial)C++14 libs: std:: user-defined literals

constexpr

(except

ctors

, literal types)

C++TS concepts lite

C++11/14

Yes

MaybeSlide10

Visual Studio 2013C++11/14

Performance

ProductivityServicesMobile DevicesSlide11

Performance Optimizations Recap

Compilation Unit Optimizations

/O2 and friends

Whole Program Optimizations

/GL and /LTCG

.

cpp

.

cpp

.

obj

.

obj

.exe

.

cpp

.

cpp

.

obj

.

obj

.exe

.

cpp

.cpp.obj.obj.exeRun TrainingScenarios.exeProfile-Guided Optimizations/LTCG:PGI and /LTCG:PGOSlide12

Automatic Vectorization

VS 2012:

Uses “vector” instructions where possible in loops

VS 2013 adds:

Statement level

vectorizationPermutation of perfect loop nestsRange propagation optimizations

Support for more operations: min/max, converts, shifts, byteswap, averaging

Reductions into array elements__restrict support for vector alias checking

Improvements to data dependence analysisC++ pointer vectorization

Gather / scatter optimizations

for

(i = 0; i < 1000; i++) { A[

i] = B[

i] + C[

i];}

+

r1

r2

r3

add r3, r1, r2

SCALAR

(1 operation)

v1

v2

v3

+

vector

length

vadd

v3, v1, v2

VECTOR

(N operations)Slide13

Automatic Vectorization

// STL – pointers everywhere; not even a loop counter variable

void

transform1(

const

int * first1, const

int * last1,

const

int * first2, int

* result) { while

(first1 != last1)

{ //converted to integer

*

result++ = *first1++ + *first2++;

// make these array references

}

}

// DirectX – no loops here! Vectorize

operations on adjacent memory cells

void

four_vector_example

(XMVECTOR V) {

XMVECTOR Result;   

Result.vector4_f32[0] = 1.f / V.vector4_f32[0];    Result.vector4_f32[1] = 1.f / V.vector4_f32[1];    Result.vector4_f32[2] = 1.f / V.vector4_f32[2];    Result.vector4_f32[3] = 1.f / V.vector4_f32[3];    return Result;}// Machine Vision Libraryvoid machine_vision_filter_example (int *A, int boxStart) { for (int i = 0; i < 100; i++) A[boxStart + i] = A[boxStart + i] + 1;}Slide14

Vector Calling Convention

struct

Particle {

   

__m256

x;

   

__m256

y;

   

__m256

z;

   

__m256 w;   

};

Particle

__vectorcall

foo(Particle a,

__m256 scale)

{

  Particle t;

 

  

t.x

= _mm256_mul_ps(

a.x, scale);  t.y = _mm256_mul_ps(a.y, scale);  t.z = _mm256_mul_ps(a.z, scale);  t.w = _mm256_mul_ps(a.w, scale);    return t;}Reduces instruction countMinimizes stack allocationUse /Gv for whole moduleSlide15

C++ AMPIn VS2012:

Programming

model for heterogeneous

computing

Allowed

C++ code to run on the GPU for general-purpose computation

STL-like library for multidimensional data

#include <

iostream>#include <

amp.h>using namespace concurrency;

int

main(){

int v[11] = {'G

','d','k','k','n',31,'v','n','q','k','c'};

array_view<int>

av(11, v);

parallel_for_each(av.extent, [=](index<1>

idx) restrict(amp) {

av[

idx

] += 1;

});

for(unsigned

int

i = 0; i < 11; i++) std::cout << static_cast<char>(av[i]); }Slide16

C++ AMPVS2013 focused on:

Cross-platform support

More runtime performance gainsDeveloper productivity

For example:

Targeting Linux, iOS and Android

Shared memory support to eliminate/reduce copying of data between CPU and GPUEnhanced texture support: texture sampling, mipmap support and staging texturesC++ AMP debugging on Win7 and side-by-side CPU/GPU debugging

Faster C++ AMP runtime: improved copy performance, reduce launch overheadBetter DirectX interop support

Improved C++ AMP runtime diagnosticsImprovements to array_view APIsSlide17

Visual Studio 2013C++11/14

Performance

ProductivityServicesMobile DevicesSlide18

IDE Enhancements

demoSlide19

Tour of the VS2013 IDE

Code formatting, brace completion

Rename refactoringHeader/cpp switchingCode peekFind All ReferencesCode analysis

PDB project

NuGet for native code

Native multi-targetingCode understanding using dependency graphSlide20

Code Formatting

Configurable options for indentation, space, new lines and wrapping

Automatically applied while typing, pasting or formattingSlide21

Header / Code Switching

Brace CompletionSlide22

Code PeekView type definitions without leaving the current open fileSlide23

NuGetEasy acquisition and usage of compatible libraries in C++ projects

Library vendors can expose their libraries as

NuGet packages using available tools

http://

blogs.msdn.com/b/vcblog/archive/2013/04/26/nuget-for-c.aspxSlide24

Code Analysis UI Enhancements

Filter on categories and sort on various fields to help focus on important problems firstSlide25

Async DebuggingSupports Windows Store and Desktop apps

Requires Windows 8.1

Enhancements to the Call Stack and Tasks window Answers the questions “Why am I here?” & “What is going on right now?”Slide26

“Just My Code” debugging

Helps developer focus on code they authored

Call Stack window hides non-user code

Non-user code defined

in configurable

.natjmc file

Not used during steppingSlide27

Interop debugging

Multiple flavors of

interop debugging enabled:JavaScript / C++C# / VB / C++

CPython

/ C++

GPU / CPUEnable by choosing an option in the Project PropertiesBreak in the debugger in either C++ or JS/C#/VB/Python codeBreakpoint | Exception | Break All (pause icon)Inspect state, e.g. in Locals, Call StackSlide28

PDB ProjectSlide29

Visual Studio 2013C++11/14

Performance

ProductivityServicesMobile DevicesSlide30

C++ REST SDKCloud-based client-server communications library

for C++

Basics:Connecting and interacting with

RESTful

servicesUncompromised performance and productivityAsynchrony for responsiveness and scalability

Uses modern C++11 patternsCross-platform enabled and OSSSlide31

C++ REST SDKHTTP Client to send requests and handle responses

JSON

library for constructing, parsing and serializing JSON objects.Asynchronous Streams and Stream Buffers for reading/writing bytes to/from an underlying medium.

http://

casablanca.codeplex.comSlide32

Basic HTTP Client

http_client

client(

L

"http

://www.myhttpserver.com");

http_request request(

methods::GET);

client.request(request).then([](

http_response

response)

{

// Perform actions here to inspect the HTTP response...

if

(response

.status_code() == status_codes

::OK)

{ }

});Slide33

Make an HTTP request to get a JSON value

void

RequestJSONValue

()

{

http_client client(

L"http

://www.myhttpserver.com");

client.request(

methods::GET).then([](http_response

response

)

{

if(response

.status_code() ==

status_codes::OK)

{

return response

.extract_json

();

}

// Handle error cases, for now return null

json value... return task_from_result(json::value()); }) .then([](json::value v) { // Perform actions here to process the JSON value... });}Slide34

Visual Studio 2013C++11/14

Performance

ProductivityServicesMobile DevicesSlide35

Connected Windows Store AppsVisual Studio 2013 makes it easier to:

Update your app tile using mobile services

Send push notifications to your Windows Store appAccessing Azure mobile services backend capabilities

How?

New C++ library for Azure mobile services

Integrated VS toolsSlide36

Better XAML DesignerNew and updated templates

Improved XAML editor

Rulers and dynamic guidesNew Windows 8.1 controlsImproved Designer performanceBetter in-place style and template editingSlide37

Powerful Graphics DebuggingVS2012 introduced DirectX-based Graphics debugging tools in VS Professional, Premium and Ultimate

VS2013 adds:

Support in VS ExpressCapturing frames from

remote machines

Compute

shaderdebuggingFaster frame captureSlide38

Deeper Diagnostics

Diagnostics hub

XAML UI responsiveness profiling

Energy

profiler

CPU profilingBetter

WinRT Exception debugging‘Just My Code’ debuggingImproved Async debuggingJavaScript/C++

interop debuggingC#/C++ interop debugging *ARM dump debugging *Slide39

C++/CX

Boxed types in

WinRT

structs

value

struct

Person {

IBox<

int>^ Age;

}

Overriding

ToString()

ref

struct Person {

public

:

String^ Name;

virtual

String

^

ToString

() override { return Name; } }Improved WinRT exceptionsRetains stack trace and message string across the ABIDevelopers can specify custom message stringsFaster performanceRef classes instantiate faster, have more compact layouts in memoryBoxing and factory caching improved to speed up XAML scenariosFacilitated inlining and other code optimizationsSlide40

Visual Studio 2013 Conformance Performance

Productivity

Services Mobile DevicesWhat’s Next

AgendaSlide41

On our mind nowBuild throughput

Important

Multi-device / cross-platformWhat’s Next?Slide42

PerformanceProductivityLibraries: full acquisition storyGaming and DXParallel paradigms: parallel STL, await

Native Desktop UI

MoreSlide43

©

2013 Microsoft

Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.

The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.