eBook - ePub
OpenCL in Action
Matthew Scarpino
This is a test
Partager le livre
- English
- ePUB (adapté aux mobiles)
- Disponible sur iOS et Android
eBook - ePub
OpenCL in Action
Matthew Scarpino
DĂ©tails du livre
Aperçu du livre
Table des matiĂšres
Citations
Ă propos de ce livre
OpenCL in Action is a thorough, hands-on presentation of OpenCL, with an eye toward showing developers how to build high-performance applications of their own. It begins by presenting the core concepts behind OpenCL, including vector computing, parallel programming, and multi-threaded operations, and then guides you step-by-step from simple data structures to complex functions.
Foire aux questions
Comment puis-je résilier mon abonnement ?
Il vous suffit de vous rendre dans la section compte dans paramĂštres et de cliquer sur « RĂ©silier lâabonnement ». Câest aussi simple que cela ! Une fois que vous aurez rĂ©siliĂ© votre abonnement, il restera actif pour le reste de la pĂ©riode pour laquelle vous avez payĂ©. DĂ©couvrez-en plus ici.
Puis-je / comment puis-je télécharger des livres ?
Pour le moment, tous nos livres en format ePub adaptĂ©s aux mobiles peuvent ĂȘtre tĂ©lĂ©chargĂ©s via lâapplication. La plupart de nos PDF sont Ă©galement disponibles en tĂ©lĂ©chargement et les autres seront tĂ©lĂ©chargeables trĂšs prochainement. DĂ©couvrez-en plus ici.
Quelle est la différence entre les formules tarifaires ?
Les deux abonnements vous donnent un accĂšs complet Ă la bibliothĂšque et Ă toutes les fonctionnalitĂ©s de Perlego. Les seules diffĂ©rences sont les tarifs ainsi que la pĂ©riode dâabonnement : avec lâabonnement annuel, vous Ă©conomiserez environ 30 % par rapport Ă 12 mois dâabonnement mensuel.
Quâest-ce que Perlego ?
Nous sommes un service dâabonnement Ă des ouvrages universitaires en ligne, oĂč vous pouvez accĂ©der Ă toute une bibliothĂšque pour un prix infĂ©rieur Ă celui dâun seul livre par mois. Avec plus dâun million de livres sur plus de 1 000 sujets, nous avons ce quâil vous faut ! DĂ©couvrez-en plus ici.
Prenez-vous en charge la synthÚse vocale ?
Recherchez le symbole Ăcouter sur votre prochain livre pour voir si vous pouvez lâĂ©couter. Lâoutil Ăcouter lit le texte Ă haute voix pour vous, en surlignant le passage qui est en cours de lecture. Vous pouvez le mettre sur pause, lâaccĂ©lĂ©rer ou le ralentir. DĂ©couvrez-en plus ici.
Est-ce que OpenCL in Action est un PDF/ePUB en ligne ?
Oui, vous pouvez accĂ©der Ă OpenCL in Action par Matthew Scarpino en format PDF et/ou ePUB ainsi quâĂ dâautres livres populaires dans Computer Science et Parallel Programming. Nous disposons de plus dâun million dâouvrages Ă dĂ©couvrir dans notre catalogue.
Informations
Sujet
Computer ScienceSous-sujet
Parallel ProgrammingPart 1. Foundations of OpenCL programming
Part 1 presents the OpenCL language. Weâll explore OpenCLâs data structures and functions in detail and look at example applications
that demonstrate their usage in code.
Chapter 1 introduces OpenCL, explaining what itâs used for and how it works. Chapters 2 and 3 explain how host applications are coded, and chapters 4 and 5 discuss kernel coding. Chapters 6 and 7 explore the advanced topics of image processing and event handling.
Chapters 8 and 9 discuss how OpenCL is coded in languages other than C, such as C++, Java, and Python. Chapter 10 explains how OpenCLâs capabilities can be used to develop large-scale applications.
Chapter 1. Introducing OpenCL
This chapter covers
- Understanding the purpose and benefits of OpenCL
- Introducing OpenCL operation: hosts and kernels
- Implementing an OpenCL application in code
In October 2010, a revolution took place in the world of high-performance computing. The Tianhe-1A, constructed by Chinaâs National Supercomputing Center in Tianjin, came from total obscurity to seize the leading position among the worldâs best performing supercomputers. With a maximum recorded computing speed of 2,566 TFLOPS (trillion floating-point operations per second), it performs nearly 50 percent faster than the second-place finisher, Crayâs Jaguar supercomputer. Table 1.1 lists the top three supercomputers.
Table 1.1. Top three supercomputers of 2010 (source: www.top500.org)
Supercomputer | Max speed (TFLOPS) | Processors | Power (kW) |
---|---|---|---|
Tianhe-1A | 2,566 | 14,336 Intel Xeon CPUs, 7,168 Nvidia Tesla GPUs | 4040.00 |
Jaguar | 1,759 | 224,256 AMD Opteron CPUs | 6950.60 |
Nebulae | 1,271 | 9,280 Intel Xeon CPUs, 4,640 Nvidia Tesla GPUs | 2580.00 |
Whatâs so revolutionary is the presence of GPUs (graphics processing units) in both the Tianhe-1A and Nebulae? In 2009, none of the top three supercomputers had GPUs, and only one system in the top 20 had any GPUs at all. As the table makes clear, the two systems with GPUs provide not only excellent performance, but also impressive power efficiency.
Using GPUs to perform nongraphical routines is called general-purpose GPU computing, or GPGPU computing. Before 2010, GPGPU computing was considered a novelty in the world of high-performance computing and not worthy of serious attention. But today, engineers and academics are reaching the conclusion that CPU/GPU systems represent the future of supercomputing.
Now an important question arises: how can you program these new hybrid devices? Traditional C and C++ only target traditional CPUs. The same holds true for Crayâs proprietary Chapel language and the Cray Assembly Language (CAL). Nvidiaâs CUDA (Compute Unified Device Architecture) can be used to program Nvidiaâs GPUs, but not CPUs.
The answer is OpenCL (Open Computing Language). OpenCL routines can be executed on GPUs and CPUs from major manufacturers like AMD, Nvidia, and Intel, and will even run on Sonyâs PlayStation 3. OpenCL is nonproprietaryâitâs based on a public standard, and you can freely download all the development tools you need. When you code routines in OpenCL, you donât have to worry about which company designed the processor or how many cores it contains. Your code will compile and execute on AMDâs latest Fusion processors, Intelâs Core processors, Nvidiaâs Fermi processors, and IBMâs Cell Broadband Engine.
The goal of this book is to explain how to program these cross-platform applications and take maximum benefit from the underlying hardware. But the goal of this chapter is to provide a basic overview of the OpenCL language. The discussion will start by focusing on OpenCLâs advantages and operation, and then proceed to describing a complete application. But first, itâs important to understand OpenCLâs origin. Corporations have spent a great deal of time developing this language, and once you see why, youâll have a better idea why learning about OpenCL is worth your own.
1.1. The dawn of OpenCL
The x86 architecture enjoys a dominant position in the world of personal computing, but there is no prevailing architecture in the fields of graphical and high-performance computing. Despite their common purpose, there is little similarity between Nvidiaâs line of Fermi processors, AMDâs line of Evergreen processors, and IBMâs Cell Broadband Engine. Each of these devices has its own instruction set, and before OpenCL, if you wanted to program them, you had to learn three different languages.
Enter Apple. For those of you who have been living as recluses, Apple Inc. produces an insanely popular line of consumer electronic products: the iPhone, the iPad, the iPod, and the Mac line of personal computers. But Apple doesnât make processors for the Mac computers. Instead, it selects devices from other companies. If Apple chooses a graphics processor from Company A for its new gadget, then Company A will see a tremendous rise in market share and developer interest. This is why everyone is so nice to Apple.
Important events in OpenCL and multicore computing history
2001â IBM releases POWER4, the first multicore processor.
2005â First multicore processors for desktop computers released: AMDâs Athlon 64 X2 and Intelâs Pentium D.
June 2008â The OpenCL Working Group forms as part of the Khronos Group.
December 2008â The OpenCL Working Group releases version 1.0 of the OpenCL specification.
April 2009â Nvidia releases OpenCL SDK for Nvidia graphics cards.
August 2009â ATI (now AMD) releases OpenCL SDK for ATI graphics cards. Apple includes OpenCL support in its Mac OS 10.6 (Snow Leopard) release.
June 2010â The OpenCL Working Group releases version 1.1 of the OpenCL specification.
In 2008, Apple turned to its vendors and asked, âWhy donât we make a common interfa...