100% found this document useful (1 vote)
18 views

Using OpenCL Programming Massively Parallel Computers J. Kowalik - The ebook in PDF/DOCX format is available for instant download

The document promotes various eBooks available for download at ebookname.com, including titles on OpenCL programming, computer science, and historical topics. It highlights the importance of OpenCL in parallel computing and provides a brief overview of its features and applications. The book aims to simplify OpenCL programming for users familiar with parallel computation and programming languages like C or C++.

Uploaded by

aabaduugulu88
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
18 views

Using OpenCL Programming Massively Parallel Computers J. Kowalik - The ebook in PDF/DOCX format is available for instant download

The document promotes various eBooks available for download at ebookname.com, including titles on OpenCL programming, computer science, and historical topics. It highlights the importance of OpenCL in parallel computing and provides a brief overview of its features and applications. The book aims to simplify OpenCL programming for users familiar with parallel computation and programming languages like C or C++.

Uploaded by

aabaduugulu88
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 43

Endless Ebook, One Click Away – Start Downloading at ebookname.

com

Using OpenCL Programming Massively Parallel


Computers J. Kowalik

https://ebookname.com/product/using-opencl-programming-
massively-parallel-computers-j-kowalik/

OR CLICK HERE

DOWLOAD EBOOK

Browse and Get More Ebook Downloads Instantly at https://ebookname.com


Click here to visit ebookname.com and download ebook now
Instant digital products (PDF, ePub, MOBI) available
Download now and explore formats that suit you...

Computers and Programming 1st Edition Lisa Mccoy

https://ebookname.com/product/computers-and-programming-1st-
edition-lisa-mccoy/

Hidden Structure Music Analysis Using Computers David


Cope

https://ebookname.com/product/hidden-structure-music-analysis-
using-computers-david-cope/

Using Computers in Linguistics A Practical Guide 1st


Edition John M. Lawler

https://ebookname.com/product/using-computers-in-linguistics-a-
practical-guide-1st-edition-john-m-lawler/

The ASHRAE GreenGuide Second Edition The ASHRAE Green


Guide Series Ashrae Press

https://ebookname.com/product/the-ashrae-greenguide-second-
edition-the-ashrae-green-guide-series-ashrae-press/
Complete Java 2 Certification Study Guide 4th Edition
Phillip Heller

https://ebookname.com/product/complete-java-2-certification-
study-guide-4th-edition-phillip-heller/

Bosnia and Herzegovina in the Second World War 2004


Enver Redzic

https://ebookname.com/product/bosnia-and-herzegovina-in-the-
second-world-war-2004-enver-redzic/

Human Resource Skills for the Project Manager The Human


Aspects of Project Management Volume Two 1st Edition
Verma

https://ebookname.com/product/human-resource-skills-for-the-
project-manager-the-human-aspects-of-project-management-volume-
two-1st-edition-verma/

Textbook of Forensic Medicine and Toxicology 2nd


Edition Nageshkumar G Rao

https://ebookname.com/product/textbook-of-forensic-medicine-and-
toxicology-2nd-edition-nageshkumar-g-rao/

World Civilizations Volume 1 To 1700 5th Edition Philip


J. Adler

https://ebookname.com/product/world-civilizations-
volume-1-to-1700-5th-edition-philip-j-adler/
Noise and Military Service Implications for Hearing
Loss and Tinnitus 1st Edition Committee On Noise-
Induced Hearing Loss And Tinnitus Associated With
Military Service From World War Ii To The Present
https://ebookname.com/product/noise-and-military-service-
implications-for-hearing-loss-and-tinnitus-1st-edition-committee-
on-noise-induced-hearing-loss-and-tinnitus-associated-with-
military-service-from-world-war-ii-to-the-present/
USING OPENCL
Advances in Parallel Computing
This book series publishes research and development results on all aspects of parallel
computing. Topics may include one or more of the following: high-speed computing
architectures (Grids, clusters, Service Oriented Architectures, etc.), network technology,
performance measurement, system software, middleware, algorithm design,
development tools, software engineering, services and applications.

Series Editor:
Professor Dr. Gerhard R. Joubert

Volume 21
Recently published in this series
Vol. 20. I. Foster, W. Gentzsch, L. Grandinetti and G.R. Joubert (Eds.), High
Performance Computing: From Grids and Clouds to Exascale
Vol. 19. B. Chapman, F. Desprez, G.R. Joubert, A. Lichnewsky, F. Peters and T. Priol
(Eds.), Parallel Computing: From Multicores and GPU’s to Petascale
Vol. 18. W. Gentzsch, L. Grandinetti and G. Joubert (Eds.), High Speed and Large Scale
Scientific Computing
Vol. 17. F. Xhafa (Ed.), Parallel Programming, Models and Applications in Grid and
P2P Systems
Vol. 16. L. Grandinetti (Ed.), High Performance Computing and Grids in Action
Vol. 15. C. Bischof, M. Bücker, P. Gibbon, G.R. Joubert, T. Lippert, B. Mohr and F.
Peters (Eds.), Parallel Computing: Architectures, Algorithms and Applications

Volumes 1–14 published by Elsevier Science.

ISSN 0927-5452 (print)


ISSN 1879-808X (online)
Usin
ng OpeenCL
Program
mming Ma
assively Pa
arallel Com
mputers

Janu
usz Kow
walik
1647
77-107th PL NE, Bothell,, WA 98011
1, USA
and
Tadeusz PuĨnia
akowski
UG, MFI, Wit
W Stwosz Street
S 57, 80-952
8 GdaĔĔsk, Poland

Amstterdam x Berrlin x Tokyo x Washington, DC


© 2012 The authors and IOS Press.

All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or
transmitted, in any form or by any means, without prior written permission from the publisher.

ISBN 978-1-61499-029-1 (print)


ISBN 978-1-61499-030-7 (online)
Library of Congress Control Number: 2012932792
doi:10.3233/978-1-61499-030-7-i

Publisher
IOS Press BV
Nieuwe Hemweg 6B
1013 BG Amsterdam
Netherlands
fax: +31 20 687 0019
e-mail: order@iospress.nl

Distributor in the USA and Canada


IOS Press, Inc.
4502 Rachael Manor Drive
Fairfax, VA 22032
USA
fax: +1 703 323 3668
e-mail: iosbooks@iospress.com

LEGAL NOTICE
The publisher is not responsible for the use which might be made of the following information.

PRINTED IN THE NETHERLANDS


This book is dedicated to Alex, Bogdan and Gabriela
with love and consideration.

v
vi
Preface
This book contains the most important and essential information required for de-
signing correct and efficient OpenCL programs. Some details have been omitted but
can be found in the provided references. The authors assume that readers are famil-
iar with basic concepts of parallel computation, have some programming experience
with C or C++ and have a fundamental understanding of computer architecture.
In the book, all terms, definitions and function signatures have been copied from
official API documents available on the page of the OpenCL standards creators.
The book was written in 2011, when OpenCL was in transition from its infancy
to maturity as a practical programming tool for solving real-life problems in science
and engineering. Earlier, the Khronos Group successfully defined OpenCL specifica-
tions, and several companies developed stable OpenCL implementations ready for
learning and testing. A significant contribution to programming heterogeneous com-
puters was made by NVIDIA which created one of the first working systems for pro-
gramming massively parallel computers – CUDA. OpenCL has borrowed from CUDA
several key concepts. At this time (fall 2011), one can install OpenCL on a hetero-
geneous computer and perform meaningful computing experiments. Since OpenCL
is relatively new, there are not many experienced users or sources of practical infor-
mation. One can find on the Web some helpful publications about OpenCL, but there
is still a shortage of complete descriptions of the system suitable for students and
potential users from the scientific and engineering application communities.
Chapter 1 provides short but realistic examples of codes using MPI and OpenMP
in order for readers to compare these two mature and very successful systems with
the fledgling OpenCL. MPI used for programming clusters and OpenMP for shared
memory computers, have achieved remarkable worldwide success for several rea-
sons. Both have been designed by groups of parallel computing specialists that per-
fectly understood scientific and engineering applications and software development
tools. Both MPI and OpenMP are very compact and easy to learn. Our experience
indicates that it is possible to teach scientists or students whose disciplines are other
than computer science how to use MPI and OpenMP in a several hours time. We
hope that OpenCL will benefit from this experience and achieve, in the near future,
a similar success.
Paraphrasing the wisdom of Albert Einstein, we need to simplify OpenCL as
much as possible but not more. The reader should keep in mind that OpenCL will
be evolving and that pioneer users always have to pay an additional price in terms
of initially longer program development time and suboptimal performance before
they gain experience. The goal of achieving simplicity for OpenCL programming re-
quires an additional comment. OpenCL supporting heterogeneous computing offers
us opportunities to select diverse parallel processing devices manufactured by differ-
ent vendors in order to achieve near-optimal or optimal performance. We can select
multi-core CPUs, GPUs, FPGAs and other parallel processing devices to fit the prob-
lem we want to solve. This flexibility is welcomed by many users of HPC technology,
but it has a price.
Programming heterogeneous computers is somewhat more complicated than
writing programs in conventional MPI and OpenMP. We hope this gap will disappear
as OpenCL matures and is universally used for solving large scientific and engineer-
ing problems.

