OpenCL编程指南 英文版PDF电子书下载
- 电子书积分:18 积分如何计算积分?
- 作 者:(美)AaftabMunshiBendeictR.GasterTimothyG.MattsonJamesFungDanGinsburg著
- 出 版 社:北京:科学出版社
- 出版年份:2012
- ISBN:9787030349637
- 页数:603 页
Part Ⅰ The OpenCL 1.1 Language and API 1
1.An Introduction to OpenCL 3
What Is OpenCL,or...Why You Need This Book 3
Our Many-Core Future:Heterogeneous Platforms 4
Software in a Many-Core World 7
Conceptual Foundations of OpenCL 11
Platform Model 12
Execution Model 13
Memory Model 21
Programming Models 24
OpenCL and Graphics 29
The Contents of OpenCL 30
Platform API 31
Runtime API 31
Kernel Programming Language 32
OpenCL Summary 34
The Embedded Profile 35
Learning OpenCL 36
2.HelloWorld:An OpenCL Example 39
Building the Examples 40
Prerequisites 40
Mac OS X and Code::Blocks 41
Microsoft Windows and Visual Studio 42
Linux and Eclipse 44
HelloWorld Example 45
Choosing an OpenCL Platform and Creating a Context 49
Choosing a Device and Creating a Command-Queue 50
Creating and Building a Program Object 52
Creating Kernel and Memory Objects 54
Executing a Kernel 55
Checking for Errors in OpenCL 57
3.Platforms,Contexts,and Devices 63
OpenCL Platforms 63
OpenCL Devices 68
OpenCL Contexts 83
4.Programming with OpenCL C 97
Writing a Data-Parallel Kernel Using OpenCL C 97
Scalar Data Types 99
The half Data Type 101
Vector Data Types 102
Vector Literals 104
Vector Components 106
Other Data Types 108
Derived Types 109
Implicit Type Conversions 110
Usual Arithmetic Conversions 114
Explicit Casts 116
Explicit Conversions 117
Reinterpreting Data as Another Type 121
Vector Operators 123
Arithmetic Operators 124
Relational and Equality Operators 127
Bitwise Operators 127
Logical Operators 128
Conditional Operator 129
Shift Operators 129
Unary Operators 131
Assignment Operator 132
Qualifiers 133
Function Qualifiers 133
Kernel Attribute Qualifiers 134
Address Space Qualifiers 135
Access Qualifiers 140
Type Qualifiers 141
Keywords 141
Preprocessor Directives and Macros 141
Pragma Directives 143
Macros 145
Restrictions 146
5.OpenCL C Built-In Functions 149
Work-Item Functions 150
Math Functions 153
Floating-Point Pragmas 162
Floating-Point Constants 162
Relative Error as ulps 163
Integer Functions 168
Common Functions 172
Geometric Functions 175
Relational Functions 175
Vector Data Load and Store Functions 181
Svnchronization Functions 190
Async Copy and Prefetch Functions 191
Atomic Functions 195
Miscellaneous Vector Functions 199
Image Read and Write Functions 201
Reading from an Image 201
Samplers 206
Determining the Border Color 209
Writing to an Image 210
Querying Image Information 214
6.Programs and Kernels 217
Program and Kernel Object Overview 217
Program Objects 218
Creating and Building Programs 218
Program Build Options 222
Creating Programs from Binaries 227
Managing and Querying Programs 236
Kernel Objects 237
Creating Kernel Objects and Setting Kernel Arguments 237
Thread Safety 241
Managing and Querying Kernels 242
7.Buffers and Sub-Buffers 247
Memory Objects,Buffers,and Sub-Buffers Overview 247
Creating Buffers and Sub-Buffers 249
Querying Buffers and Sub-Buffers 257
Reading,Writing,and Copying Buffers and Sub-Buffers 259
Mapping Buffers and Sub-Buffers 276
8.Images and Samplers 281
Image and Sampler Object Overview 281
Creating Image Objects 283
Image Formats 287
Querying for Image Support 291
Creating Sampler Objects 292
OpenCL C Functions for Working with Images 295
Transferring Image Objects 299
9.Events 309
Commands,Queues,and Events Overview 309
Events and Command-Queues 311
Event Objects 317
Generating Events on the Host 321
Events Impacting Execution on the Host 322
Using Events for Profiling 327
Events Inside Kernels 332
Events from Outside OpenCL 333
10.Interoperability with OpenGL 335
OpenCL/OpenGL Sharing Overview 335
Querying for the OpenGL Sharing Extension 336
Initializing an OpenCL Context for OpenGL Interoperability 338
Creating OpenCL Buffers from OpenGL Buffers 339
Creating OpenCL Image Objects from OpenGL Textures 344
Querying Information about OpenGL Objects 347
Synchronization between OpenGL and OpenCL 348
11.Interoperability with Direct3D 353
Direct3D/OpenCL Sharing Overview 353
Initializing an OpenCL Context for Direct3D Interoperability 354
Creating OpenCL Memory Objects from Direct3D Buffers and Textures 357
Acquiring and Releasing Direct3D Objects in OpenCL 361
Processing a Direct3D Texture in OpenCL 363
Processing D3D Vertex Data in OpenCL 366
12.C++Wrapper API 369
C++Wrapper API Overview 369
C++Wrapper API Exceptions 371
Vector Add Example Using the C++Wrapper API 374
Choosing an OpenCL Platform and Creating a Context 375
Choosing a Device and Creating a Command-Queue 376
Creating and Building a Program Object 377
Creating Kernel and Memory Objects 377
Executing the Vector Add Kernel 378
13.OpenCL Embedded Profile 383
OpenCL Profile Overview 383
64-Bit Integers 385
Images 386
Built-In Atomic Functions 387
Mandated Minimum Single-Precision Floating-Point Capabilities 387
Determining the Profile Supported by a Device in an OpenCL C Program 390
Part Ⅱ OpenCL 1.1 Case Studies 391
14.Image Histogram 393
Computing an Image Histogram 393
Parallelizing the Image Histogram 395
Additional Optimizations to the Parallel Image Histogram 400
Computing Histograms with Half-Float or Float Values for Each Channel 403
15.Sobel Edge Detection Filter 407
What Is a Sobel Edge Detection Filter? 407
Implementing the Sobel Filter as an OpenCL Kernel 407
16.Parallelizing Dijkstra's Single-Source Shortest-Path Graph Algorithm 411
Graph Data Structures 412
Kernels 414
Leveraging Multiple Compute Devices 417
17.Cloth Simulation in the Bullet Physics SDK 425
An Introduction to Cloth Simulation 425
Simulating the Soft Body 429
Executing the Simulation on the CPU 431
Changes Necessary for Basic GPU Execution 432
Two-Layered Batching 438
Optimizing for SIMD Computation and Local Memory 441
Adding OpenGL Interoperation 446
18.Simulating the Ocean with Fast Fourier Transform 449
An Overview of the Ocean Application 450
Phillips Spectrum Generation 453
An OpenCL Discrete Fourier Transform 457
Determining 2D Decomposition 457
Using Local Memory 459
Determining the Sub-Transform Size 459
Determining the Work-Group Size 460
Obtaining the Twiddle Factors 461
Determining How Much Local Memory Is Needed 462
Avoiding Local Memory Bank Conflicts 463
Using Images 463
A Closer Look at the FFT Kernel 463
A Closer Look at the Transpose Kernel 467
19.Optical Flow 469
Optical Flow Problem Overview 469
Sub-Pixel Accuracy with Hardware Linear Interpolation 480
Application of the Texture Cache 480
Using Local Memory 481
Early Exit and Hardware Scheduling 483
Efficient Visualization with OpenGL Interop 483
Performance 484
20.Using OpenCL with PyOpenCL 487
Introducing PyOpenCL 487
Running the PylmageFilter2D Example 488
PyImageFilter2D Code 488
Context and Command-Queue Creation 492
Loading to an Image Object 493
Creating and Building a Program 494
Setting Kernel Arguments and Executing a Kernel 495
Reading the Results 496
21.Matrix Multiplication with OpenCL 499
The Basic Matrix Multiplication Algorithm 499
A Direct Translation into OpenCL 501
Increasing the Amount of Work per Kernel 506
Optimizing Memory Movement:Local Memory 509
Performance Results and Optimizing the Original CPU Code 511
22.Sparse Matrix-Vector Multiplication 515
Sparse Matrix-Vector Multiplication(SpMV)Algorithm 515
Description of This Implementation 518
Tiled and Packetized Sparse Matrix Representation 519
Header Structure 522
Tiled and Packetized Sparse Matrix Design Considerations 523
Optional Team Information 524
Tested Hardware Devices and Results 524
Additional Areas of Optimization 538
A.Summary of OpenCL 1.1 541
The OpenCL Platform Layer 541
Contexts 541
Querying Platform Information and Devices 542
The OpenCL Runtime 543
Command-Queues 543
Buffer Objects 544
Create Buffer Objects 544
Read,Write,and Copy Buffer Objects 544
Map Buffer Objects 545
Manage Buffer Objects 545
Query Buffer Objects 545
Program Objects 546
Create Program Objects 546
Build Program Executable 546
Build Options 546
Query Program Objects 547
Unload the OpenCL Compiler 547
Kernel and Event Objects 547
Create Kernel Objects 547
Kernel Arguments and Object Queries 548
Execute Kernels 548
Event Objects 549
Out-of-Order Execution of Kernels and Memory Object Commands 549
Profiling Operations 549
Flush and Finish 550
Supported Data Types 550
Built-In Scalar Data Types 550
Built-In Vector Data Types 551
Other Built-In Data Types 551
Reserved Data Types 551
Vector Component Addressing 552
Vector Components 552
Vector Addressing Equivalencies 553
Conversions and Type Casting Examples 554
Operators 554
Address Space Qualifiers 554
Function Qualifiers 554
Preprocessor Directives and Macros 555
Specify Type Attributes 555
Math Constants 556
Work-Item Built-In Functions 557
Integer Built-In Functions 557
Common Built-In Functions 559
Math Built-In Functions 560
Geometric Built-In Functions 563
Relational Built-In Functions 564
Vector Data Load/Store Functions 567
Atomic Functions 568
Async Copies and Prefetch Functions 570
Synchronization,Explicit Memory Fence 570
Miscellaneous Vector Built-In Functions 571
Image Read and Write Built-In Functions 572
Image Objects 573
Create Image Objects 573
Query List of Supported Image Formats 574
Copy between Image,Buffer Objects 574
Map and Unmap Image Objects 574
Read,Write,Copy Image Objects 575
Query Image Objects 575
Image Formats 576
Access Qualifiers 576
Sampler Objects 576
Sampler Declaration Fields 577
OpenCL Device Architecture Diagram 577
OpenCL/OpenGL Sharing APIs 577
CL Buffer Objects>GL Buffer Objects 578
CL Image Objects>GL Textures 578
CL Image Objects>GL Renderbuffers 578
Query Information 578
Share Objects 579
CL Event Objects>GL Sync Objects 579
CL Context>GL Context,Sharegroup 579
OpenCL/Direct3D 10 Sharing APIs 579
Index 581
- 《近代旅游指南汇刊二编 16》王强主编 2017
- 《甘肃省档案馆指南》甘肃省档案馆编 2018
- 《近代旅游指南汇刊 31》王强主编 2014
- 《卓有成效的管理者 中英文双语版》(美)彼得·德鲁克许是祥译;那国毅审校 2019
- 《近代旅游指南汇刊二编 10》王强主编 2017
- 《手工咖啡 咖啡爱好者的完美冲煮指南》(美国)杰茜卡·伊斯托,安德烈亚斯·威尔霍夫 2019
- 《近代旅游指南汇刊 13》王强主编 2014
- 《近代旅游指南汇刊 28》王强主编 2014
- 《程序逻辑及C语言编程》卢卫中,杨丽芳主编 2019
- 《近代旅游指南汇刊 23》王强主编 2014
- 《SQL与关系数据库理论》(美)戴特(C.J.Date) 2019
- 《魔法销售台词》(美)埃尔默·惠勒著 2019
- 《看漫画学钢琴 技巧 3》高宁译;(日)川崎美雪 2019
- 《优势谈判 15周年经典版》(美)罗杰·道森 2018
- 《社会学与人类生活 社会问题解析 第11版》(美)James M. Henslin(詹姆斯·M. 汉斯林) 2019
- 《海明威书信集:1917-1961 下》(美)海明威(Ernest Hemingway)著;潘小松译 2019
- 《迁徙 默温自选诗集 上》(美)W.S.默温著;伽禾译 2020
- 《上帝的孤独者 下 托马斯·沃尔夫短篇小说集》(美)托马斯·沃尔夫著;刘积源译 2017
- 《巴黎永远没个完》(美)海明威著 2017
- 《剑桥国际英语写作教程 段落写作》(美)吉尔·辛格尔顿(Jill Shingleton)编著 2019
- 《指向核心素养 北京十一学校名师教学设计 英语 七年级 上 配人教版》周志英总主编 2019
- 《《走近科学》精选丛书 中国UFO悬案调查》郭之文 2019
- 《北京生态环境保护》《北京环境保护丛书》编委会编著 2018
- 《中医骨伤科学》赵文海,张俐,温建民著 2017
- 《美国小学分级阅读 二级D 地球科学&物质科学》本书编委会 2016
- 《指向核心素养 北京十一学校名师教学设计 英语 九年级 上 配人教版》周志英总主编 2019
- 《强磁场下的基础科学问题》中国科学院编 2020
- 《小牛顿科学故事馆 进化论的故事》小牛顿科学教育公司编辑团队 2018
- 《小牛顿科学故事馆 医学的故事》小牛顿科学教育公司编辑团队 2018
- 《高等院校旅游专业系列教材 旅游企业岗位培训系列教材 新编北京导游英语》杨昆,鄢莉,谭明华 2019