Download OpenCL™ Optimization Guide
Transcript
Legal Information Wrapping the Right Set of Operations ...................................................................... 45 Profiling Operations Using OpenCL™ Profiling Events .......................................................... 46 Comparing OpenCL™ Kernel Performance with Performance of Native Code .......................... 47 Getting Credible Performance Numbers ............................................................................. 47 Using Tools.................................................................................................................... 48 Using Multiple OpenCL™ Devices ........................................................................................ 50 Using Shared Context for Multiple OpenCL™ Devices .......................................................... 50 Sharing Resources Efficiently ........................................................................................... 50 Synchronization Caveats ................................................................................................. 51 Writing to a Shared Resource .......................................................................................... 52 Partitioning the Work ...................................................................................................... 53 Keeping Kernel Sources the Same .................................................................................... 54 Basic Frequency Considerations ....................................................................................... 54 Eliminating Device Starvation .......................................................................................... 55 Limitations of Shared Context with Respect to Extensions ................................................... 55 Coding for the Intel® CPU OpenCL™ Device ........................................................................ 56 Vectorization Basics for Intel® Architecture Processors ....................................................... 56 Benefitting From Implicit Vectorization .............................................................................. 57 Vectorizer Knobs ............................................................................................................ 57 Using Vector Data Types ................................................................................................. 58 Writing Kernels to Directly Target the Intel® Architecture Processors ................................... 59 Work-Group Size Considerations ...................................................................................... 61 Work-Group Level Parallelism .......................................................................................... 61 OpenCL™ Kernel Development for Intel® CPU OpenCL™ device .......................................... 62 Why Optimizing Kernel Code Is Important? ....................................................................... 62 Avoid Spurious Operations in Kernel Code ......................................................................... 62 Perform Initialization in a Separate Task ........................................................................... 63 Use Preprocessor for Constants ........................................................................................ 64 Use Signed Integer Data Types ........................................................................................ 65 Use Row-Wise Data Accesses ........................................................................................... 65 Tips for Auto-Vectorization .............................................................................................. 66 Local Memory Usage ....................................................................................................... 68 Avoid Extracting Vector Components ................................................................................ 68 Task-Parallel Programming Model Hints............................................................................. 69 3