vii
Acknowledgements
It is our pleasure to acknowledge assistance and contributions made by several per-
sons who helped us in writing and publishing the book.
First of all, we express our deep gratitude to Prof. Gerhard Joubert who has
accepted the book as a volume in the book series he is editing, Advances in Parallel
Computing. We are proud to have our book in his very prestigious book series.
Two members of the Khronos organization, Elizabeth Riegel and Neil Trevett,
helped us with evaluating the initial draft of Chapter 2 Fundamentals and provided
valuable feedback. We thank them for the feedback and for their offer of promoting
the book among the Khronos Group member companies.
Our thanks are due to NVIDIA for two hardware grants that enabled our com-
puting work related to the book.
Our thanks are due to Piotr Arłukowicz, who contributed two sections to the
book and helped us with editorial issues related to using LATEX and the Blender3D
modeling open-source program.
We thank two persons who helped us improve the book structure and the lan-
guage. They are Dominic Eschweiler from FIAS, Germany and Roberta Scholz from
Redmond, USA.
We also thank several friends and family members who helped us indirectly by
supporting in various ways our book writing effort.
Janusz Kowalik
Tadeusz Puźniakowski

How to read this book


The text and the source code presented in this book are written using different text
fonts. Here are some examples of diffrent typography styles collected.
variable – for example:
. . . the variable platform represents an object of class . . .
type or class name – for example:
. . . the value is always of type cl_ulong. . .
. . . is an object of class cl::Platform. . .
constant or macro – for example:
. . . the value CL_PLATFORM_EXTENSIONS means that. . .
function, method or constructor – for example:
. . . the host program has to execute clGetPlatformIDs. . .
. . . can be retrieved using cl::Platform::getInfo method. . .
. . . the context is created by cl::Context construcor. . .
file name – for example:
. . . the cl.h header file contains. . .
keyword – for example:
. . . identified by the __kernel qualifier. . .

viii
Contents

1 Introduction 1
1.1 Existing Standard Parallel Programming Systems . . . . . . . . . . . . . . 1
1.1.1 MPI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.1.2 OpenMP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.2 Two Parallelization Strategies: Data Parallelism and Task Parallelism . 9
1.2.1 Data Parallelism . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
1.2.2 Task Parallelism . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
1.2.3 Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
1.3 History and Goals of OpenCL . . . . . . . . . . . . . . . . . . . . . . . . . . 12
1.3.1 Origins of Using GPU in General Purpose Computing . . . . . . 12
1.3.2 Short History of OpenCL . . . . . . . . . . . . . . . . . . . . . . . . 13
1.4 Heterogeneous Computer Memories and Data Transfer . . . . . . . . . . 14
1.4.1 Heterogeneous Computer Memories . . . . . . . . . . . . . . . . . 14
1.4.2 Data Transfer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
1.4.3 The Fourth Generation CUDA . . . . . . . . . . . . . . . . . . . . . 15
1.5 Host Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
1.5.1 Phase a. Initialization and Creating Context . . . . . . . . . . . . 17
1.5.2 Phase b. Kernel Creation, Compilation and Preparations . . . . . 17
1.5.3 Phase c. Creating Command Queues and Kernel Execution . . . 17
1.5.4 Finalization and Releasing Resource . . . . . . . . . . . . . . . . . 18
1.6 Applications of Heterogeneous Computing . . . . . . . . . . . . . . . . . . 18
1.6.1 Accelerating Scientific/Engineering Applications . . . . . . . . . 19
1.6.2 Conjugate Gradient Method . . . . . . . . . . . . . . . . . . . . . . 19
1.6.3 Jacobi Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
1.6.4 Power Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
1.6.5 Monte Carlo Methods . . . . . . . . . . . . . . . . . . . . . . . . . . 22
1.6.6 Conclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
1.7 Benchmarking CGM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
1.7.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
1.7.2 Additional CGM Description . . . . . . . . . . . . . . . . . . . . . . 24
1.7.3 Heterogeneous Machine . . . . . . . . . . . . . . . . . . . . . . . . 24
1.7.4 Algorithm Implementation and Timing Results . . . . . . . . . . 24
1.7.5 Conclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25

ix
2 OpenCL Fundamentals 27
2.1 OpenCL Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
2.1.1 What is OpenCL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
2.1.2 CPU + Accelerators . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
2.1.3 Massive Parallelism Idea . . . . . . . . . . . . . . . . . . . . . . . . 27
2.1.4 Work Items and Workgroups . . . . . . . . . . . . . . . . . . . . . . 29
2.1.5 OpenCL Execution Model . . . . . . . . . . . . . . . . . . . . . . . . 29
2.1.6 OpenCL Memory Structure . . . . . . . . . . . . . . . . . . . . . . . 30
2.1.7 OpenCL C Language for Programming Kernels . . . . . . . . . . . 30
2.1.8 Queues, Events and Context . . . . . . . . . . . . . . . . . . . . . . 30
2.1.9 Host Program and Kernel . . . . . . . . . . . . . . . . . . . . . . . . 31
2.1.10 Data Parallelism in OpenCL . . . . . . . . . . . . . . . . . . . . . . 31
2.1.11 Task Parallelism in OpenCL . . . . . . . . . . . . . . . . . . . . . . 32
2.2 How to Start Using OpenCL . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
2.2.1 Header Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
2.2.2 Libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
2.2.3 Compilation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
2.3 Platforms and Devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
2.3.1 OpenCL Platform Properties . . . . . . . . . . . . . . . . . . . . . . 36
2.3.2 Devices Provided by Platform . . . . . . . . . . . . . . . . . . . . . 37
2.4 OpenCL Platforms – C++ . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
2.5 OpenCL Context to Manage Devices . . . . . . . . . . . . . . . . . . . . . . 41
2.5.1 Different Types of Devices . . . . . . . . . . . . . . . . . . . . . . . 43
2.5.2 CPU Device Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
2.5.3 GPU Device Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
2.5.4 Accelerator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
2.5.5 Different Device Types – Summary . . . . . . . . . . . . . . . . . . 44
2.5.6 Context Initialization – by Device Type . . . . . . . . . . . . . . . 45
2.5.7 Context Initialization – Selecting Particular Device . . . . . . . . 46
2.5.8 Getting Information about Context . . . . . . . . . . . . . . . . . . 47
2.6 OpenCL Context to Manage Devices – C++ . . . . . . . . . . . . . . . . . 48
2.7 Error Handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
2.7.1 Checking Error Codes . . . . . . . . . . . . . . . . . . . . . . . . . . 50
2.7.2 Using Exceptions – Available in C++ . . . . . . . . . . . . . . . . 53
2.7.3 Using Custom Error Messages . . . . . . . . . . . . . . . . . . . . . 54
2.8 Command Queues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
2.8.1 In-order Command Queue . . . . . . . . . . . . . . . . . . . . . . . 55
2.8.2 Out-of-order Command Queue . . . . . . . . . . . . . . . . . . . . 57
2.8.3 Command Queue Control . . . . . . . . . . . . . . . . . . . . . . . 60
2.8.4 Profiling Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
2.8.5 Profiling Using Events – C example . . . . . . . . . . . . . . . . . . 61
2.8.6 Profiling Using Events – C++ example . . . . . . . . . . . . . . . 63
2.9 Work-Items and Work-Groups . . . . . . . . . . . . . . . . . . . . . . . . . 65
2.9.1 Information About Index Space from a Kernel . . . . . . . . . . 66
2.9.2 NDRange Kernel Execution . . . . . . . . . . . . . . . . . . . . . . 67
2.9.3 Task Execution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
2.9.4 Using Work Offset . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70

