
SYCLTM Specification SYCL integrates OpenCL devices with modern C++ Version 1.2 Revision Date: 2015-05-08 Khronos OpenCL Working Group — SYCL subgroup Editors: Lee Howes and Maria Rovatsou Copyright 2011-2015 The Khronos Group Inc. All Rights Reserved Contents 1 Introduction 11 2 SYCL Architecture 13 2.1 Overview . 13 2.2 The SYCL Platform Model . 13 2.2.1 Platform Mixed Version Support . 14 2.3 SYCL Execution Model . 14 2.3.1 Execution Model: Queues, Command Groups and Contexts . 15 2.4 Memory Model . 16 2.4.1 Access to memory . 17 2.4.2 Memory consistency . 18 2.4.3 Atomic operations . 18 2.5 The SYCL programming model . 18 2.5.1 Basic data parallel kernels . 19 2.5.2 Work-group data parallel kernels . 19 2.5.3 Hierarchical data parallel kernels . 19 2.5.4 Kernels that are not launched over parallel instances . 20 2.5.5 Synchronization . 20 2.5.6 Error handling . 21 2.5.7 Scheduling of kernels and data movement . 21 2.5.8 Managing object lifetimes . 23 2.5.9 Device discovery and selection . 24 2.5.10 Interfacing with OpenCL . 24 2.6 Anatomy of a SYCL application . 26 2.7 Memory objects . 27 2.8 SYCL for OpenCL Framework . 28 2.9 SYCL device compiler . 29 2.9.1 Building a SYCL program . 29 2.9.2 Naming of kernels . 29 2.10 Language restrictions in kernels . 30 2.10.1 SYCL Linker . 30 2.10.2 Functions and datatypes available in kernels . 31 2.11 Execution of kernels on the SYCL host device . 31 2.12 Example SYCL application . 31 3 SYCL Programming Interface 34 3.1 Header files and namespaces . 34 3.2 C++ Standard library classes required for the interface . 34 3.3 SYCL runtime classes . 35 3.3.1 Device selection class . 35 3.3.2 Platform class . 37 3.3.2.1 Platform information descriptors . 39 3.3.3 Context class . 39 1 3.3.3.1 Context interface . 40 3.3.3.2 Context information descriptors . 42 3.3.4 Device class . 42 3.3.4.1 Device interface . 43 3.3.4.2 Device information descriptors . 45 3.3.5 Queue class . 55 3.3.5.1 Queue interface . 55 3.3.5.2 Queue information descriptors . 59 3.3.5.3 Queue error handling . 60 3.3.6 Event class for OpenCL interoperability . 60 3.3.6.1 Event information and profiling descriptors . 62 3.4 Data access and storage in SYCL . 64 3.4.1 Host allocation . 64 3.4.1.1 Default Allocators . 64 3.4.1.2 Map Allocator . 65 3.4.2 Buffers . 65 3.4.2.1 Buffer Interface . 66 3.4.2.2 Buffer Synchronization Rules . 69 3.4.3 Images . 71 3.4.3.1 Image Interface . 71 3.4.3.2 Image Synchronization Rules . 75 3.4.4 Sharing Host Memory With The SYCL Data Management Classes . 75 3.4.4.1 Default behavior . 76 3.4.4.2 SYCL ownership of the host memory . 76 3.4.4.3 Shared SYCL ownership of the host memory . 77 3.4.5 Synchronisation Primitives . 77 3.4.6 Accessors . 78 3.4.6.1 Access modes . 78 3.4.6.2 Access targets . 79 3.4.6.3 Accessor class . 79 3.4.6.4 Buffer accessors . 84 3.4.6.5 Image accessors . 85 3.4.6.6 Local accessors . 85 3.4.6.7 Host accessors . 85 3.4.6.8 Accessor capabilities and restrictions . 86 3.4.7 Address space classes . 88 3.4.7.1 Explicit pointer classes . 88 3.4.7.2 Multi-pointer class . 97 3.4.8 Samplers . 102 3.5 Expressing parallelism through kernels . 103 3.5.1 Ranges and index space identifiers . 103 3.5.1.1 range class . 103 3.5.1.2 nd_range class . 108 3.5.1.3 id class . 109 3.5.1.4 item class . 114 3.5.1.5 nd_item class . 115 3.5.1.6 group class . 117 3.5.2 Command group scope . 118 3.5.3 SYCL functions for invoking kernels . 119 3.5.3.1 single_task invoke ............................... 119 3.5.3.2 parallel_for invoke .............................. 120 3.5.3.3 Parallel For hierarchical invoke . 122 3.5.3.4 Command group handler class . 124 3.5.4 Kernel class . 128 3.5.5 Program class . ..
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages206 Page
-
File Size-