.pdf

IBM Research – Zurich
Business Integration Technologies
C++ (Intermission)
Directives to influence “single” Instructions – Why?
Thomas Gschwind <thg at zurich....>
1
Th. Gschwind. Fortgeschrittene Programmierung in C++.
© 2014 IBM Corporation
IBM Research – Zurich
Business Integration Technologies
Motivation
Directives to influence “single” instructions
– Inline
– Virtual
– …
Why?
– C++ is old fashioned and based on C
– Because of this C++ inherits C’s properties of “old” computers
Why should we care today?
– Today’s computers are several orders of magnitude faster
– Today’s computers wait most of the times for users
There is more to it than meets the eye
2
Th. Gschwind. Fortgeschrittene Programmierung in C++.
© 2014 IBM Corporation
IBM Research – Zurich
Business Integration Technologies
Supercomputing & Number Crunching Applications
Anything to be executed on a supercomputer cares about
“single” instructions
Anything that pushes your computer
–
–
–
Raytracing
Rendering 3D objects
Computer Games
Looks like a limited range of application domains?
3
Th. Gschwind. Fortgeschrittene Programmierung in C++.
© 2014 IBM Corporation
IBM Research – Zurich
Business Integration Technologies
Embedded Devices
Anything to be executed on “small”
microprocessor
–
–
–
Raspberry PI: ARM@700MHz
Arduino UNO: ATmega@16MHz
Many many more
Yes there are some more uses…
4
Th. Gschwind. Fortgeschrittene Programmierung in C++.
Arduino UNO
SDK uses C++
Provides 32k Flash
© 2014 IBM Corporation
IBM Research – Zurich
Business Integration Technologies
Embedded Devices (oh there is more to it)
Anything to be executed on battery-driven
processors
–
–
–
–
–
You programs takes twice the time
Your battery lasts half as long max.
Power consumption is quadratic to frequency
This is why Android’s dalvikvm is implemented in C++
Apple chose Objective C for everything
Smartwatches – the latest cry
–
–
–
5
Today they just a bit more than a day
Here, an efficient program really is important
Don’t want to lug around a phone with extra battery
Th. Gschwind. Fortgeschrittene Programmierung in C++.
© 2014 IBM Corporation
IBM Research – Zurich
Business Integration Technologies
Embedded Devices (oh there is even more to it!)
Anything to be executed on battery-driven processors
– Now imagine we want to move our embedded system around…
– Robots, worse, helicopter, quadrocopter, we need to lift our battery as well
Author: Ulrich Heither
6
Th. Gschwind. Fortgeschrittene Programmierung in C++.
© 2014 IBM Corporation