x
2.10 OpenCL Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
2.10.1 Different Memory Regions – the Kernel Perspective . . . . . . . . 71
2.10.2 Relaxed Memory Consistency . . . . . . . . . . . . . . . . . . . . . 73
2.10.3 Global and Constant Memory Allocation – Host Code . . . . . . 75
2.10.4 Memory Transfers – the Host Code . . . . . . . . . . . . . . . . . . 78
2.11 Programming and Calling Kernel . . . . . . . . . . . . . . . . . . . . . . . . 79
2.11.1 Loading and Compilation of an OpenCL Program . . . . . . . . . 81
2.11.2 Kernel Invocation and Arguments . . . . . . . . . . . . . . . . . . 88
2.11.3 Kernel Declaration . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
2.11.4 Supported Scalar Data Types . . . . . . . . . . . . . . . . . . . . . 90
2.11.5 Vector Data Types and Common Functions . . . . . . . . . . . . . 92
2.11.6 Synchronization Functions . . . . . . . . . . . . . . . . . . . . . . . 94
2.11.7 Counting Parallel Sum . . . . . . . . . . . . . . . . . . . . . . . . . 96
2.11.8 Parallel Sum – Kernel . . . . . . . . . . . . . . . . . . . . . . . . . . 97
2.11.9 Parallel Sum – Host Program . . . . . . . . . . . . . . . . . . . . . 100
2.12 Structure of the OpenCL Host Program . . . . . . . . . . . . . . . . . . . . 103
2.12.1 Initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
2.12.2 Preparation of OpenCL Programs . . . . . . . . . . . . . . . . . . . 106
2.12.3 Using Binary OpenCL Programs . . . . . . . . . . . . . . . . . . . . 107
2.12.4 Computation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
2.12.5 Release of Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
2.13 Structure of OpenCL host Programs in C++ . . . . . . . . . . . . . . . . . 114
2.13.1 Initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
2.13.2 Preparation of OpenCL Programs . . . . . . . . . . . . . . . . . . . 115
2.13.3 Using Binary OpenCL Programs . . . . . . . . . . . . . . . . . . . . 116
2.13.4 Computation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
2.13.5 Release of Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
2.14 The SAXPY Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
2.14.1 Kernel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
2.14.2 The Example SAXPY Application – C Language . . . . . . . . . . 123
2.14.3 The example SAXPY application – C++ language . . . . . . . . 128
2.15 Step by Step Conversion of an Ordinary C Program to OpenCL . . . . . 131
2.15.1 Sequential Version . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
2.15.2 OpenCL Initialization . . . . . . . . . . . . . . . . . . . . . . . . . . 132
2.15.3 Data Allocation on the Device . . . . . . . . . . . . . . . . . . . . . 134
2.15.4 Sequential Function to OpenCL Kernel . . . . . . . . . . . . . . . 135
2.15.5 Loading and Executing a Kernel . . . . . . . . . . . . . . . . . . . . 136
2.15.6 Gathering Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
2.16 Matrix by Vector Multiplication Example . . . . . . . . . . . . . . . . . . . 139
2.16.1 The Program Calculating mat r i x × vec t or . . . . . . . . . . . . 140
2.16.2 Performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142
2.16.3 Experiment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142
2.16.4 Conclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144

3 Advanced OpenCL 147


3.1 OpenCL Extensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
3.1.1 Different Classes of Extensions . . . . . . . . . . . . . . . . . . . . 147

xi
3.1.2 Detecting Available Extensions from API . . . . . . . . . . . . . . 148
3.1.3 Using Runtime Extension Functions . . . . . . . . . . . . . . . . . 149
3.1.4 Using Extensions from OpenCL Program . . . . . . . . . . . . . . 153
3.2 Debugging OpenCL codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
3.2.1 Printf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
3.2.2 Using GDB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
3.3 Performance and Double Precision . . . . . . . . . . . . . . . . . . . . . . 162
3.3.1 Floating Point Arithmetics . . . . . . . . . . . . . . . . . . . . . . . 162
3.3.2 Arithmetics Precision – Practical Approach . . . . . . . . . . . . . 165
3.3.3 Profiling OpenCL Application . . . . . . . . . . . . . . . . . . . . . 172
3.3.4 Using the Internal Profiler . . . . . . . . . . . . . . . . . . . . . . . 173
3.3.5 Using External Profiler . . . . . . . . . . . . . . . . . . . . . . . . . 180
3.3.6 Effective Use of Memories – Memory Access Patterns . . . . . . . 183
3.3.7 Matrix Multiplication – Optimization Issues . . . . . . . . . . . . 189
3.4 OpenCL and OpenGL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194
3.4.1 Extensions Used . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195
3.4.2 Libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196
3.4.3 Header Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196
3.4.4 Common Actions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
3.4.5 OpenGL Initialization . . . . . . . . . . . . . . . . . . . . . . . . . . 198
3.4.6 OpenCL Initialization . . . . . . . . . . . . . . . . . . . . . . . . . . 201
3.4.7 Creating Buffer for OpenGL and OpenCL . . . . . . . . . . . . . . 203
3.4.8 Kernel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
3.4.9 Generating Effect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213
3.4.10 Running Kernel that Operates on Shared Buffer . . . . . . . . . . 215
3.4.11 Results Display . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216
3.4.12 Message Handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218
3.4.13 Cleanup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219
3.4.14 Notes and Further Reading . . . . . . . . . . . . . . . . . . . . . . . 221
3.5 Case Study – Genetic Algorithm . . . . . . . . . . . . . . . . . . . . . . . . 221
3.5.1 Historical Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221
3.5.2 Terminology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221
3.5.3 Genetic Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222
3.5.4 Example Problem Definition . . . . . . . . . . . . . . . . . . . . . . 225
3.5.5 Genetic Algorithm Implementation Overview . . . . . . . . . . . 225
3.5.6 OpenCL Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226
3.5.7 Most Important Elements of Host Code . . . . . . . . . . . . . . . 234
3.5.8 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241
3.5.9 Experiment Results . . . . . . . . . . . . . . . . . . . . . . . . . . . 241

A Comparing CUDA with OpenCL 245


A.1 Introduction to CUDA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245
A.1.1 Short CUDA Overview . . . . . . . . . . . . . . . . . . . . . . . . . . 245
A.1.2 CUDA 4.0 Release and Compatibility . . . . . . . . . . . . . . . . . 245
A.1.3 CUDA Versions and Device Capability . . . . . . . . . . . . . . . . 247
A.2 CUDA Runtime API Example . . . . . . . . . . . . . . . . . . . . . . . . . . 249
A.2.1 CUDA Program Explained . . . . . . . . . . . . . . . . . . . . . . . 251

xii
A.2.2 Blocks and Threads Indexing Formulas . . . . . . . . . . . . . . . 257
A.2.3 Runtime Error Handling . . . . . . . . . . . . . . . . . . . . . . . . 260
A.2.4 CUDA Driver API Example . . . . . . . . . . . . . . . . . . . . . . . 262

B Theoretical Foundations of Heterogeneous Computing 269


B.1 Parallel Computer Architectures . . . . . . . . . . . . . . . . . . . . . . . . 269
B.1.1 Clusters and SMP . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269
B.1.2 DSM and ccNUMA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270
B.1.3 Parallel Chip Computer . . . . . . . . . . . . . . . . . . . . . . . . . 270
B.1.4 Performance of OpenCL Programs . . . . . . . . . . . . . . . . . . 270
B.2 Combining MPI with OpenCL . . . . . . . . . . . . . . . . . . . . . . . . . . 277

C Matrix Multiplication – Algorithm and Implementation 279


C.1 Matrix Multiplication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279
C.2 Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279
C.2.1 OpenCL Kernel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279
C.2.2 Initialization and Setup . . . . . . . . . . . . . . . . . . . . . . . . . 280
C.2.3 Kernel Arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . 282
C.2.4 Executing Kernel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 282

D Using Examples Attached to the Book 285


D.1 Compilation and Setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 286
D.1.1 Linux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 286
D.1.2 Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 286

Bibliography and References 289

xiii
xiv
Chapter 1

Introduction

1.1. Existing Standard Parallel Programming Systems


The last decade of the 20th century and the first decade of the 21st century can be
called the Era of Parallel Computing. In this period of time, not only were extremely
powerful supercomputers designed and built, but two de facto standard parallel pro-
gramming systems for scientific and engineering applications were successfully intro-
duced worldwide. They are MPI (Message Passing Interface) for clusters of comput-
ers and OpenMP for shared memory multi-processors. Both systems are predecessors
of the subject of this book on OpenCL. They deserve short technical description and
discussion. This will help to see differences between the older MPI/OpenMP and the
newest OpenCL parallel programming systems.

1.1.1. MPI
MPI is a programming system but not a programming language. It is a library of func-
tions for C and subroutines for FORTRAN that are used for message communication
between parallel processes created by MPI. The message-passing computing model
(Fig. 1.1) is a collection of interconnected processes that use their local memories
exclusively. Each process has an individual address identification number called the
rank. Ranks are used for sending and receiving messages and for workload distribu-
tion. There are two kinds of messages: point-to-point messages and collective mes-
sages. Point-to-point message C functions contain several parameters: the address of
the sender, the address of the receiver, the message size and type and some additional
information. In general, message parameters describe the nature of the transmitted
data and the delivery envelope description.
The collection of processes that can exchange messages is called the communica-
tor. In the simplest case there is only one communicator and each process is assigned
to one processor. In more general settings, there are several communicators and sin-
gle processors serve several processes. A processor rank is usually an integer number
running from 0 to p-1 where p is the total number of processes. It is also possible to
number processes in a more general way than by consecutive integer numbers. For
example, their address ID can be a double number such as a point (x, y) in Carte-

1
Another Random Document on
Scribd Without Any Related Topics
Treble, treb’l, subst. het drievoudige; hooge bovenstem, discant,
sopraan; adj. drievoudig, hoog (van stem of instrument); — verb.
verdrievoudigen, driedubbel worden: The boy —s =
jongenssopranen; You are doubly, nay trebly blessed = dubbel,
neen driewerf gezegend.

Tree, trî, subst. boom, as, leest, galg (in samenst.); — verb. in een
boom jagen of vluchten, in verlegenheid brengen of in de macht
krijgen, op de leest zetten: As the — so the fruit = zoo boom zoo
vrucht; de appel valt niet ver van den boom; He is at the top of
the — = hij heeft het hoogste punt bereikt; I have got you up a —
= in mijn macht, je zit er leelijk in; — of knowledge = boom der
kennisse des goeds en des kwaads; — of life = boom des levens;
Books, bound in —-calf = kalfsleer met boomfiguren; —-deity =
afgodsboom; —-frog = boomkikvorsch; —-louse = bladluis; —-
nymph = dryade; —-toad = boomkikvorsch; —-worship =
boomvereering; —less = zonder boomen; —like = als een boom.

Treenail, trîneil, houten nagel.

Trefoil, trîfôil, klaver(blad).

Trek, trek, trekken (in een ossenwagen); subst. trek, reis (Z. Afr.);
—-chain.

Trellis, trelis, latwerk, traliewerk, leilatten; —-fence; —-gate; —-


work = kruiselings loopende latten voor veranda’s, priëeltjes, etc.;
—ed = met latwerk.

Trelawny, trəlôni.

Tremble, tremb’l, subst. beving, vrees; — verb. beven, rillen,


sidderen, schudden, trillen: I am all of (in) a — = beef over mijn
geheele lijf; He —d with fear = van angst; To — in every limb, in
one’s shoes; —ment = triller (muz.); —r = bever, riller;
Trembling: — in the balance = onzeker; —-poplar =
ratelpopulier.

Tremendous, trimendəs, geducht, verschrikkelijk; subst. —ness.

Tremolo, treməlou, triller, trilling.

Tremor, tremə, rilling, huivering: In a —; — cordis =


hartklopping; Tremulous, tremjulɐs, bevend, trillend, sidderend;
subst. —ness.

Trenail = Treenail.

Trench, trenš, subst. gracht, greppel, sloot, afvoersloot, loopgraaf;


— verb. eene sloot of greppel graven, loopgraven maken, inbreuk
maken op (on, upon), diep graven of ploegen: The enemy opened
the —es = begon met de loopgraven; —-plough = diepsnijdende
ploeg; Trenchancy = scherpheid; Trenchant, trenš’nt, snijdend,
scherp, bits; Trencher = graver, houten schotel, broodplank, tafel:
—(-cap) = hoofddeksel (met vierkant bovenstuk) van de E.
studenten; —-man = goed en smakelijk eter = —-mate.

Trend, trend, subst. neiging, richting, geer, bocht; — verb. geeren,


zich richten, loopen, zich uitstrekken: The — of the sea-shore = de
bocht der zeekust; The coast —ed to north = de kust liep noord.

Trennel, tren’l, trɐn’l = Treenail.

Trental, trent’l, Gregoriaansche mis: Dertig missen, één per dag,


vooral voor overledenen.

Trepan, trəpan, schedelzaag of -boor, boormachine; — verb.


doorboren of trepanneeren; —ner.
Trepidation, trepideiš’n, siddering, trilling, beverigheid,
ontsteltenis.

Trespass, trespəs, subst. overtreding, zonde, nadeel; — verb.


overtreden, zondigen, schenden, te ver gaan, misbruik maken, zich
indringen: Forgive us our —es as we forgive them that —
against us = vergeef ons onze schulden gelijk ook wij vergeven
onzen schuldenaren; To — on (upon) a law, upon a person’s
good nature = overtreden.… misbruik maken van; No —ing on
the railway is allowed = de toegang tot den spoorweg is
verboden; I hope I have not —ed upon your time = niet te veel
van uw tijd geroofd heb; —er.

Tress, tres, (haar)lok, krul, vlecht; —ed.

Trestle, tres’l, stellage, bok, schraag; —-board = teekenbord; A


—-bridge = schraagbrug; —-work = steigerwerk of viaduct op
palen en schragen (Amer.).

Tret, tret, goed gewicht, vier Eng. ponden toe op elke 100.

Trevelyan, trəvelj’n; Treves, trîvz, Trier.

Trevet, trevet. Zie Trivet.

Trey, trei, drie (op dobbelsteen of kaart).

Triable, traiəb’l, wat beproefd kan worden; subst. —ness; Trial,


traiəl, proef, experiment, verhoor, (gerechtelijk) onderzoek,
beproeving: By way of —; On — = op proef; On one’s — = in
verhoor, in onderzoek; Hour of —; He’s a great — to us = baart
ons veel zorgen; A — man = iemand, die “op proef” genomen
wordt; The pest and — of the libraries = plaag en beproeving; A —
at bar = processen waarbij de 4 rechters v. het oude Superior Court
waren betrokken, zoodat aan 3 Courts geen zaken behandeld
konden worden; A — by jury = gerechtelijk onderzoek door [589]de
jury; He was brought to (put to) his — = werd in verhoor
genomen, vervolgd; To commit for — = naar een rechtbank
verwijzen; Let him have a — = laat het hem eens probeeren; To
make a — of = de proef nemen; To move for a new — =
appelleeren; To be put on (committed for) — = in verhoor
genomen, vervolgd worden; The steamer gave much satisfaction
in her —s = op den proeftocht (= —-trip); —-balloon =
proefballon (ook fig.).

Triangle, traiaŋg’l, driehoek, triangel; Triangular, traiaŋgjulə,


driehoekig: — compasses = passer met drie beenen; Triangulate,
traiaŋgjuleit, trianguleeren; Triangulation = triangulatie.

Trias, traiəs, triasformatie; adj. Triassic.

Tribal, traib’l, v. een stam: The — rules which regulate savage life;
Tribe, traib, stam, klasse, geslacht, familie, troep; —s-man, lid van
een stam.

Tribrach, traibrak, voet v. drie korte syllaben.

Tribulation, tribjuleiš’n, groot verdriet, zware beproeving.

Tribunal, traibjûn’l, rechtbank, gerechtshof, rechterstoel,


biechtstoel; Tribune, tribjûn, tribuun, tribune; —ship.

Tributary, tribjutəri, subst. en adj. schatplichtig(e staat); zijrivier (=


— stream); Tribute, tribjut, schatting, cijns, schatplichtigheid: To
pay the — of nature = den tol der natuur betalen; —-money =
cijns, schatting.

Tricapsular, traikapsiulə, met drie kapsels of cellen.

Trice, trais, ophijschen.


Trice, trais, oogenblikje: In a — = in een wip.

Tricentenary, traisentənəri. Zie Tercentenary; adj. Tricentennial.

Triceps, traiseps, driehoofdig.

Trichina, trikainə, trichine; Trichinosis, trikinousis,


trichinenziekte; adj. Trichinous, trikinɐs, trikainəs.

Trichord, traiköd, subst. en adj. driesnarig (instrument).

Trick, trik, subst. streek, kunstgreep, handigheid, poets, grap, trek,


slag, “volte”, eigenaardigheid, roergang (scheepst.); — verb.
bedriegen, bedotten; versieren, opschikken: Boy’s — =
kwajongensstreek; —s of fortune = grillen; Don’t come your —s
here = haal hier geen streken uit; He has done the — = is dood,
kapot; He always had the bad — of mumbling = de slechte
gewoonte; We have the odd — = één slag (trek) meer; I knew
every — of his face = iedere uitdrukking; I know a — worth two
of that = daar loop ik niet in; He knows a — or two = is
uitgeslapen; He played you a bad — = heeft u eene leelijke poets
gebakken; To show —s = kunstjes vertoonen; He —ed me out of a
considerable sum = bedroog mij voor; I am tired of those dramatic
—-changes = die dramatische verrassingen; —er = bedrieger; —
ery = bedriegerij, bedotterij; —iness, subst. v. —y; —ish = vol
streken, bedriegelijk; subst. —ishness; —siness, subst. v. —sy; —
ster = bedrieger, schurk; —sy = schalksch, snaaksch, fijn; —y = vol
streken, ondeugend, snaaksch.

Trickle, trik’l, zachtkens vloeien, in droppels neerdalen: The blood


—d down my fingers = liep tappelings langs mijne vingers.

Trick-track, triktrak, triktrakspel.


Triclinium, traikliniəm, stel lage divans om drie zijden eener
eettafel, elk stel voor drie personen; Rom. feestzaal.

Tricolour, traikɐlə, driekleurig(e vlag); —ed.

Tricot, trîkou, tricot.

Tricycle, traisik’l, subst. driewieler; — verb. op een driewieler


rijden; Tricyclist = rijder op een driewieler.

Tridactyl(ous), traidaktil(ɐs), met drie teenen of vingers.

Trident, traid’nt, drietand, oppermacht ter zee; —ate(d), traidentit


(—eitid), met drie tanden.

Tridentine, traidentin, subst. en adj. het concilie v. Trente of de


stad betreffend.

Tridimensional, traidimenšən’l, met drie afmetingen.

Tried, traid, beproefd: A — friend = trouw; Trier, traiə, vroeger


een bepaald rechter.

Triennial, traienj’l, driejarig, driejaarlijksch.

Trifid, traifid, in drieën gespleten.

Trifle, traif’l, subst. kleinigheid, beetje, beuzeling, schoteltje v. een


gebak in sherry gedrenkt en met room en geslagen eieren bedekt;
— verb. spelen, spotten, beuzelen, verbeuzelen: I don’t stand upon
—s = zie niet op die kleinigheden; You are trifling away your time
and money = ge vermorst; Don’t — with me = houd me niet voor
den gek; —r = beuzelaar; Trifling expenses = niet
noemenswaardige uitgaven.
Trifoliate(d), traifouljit (—eitid), driebladig; Trifolium, traifoulj’m,
klaver.

Trifurcate(d), traifɐ̂ kit (—eitid), met drie takken of vorken.

Trig, trig, keurig, netjes.

Trig, trig, subst. remblok, remschoen; — verb. remmen, vastzetten.

Trigger, trigə, trekker (v. een vuurwapen): To pull the — =


afvuren; —-guard = beugel (onder den trekker).

Trigon, traigon, trigoon, driehoek; het samenkomen v. drie teekens


van den Dierenriem; —al, trigən’l, driepuntig, driehoekig;
Trigonometric(al), trigənəmetrik(’l), tot de driehoeksmeting
behoorende; Trigonometry, trigənomətri, driehoeksmeting.

Trigraph, traigrâf, drie klinkers met één klank, b.v. eau in beau.

Trihedral, traihîdr’l, traihedr’l, met drie gelijke zijden.

Trike, traik, verb. van Tricycle: These girls are adepts at triking =
rijden goed op driewielers.

Trilateral, trailatər’l, driezijdig.

Trilinear, trailinjə, met drie lijnen.

Trilingual, trailiŋgw’l, in drie talen. [590]

Triliteral, trailitər’l, (woord) v. drie letters.

Trill, tril, subst. trilling, getrilde letter (zooals de Nederl. r),


tremblant (muz.); — verb. trillen, vibreeren.

Trillion, trilj’n, trillioen, 1 met 18 nullen (Amer. 1 met 12 nullen).


Trilobite, triləbait, zeker fossiel schelpdier.

Trilogy, trilədži, trilogie.

Trim, trim, subst. toestand, staat, orde, kleeding, gala, opschik,


garneersel; adj. netjes, keurig, proper, goed passend; — verb. in
orde brengen, netjes maken, versieren, uitrusten, snoeien,
bijknippen, garneeren, opmaken, oprakelen, schoonmaken,
terechtwijzen, geschikt maken, in goeden staat brengen (van een
schip met betrekking tot lading, ballast, masten, enz.): We are in
good — = in goeden staat, op alles voorbereid; She was dressed in
regulation — = gekleed overeenkomstig de voorschriften (op bals,
etc.); Out of — = slecht gestouwd; I —med him = veegde hem
den mantel uit; To — a candle = snuiten; Will you — the fire? =
vuur oppoken (en den haard aanvegen, etc.); He —med the lamp
= maakte de lamp in orde; I have —med this piece in here = dit
stuk hier ingepast; The sails were —med = zoo gunstig mogelijk
(naar den wind) gezet; To — one’s sails accordingly = de huik
naar den wind hangen; Independent members do not — to political
demagogues = schikken zich niet naar; —mer = tremmer, politieke
weerhaan, terechtwijzer, terechtwijzing; —ming = terechtwijzing,
pak slaag; onstandvastigheid, weifelmoedigheid; —mings =
oplegsel, garneersel, toespijzen: Tea with —mings; —ness =
netheid, etc.

Trimeter, trimətə, drievoetige versregel.

Trinal, train’l, drievoudig: — unity.

Tringle, triŋg’l, gordijnroede, kleine kroonlijst.

Trinidad, trinidad.
Trinitarian, trinitêrj’n, subst. en adj. (belijder) v. de
drieéénheidsleer; —ism = het leerstuk der drieéénheid; Trinity,
triniti, drieéénheid: —-house = oude corporatie te Londen bij welke
o.a. het toezicht op vuurtorens en boeien aan kusten en in rivieren
berust; —-Sunday = Zondag na Pinkster; —-term = een der vier
termijnen (22 Mei–12 Juni) gedurende welke Londensche
rechtscolleges zitting hielden; thans — Sittings van Dinsdag na
Pinkster tot 12 Augustus.

Trinket, triŋkət, kleinood, lijfsieraad in ’t algemeen; — verb.


intrigueeren.

Trinomial, trainoumj’l, subst. en adj. drienamig(e term) =


Trinominal, trainomin’l.

Trio, traiou, trîou, trio, klaverblad (fig.).

Triolet, traiəlet, trîəlet, triolet.

Trior, traiə, ambtenaar, die onderzoekt of eene wraking van


juryleden juist is.

Trip, trip, subst. trippelpas, getrippel, uitstapje, gang, slag,


beentjelichten, struikeling, misstap, val, kleine fout; — verb.
trippelen, vlug loopen, huppelen, een uitstapje doen, struikelen, een
mispas doen, dwalen, op eene fout betrappen, beentje lichten: They
went on their wedding-— = op hun huwelijksreisje; Her foot —
ped = zij struikelde; I —ped him up = heb hem den voet gelicht;
They —ped up one another’s heels = volgden elkander
onmiddellijk, zaten elkaar achterna; I was —ped up by that
branch = struikelde over dien tak. Zie Tripper.

Triparted, traipâtid, in drie stukken verdeeld; Tripartite, tripətait,


traipâtait, in drie deelen verdeeld, in triplo; Tripartition,
tr(a)ipâtiš’n, verdeeling in drieën.

Tripe, traip, pens, ingewanden, buik.

Tripetalous, traipetəlɐs, driebladig.

Triphthong, tripthoŋ, trifthoŋ, drieklank; adj. —al, tripthoŋg’l,


trifthoŋg’l.

Triple, trip’l, adj. drievoudig, driemaal; — verb. verdrievoudigen;


—-crown = pauselijke kroon; —-headed = driehoofdig; Triplet,
triplət, subst. trio, drieling, drieregelig versje, fiets voor 3 personen;
adj. drievoudig; Triplex, traipleks, trippelmaat; Triplicate, triplikit,
verdrievoudigd, drievoudig; subst. triplicaat; Triplication =
verdrievoudiging, tripliek; Triplicity, triplisiti, drievoudigheid.

Tripod, traipod, drievoet(ige stoel, tafel of ketel).

Tripoli, tripəli, Tripoli; Tripoline, tripəl(a)in; Tripolitan, tripolit’n,


(bewoner) van T.

Tripos, traipos, het Honours-Exam. te Cambridge voor den B.A.


graad.

Tripper, tripə, trippelaar, danser, pleizierreiziger: Cheap —s =


pleizierreizigers; Tripple = korte galop: He put the tired nag into
a sort of — or ambling canter much affected by South-African
horses.

Triptych, triptik, een uit drie deelen bestaande altaarschilderij;


antiek waschtafeltje met 2 bladen, die konden worden
dichtgeslagen.

Triradiate(d), traireidjit (-eitid), met drie stralen.


Trireme, trairîm, galei met 3 rijen roeibanken boven elkaar.

Trise, trais, opeischen.

Trisect, traisekt, in drie gelijke deelen verdeelen; subst. —ion,


traisekš’n.

Trispermous, traispɐ̂ məs, driezadig.

Trisyllabic(al), trisilabik(’l), drielettergrepig; Trisyllable,


tr(a)isiləb’l, trisiləb’l, drielettergrepig woord.

Trite, trait, afgezaagd, alledaagsch; subst. —ness.

Triton, trait’n, zeegod, watersalamander: He is a — among the


minnows = steekt verre boven zijns gelijken uit.

Triturate, tritjureit, tot fijn poeder malen of stampen; subst.


Trituration.

Triumph, traiəmf, subst. triomf, zegepraal; — verb. zegepralen,


zegevieren: He has —ed over all difficulties = glansrijk
overwonnen; —al, traiɐmf’l, zegevierend: —al arch = eereboog; —
al car = zegekar; —ant, traiɐmf’nt, zegevierend, zegepralend: —
car (chariot) = zegekar; —er = triumphator.

Triumvir, traiɐmvɐ̂ , drieman; —ate, traiɐmvirit, driemanschap.

Triune, traijûn, drieëenig. [591]

Trivalvular, traivalvjulə, driekleppig.

Trivet, trivət, treeft, drievoet: I am (as) right as a — = ik ben zoo


gezond als een visch.
Trivial, trivj’l, triviaal, onbeduidend, plat: — name = populaire
naam voor dier of plant; —ity, trivialiti, alledaagschheid,
onbeduidend iets: — verb. —ize; subst. —ness.

Trivium, trivj’m, naam voor de drie hoofdvakken in de


Middeleeuwen: grammatica, rhetorica en logica.

Triweekly, traiwîkli, traiwîkli, driemaal per week (verschijnend


blad).

Troat, trout, subst. het schreeuwen van een hert in den bronsttijd;
— verb. schreeuwen (van een hert).

Trochaic, trəkeiik, trochaeisch.

Troche, troutš, trouk, troukî, (artsenij)tablet.

Trochee, troukî, trochee.

Trochil(us), trokil(ɐs), soort kolibri; tuinkoning.

Trod, trod, imperf. v. to tread; Trod(den), trod(’n), p. perf. van to


tread.

Troglodyte, tro(u)glədait, holbewoner; adj. Troglodytic(al),


trogləditik(’l).

Trojan, troudž’n, subst. en adj. Trojaan(sch).

Troll, troul, subst. lied (kànon), rondzang, rolletje aan een hengel,
soort kunstaas; aardgeest; — verb. rollen, ronddraaien, rondgeven,
neuriën, lokken, aantrekken, hengelen, slenteren, een rondzang
aanheffen.

Trollop, troləp, slons, slet; —y = slonzig, vuil, zedeloos.


Trollope, troləp.

Troll(e)y, troli, kar, lorrie, rol- of sledecontact bij electr. trams.

Trombone, tromboun, schuiftrompet.

Troop, trûp, subst. troep, hoop, menigte, escadron; — verb. in een


troep loopen, tot troepen of in eene menigte vereenigen, aftrekken
(away): To get one’s — = ritmeester worden; He sold out, and
the sale of his — gave us a competence = hij kocht zich uit, en de
opbrengst van zijne ritmeestersplaats verschafte ons genoeg om van
te leven; —s of the line = linietroepen; To levy (raise) —s; —ing
the colours = paradeeren; A —-horse = cavaleriepaard; —-ship
= transportschip; —er = cavalerist, transportschip: He swears like
a —er = vloekt als een dragonder.

Trope, troup, redefiguur, fig. uitdrukking.

Trophy, trofi, zegeteeken, tropee.

Tropic, tropik, subst. keerkring: — of Cancer = kreeftskeerkring;


— of Capricorn = steenbokskeerkring; The —s = de Tropen; —al
= tropisch, beeldsprakig: —al fruit.

Trossachs, trosaks.

Trot, trot, subst. draf; dribbeltje of hummeltje; — verb. draven, in


draf zetten: Little —s of four or five years old = kleine hummels; A
jog-— = sukkeldrafje; At (On a) full — = in vollen draf; He
brought his horse to a — = bracht zijn paard in draf; He was
driving on at full — = in vollen draf; To go for a — = een eindje
omstappen; To keep a person on the — all day = in touw houden
(fig.); To — out = voorrijden; We’ll have to — you out = wij zullen
u moeten examineeren, u zal op de koord moeten. Zie Trotter.
Troth, troth, trouw, geloof, waarheid, trouwbelofte: By my — = op
mijn woord; In — = voorwaar, waarachtig; They plighted their —
= beloofden elkaar trouw.

Trotter, trotə, draver, (schape-, of varkens)poot; Trotting: —-


horse = harddraver; —-match = harddraverij.

Trottoir, trotwâ, plaveisel.

Troubadour, trûbədûə, troubadour.

Trouble, trɐb’l, subst. onrust, zorg, droefheid, verlegenheid,


ongeluk, moeite, inspanning; — verb. verontrusten, storen, lastig
vallen, hinderen, verdriet doen, moeite veroorzaken, angst
aanjagen: To be at the — to = zich de moeite geven om; To be in
— = in zorgen zitten; To bring — upon oneself = zich in ’t ongeluk
storten; —s like crows seldom come singly = een ongeluk komt
zelden alleen; My boy, you’ll get into — = je loopt erin, je krijgt nog
straf; There’s no good in meeting — = geen zorg vóór den tijd; I
fear I have put you to some — = dat ik u last heb veroorzaakt;
Will you take the —? = de moeite doen, u den last getroosten; You
might hare saved me that — = dien last kunnen besparen; I will
spare no — = geen moeite ontzien; Don’t — (your head) about
this = heb daar geene zwarigheid over; I will — myself no more
about him = me niet meer druk om hem maken; May I — you for
the gravy? = om de jus verzoeken; There the wicked cease from
troubling = daar houden de boozen op van beroering (Job. III,
17 ); To fish in —d water = in troebel water visschen; —r =
verontruster, verstoorder; Troublesome = lastig, moeilijk,
vervelend: My back is — = ik heb last van (pijn in) mijn rug; subst.
—ness; A troublous life = leven vol zorgen; In troublous times
= in tijden van beroering.

Trough, trof, trog, bak, etensbak, golfdal = — of the sea.


Trounce, trauns, afrossen, uitschelden; Trouncing = afstraffing.

Troupe, trûp, troep tooneelspelers.

Trousering, trauzəriŋ, broekstof; Trousers = lange broek: A pair


of — = eene broek; To go into — = een lange broek aankrijgen; To
turn up the end of one’s — = zijn broekspijpen omslaan;
Trouser-strip = galon.

Trousseau, trûsou, uitzet van de bruid.

Trout, traut, forel(len); —-coloured = forelkleurig (wit met zwarte


spikkels); —-farm = kweekerij; —let = kleine forel.

Trouvère, trûvêə, minnezanger.

Trove, trouv. Zie Treasure; —r = bezitverkrijging door vinden,


onrechtmatige toeëigening: Action of —r = aanklacht wegens deze
toeëigening.

Trow, trau, trou, trû, gelooven, vertrouwen.

Trowbridge, troubridž.

Trowel, trauəl, subst. troffel; — verb. met [592]een troffel opleggen;


You are laying it on with a — = legt het er dik op (fig.).

Troy, trôi, Troje, Troyes (stad Z.O. v. Parijs): —(-weight) =


gewicht van 12 ounces in het pound (= ± 373,242 gr.), alléén voor
goud, zilver en juweelen; medicijnen.

Truancy, trûənsi, wegblijven, schoolverzuim; Truant, trûənt,


plichtverzakend, lui, de school verzuimend; subst. leeglooper,
spijbelaar; — verb. omboemelen, spijbelen: He often plays (the)
truant = spijbelt dikwijls; To run — = wegloopen; —-school =
school voor geregelde verzuimers.

Truce, trûs, wapenstilstand, tijdelijke opschorting: Flag of — =


witte (parlementaire) vlag; A — to your doggerel = schei uit met je
gerijmel; You have broken (the) — = den wapenstilstand
verbroken; To make — with = een wapenstilstand sluiten; —-
breaker = verbreker van afspraak of wapenstilstand.

Truck, trɐk, subst. ruilhandel, huishoudelijke artikelen, handel,


gedwongen winkelnering, verkeer; groente, afval (Amer.); katrol,
handwagen, lage stellage op wielen, lorrie, open goederenwagen,
kleine ronde schijf of kloot boven aan vlaggestok of mast; — verb.
ruilhandel drijven, schacheren, venten, in trucks overladen of
verzenden; —-man = ruilhandelaar, wagenrijder; —-system =
gedwongen winkelnering; —age, trɐkidž, ruilhandel, vervoerloon; —
ful = wagenvol.

Truckle, trɐk’l, subst. wieltje, rolletje; — verb. voortrollen; zich aan


den wil van anderen onderwerpen, slaafsch zijn, kruipen voor (to),
voortrollen; —-bed = ledikant op rolletjes; He —s to
circumstances = onderwerpt zich aan de omstandigheden; People
crawl and — for social success = kruipen en buigen zich; —r =
kruiper.

Truculence, trɐkjulens, woestheid, wreedheid, woest uiterlijk;


Truculent = ruw, wreed, vreeselijk.

Trudge, trɐdž, voortsukkelen, zich voortslepen: He —d after his


father = sukkelde achter zijn vader aan.

True, trû, waar, trouw, standvastig, eerlijk, echt, zeker, regelmatig,


recht, rechtmatig, juist: What you say there is — enough = is
volkomen waar; He was — to his country and loyal to his king =
trouw aan koning en vaderland; — to one’s word; He gave us a —
account of it = een nauwkeurig verhaal; — bill = uitspraak v. de
Grand Jury, dat na onderzoek van het bewijsmateriaal rechtsingang
zal worden verleend met verwijzing naar de Petty Jury (Panel); A
perfectly — circle = volkomen; — copy = eensluidend afschrift;
To come — = uitkomen (v. droomen); To go — = goed loopen (v.
horloges); To hold — = waar blijven; To prove — = waar blijken;
—-blue, subst. trouw, oprecht en eerlijk persoon, echte Tory; adj.
onwrikbaar, trouw en eerlijk; —-born = echt, van wettige geboorte;
—-bred = van echt ras, van goede opvoeding; —-hearted =
trouwhartig, eerlijk; subst. —-heartedness; —-love, subst.
minnaar, geliefde; —-love(r’s)-knot = soort van dubbele knoop
(zinnebeeld v. wederzijdsche trouw en liefde); —penny = eerlijke
vent; —ness = trouw, oprechtheid, juistheid, etc.

Truffle, trɐf’l, truffel; —-dog = truffelzoeker (hond); —-hunter.

Trug, trɐg, kalkbak; ⅔ bushel; groentemand.

Truism, trûizm, gemeenplaats, waarheid als eene koe.

Trullization, trɐlizeiš’n, het pleisteren.

Truly, trûli: Yours — = hoogachtend uw, etc.

Trump, trɐmp, subst. troefkaart, goede kerel, kranige vent; — verb.


troeven, troef (uit)spelen, verzinnen, opdrijven: To call for —s =
vragen; To lead off a — = opkomen met; To play —s; He was put
to his —(s) = tot het uiterste gebracht; You always turn up —s =
gij boft altijd, u loopt alles mee = All your cards are —s; —ed-up
= verzonnen, waardeloos: An accusation was —ed up against us =
werd tegen ons verzonnen; —ery, subst. vodden, prulleboel,
bedriegerij; adj. waardeloos, prullerig.
Trumpet, trɐmpət, subst. trompet, scheepsroeper, uitbazuiner; —
verb. met veel ophef bekend maken, uitbazuinen, uitbundig prijzen,
trompetten: The last — = de bazuin van den oordeelsdag; A
flourish of —s = fanfare; He blows (sounds) his own — =
verkondigt zijn eigen lof; He —ed forth his friend’s praise = stak
de loftrompet over zijn vriend; —-call = trompetsignaal; —-fish =
trompetvisch; —-fly = schapenhorzel; —er = trompetter, loftuiter,
schetteraar, trompetvogel; soort duif.

Truncal, trɐŋk’l, tot den stam of romp behoorende; Truncate,


trɐŋkit, adj. afgeknot; — verb. (trɐŋkeit), afknotten, snoeien: —d
cone (pyramid) = afgeknotte kegel (piramide); Truncation,
trɐŋkeiš’n, afknotting, het afgeknot zijn.

Truncheon, trɐnš’n, subst. stam, stomp, schacht, staf, knuppel,


maarschalksstaf; — verb. afrossen.

Trundle, trɐnd’l, subst. rol, wieltje, rolwagen; — verb. rollen, doen


rollen, hoepelen: Let them — = laat ze loopen; —-bed = rolbed;
—-head = kop v. een kaapstander; —-tail = krulstaart.

Trunk, trɐŋk, romp, stam, snuit (v. olifant), neus, koffer, hoofdlijn
(voor spoor of telefoon); bak, koker: —s = —-hose = korte wijde
broek boven de knieën ingenomen; —-line = hoofdlijn van spoor,
kanaal, etc.; —-maker = koffermaker; —-root = hoofdwortel; —-
sleeve = pofmouw.

Trunnel, trɐn’l = Treenail.

Trunnion, trɐnj’n, tap (van een kanon).

Truss, trɐs, subst. bundel, pakje, bosje, stellage of geraamte,


pianokast, breukband, console; — verb. stijf binden, opstroopen,
terecht trekken van kleeren, versterken, opmaken: He —ed on his
rags = hing zijne lompen om; He —ed up his hair = bond [593]op; A
—ed fowl = opgemaakte vogel (gereed om te worden gebraden);
—-maker = breukbandenmaker.

Trust, trɐst, subst. vertrouwen, geloof, toevertrouwd iets, deposito,


crediet, zorg, vereeniging v. personen ten einde het monopolie te
verkrijgen of te behouden; — verb. vertrouwen, gelooven,
toevertrouwen, crediet geven, lichtgeloovig zijn, zich verlaten op: A
distillers’ — = vereeniging van distillateurs; Breach of — =
trouwbreuk; Position of — = post van vertrouwen; To give — =
crediet geven; You are in my — = mij toevertrouwd, onder mijne
hoede; Bonds in — = effecten, etc. in bewaring; The watch was
committed to my — = mij ter bewaring toevertrouwd; Don’t put
your — in such people = stel geen vertrouwen in; I took it on — =
op goed geloof; I will — him no further than I can see; it was —
ed to my care = toevertrouwd aan; I will — you with this = u dit
toevertrouwen; — me for that = daar kunt ge op aan; — him to
do it = hij “lapt net hem” wel; Trustee, trɐstî, beheerder,
gevolmachtigde, commissaris, curator; —ship; Trustful =
vertrouwend; subst. —ness; Trustless = niet te vertrouwen; subst.
—ness; Trustworthiness, subst. van Trustworthy = trouw,
vertrouwd, beproefd.

Truth, trûth, waarheid, oprechtheid, getrouwheid, standvastigheid:


He did — = hij volgde Gods bevelen; Why don’t you speak the
—? = waarom zegt gij de waarheid niet; In — = in waarheid,
waarachtig, inderdaad; Of a — = waarlijk; —-ful = waarheidlievend,
vertrouwbaar; subst. —fulness.

Truttaceous, trəteišəs, forellen …

Try, trai, subst. proef, poging; — verb. beproeven, onderzoeken, op


de proef stellen, verhooren (rechtbank), aanwenden, verleiden,
ondervinden, ijken, aangrijpen, veel vergen, uitbraden, raffineeren,
inschieten: To have a — at = eens probeeren; I have tried hard to
do it = ik heb terdeeg mijn best gedaan; I will — conclusions with
him = het tegen hem opnemen; That tries the eyes = vermoeit de
oogen; Such work tries a man = pakt je aan; We will — this
quarrel hilt to hilt = dezen strijd met de degens uitmaken; To — on
= passen; probeeren: I tried on my new coat = paste; To — it on
= bedriegen, van bedrog leven; probeeren hoeveel het (met
iemand) lijden kan; To — out = doorzetten, uitsmelten: We will —
the matter out = wij zetten door tot de zaak beslist is; He was tried
and condemned = verhoord en veroordeeld; —-sail = gaffelzeil,
bezaan; —-your-weighter = automat. weegmachine. Zie Trying.

Trygon, traigən, pijlstaartrog.

Trying, trai-iŋ, lastig, smartelijk, moeielijk: Such things are — to a


man = hard voor; A — climate = ongezond klimaat; He is very —
= geeft veel last.

Tryst, trist, (plaats van) afgesproken bijeenkomst; —ing-place =


plaats van bijeenkomst.

Tsar, tsâ, Czaar; Tsarevitch, tšârəvitš, tšâreivitš; Tsarina, tšârinə,


Tsaritsa, tšaritsə.

Tsetse, tsetsə, tsetsevlieg.

T-square, tîskwêə, teekenhaak = T.

Tub, tɐb, subst. tobbe, klein vat, badtobbe, lompe boot, kansel; —
verb. in een tobbe doen, baden, een kuipbad nemen: Tale of a — =
bakersprookje; —s = boterkooper; —-fish = knorhaan; —-frock =
japon, die gewasschen kan worden; —-man = een der twee
bekwaamste advocaten van het vroegere Court of Exchequer (de
andere werd Postman genoemd); —-pair = soort v. roeiboot; —-
thumping = lawaaierige oratie; —ber = soort v. houweel; —by =
tobvormig, tonvormig; dof klinkend.

Tuba, tjûbə, tuba (muziekinstr.).

Tube, tjûb, subst. buis, pijp, tube, kanaal, lampeglas; — verb. van
pijpen of buizen voorzien: The — = de ondergrondsche spoorweg in
Londen; India-rubber — = gummislang; Test-— = reageerbuisje.

Tuber, tjûbə, vleezig gezwel, knol, aardappel; Tubercle, tjûbək’l,


knolletje, kleine tuberkel; Tubercular, tjubɐ̂ kjulə, vol knobbels of
tuberkels: — consumption; Tuberculous, tjubɐ̂ kjulɐs, lijdende
aan tuberculose, vol tuberkels; Tuberculosis = tuberculose;
Tuberose, tjûbərous, tjûbərous, subst. tuberoos (plant); adj. met
knobbels of uitwassen; subst. Tuberosity, tjûbərositi,
knobbeligheid, gezwel, zwelling; Tuberous = Tuberose.

Tubular, tjûbjulə, buis-, koker- of cylinder-vormig; — boiler =


stoomketel met vlampijpen; — bridge = kokerburg; — post =
luchtdrukpost; Tubule, tjûbjûl, pijpje, buisje; Tubuliform = in den
vorm van een buisje.

Tuck, tɐk, subst. opnaaisel, omslag, netje, lekkernijen, eetlust;


trommelslag, rapier; — verb. opschorten, omslaan, inslaan,
optrekken, vouwen, opstroopen, instoppen, zich zat eten (out),
vollen (van laken), tokken (van eene kip): — of drum = slag op
trom; It was nip and — with us = het kwam er op aan, was een
strijd op leven en dood; —-shop = suikerbakkerij; —-in (= —-out)
= traktatie; I have —ed them in warmly = heb ze ingestopt; The
handkerchief about his neck was —ed in at the bosom = was (nl. de
punten er van) in zijn borst gestopt; He —ed up his sleeves =
stroopte op; They —ed him up as best they could = pakten hem in;
Tucker = kanten halskraag of chemisette; Tuck(ing)-mill =
volmolen.
Tucum, tjûk’m, Z.-Amer. palmsoort.

Tudor, tjûdə, subst. en adj. (van) Tudor: — style = Gothisch-


Engelsche bouwstijl.

Tuesday, tjûzdi, Dinsdag.

Tufa, tjûfə, tufsteen; —ceous, tjufeišəs, gelijkend op, bestaande


uit —.

Tuff, tɐf, tuf(steen).

Tuft, tɐft, subst. bosje (haar), kuif, trosje, hoop, groep, kwast (aan
muts, etc.), spitse baard; — verb. in bosjes of hoopjes verdeelen
[594](groeien), met kwastjes of trosjes versieren: Ricquet-with-a-
—; —-hunter = klaplooper, flikflooier; —ed = met kwastje of
trosjes versierd, met spitsen kinbaard, in trosjes groeiend.

Tug, tɐg, subst. krachtige haal, ruk, sleepboot, rommelwagen of


rammelkast; — verb. krachtig trekken of halen, rukken, sleepen: —
of war = touwtrekken; The real — of war will come on the
electoral question = de ware strijd; I had a hard — of it = het
heeft me veel moeite gekost; He was —ged like a dog by fate =
door het lot als een hond heen en weer gesleept; We were —ging
against wind and tide = roeiden tegen; —boat = sleepboot.

Tuition, tjuiš’n, onderwijs, opzicht; adj. —al = —ary.

Tula, tûlə, stad in Rusland; kookplaats (Indië); —-metal = allooi


van zilver, koper, lood en zwavel.

Tulip, tjûlip, tulp; Tulipomania, tjûlipəmeinjə, tulpenmanie (17e


eeuw); adj. en subst. Tûlipomaniac.

Tulle, tûl, tule.


Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.

Let us accompany you on the journey of exploring knowledge and


personal growth!

ebookname.com

You might also like