Opencl SYCL Provisional Specification

Total Page:16

File Type:pdf, Size:1020Kb

Opencl SYCL Provisional Specification 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 . ..
Recommended publications
  • GLSL 4.50 Spec
    The OpenGL® Shading Language Language Version: 4.50 Document Revision: 7 09-May-2017 Editor: John Kessenich, Google Version 1.1 Authors: John Kessenich, Dave Baldwin, Randi Rost Copyright (c) 2008-2017 The Khronos Group Inc. All Rights Reserved. This specification is protected by copyright laws and contains material proprietary to the Khronos Group, Inc. It or any components may not be reproduced, republished, distributed, transmitted, displayed, broadcast, or otherwise exploited in any manner without the express prior written permission of Khronos Group. You may use this specification for implementing the functionality therein, without altering or removing any trademark, copyright or other notice from the specification, but the receipt or possession of this specification does not convey any rights to reproduce, disclose, or distribute its contents, or to manufacture, use, or sell anything that it may describe, in whole or in part. Khronos Group grants express permission to any current Promoter, Contributor or Adopter member of Khronos to copy and redistribute UNMODIFIED versions of this specification in any fashion, provided that NO CHARGE is made for the specification and the latest available update of the specification for any version of the API is used whenever possible. Such distributed specification may be reformatted AS LONG AS the contents of the specification are not changed in any way. The specification may be incorporated into a product that is sold as long as such product includes significant independent work developed by the seller. A link to the current version of this specification on the Khronos Group website should be included whenever possible with specification distributions.
    [Show full text]
  • GLSL Specification
    The OpenGL® Shading Language Language Version: 4.60 Document Revision: 3 23-Jul-2017 Editor: John Kessenich, Google Version 1.1 Authors: John Kessenich, Dave Baldwin, Randi Rost Copyright (c) 2008-2017 The Khronos Group Inc. All Rights Reserved. This specification is protected by copyright laws and contains material proprietary to the Khronos Group, Inc. It or any components may not be reproduced, republished, distributed, transmitted, displayed, broadcast, or otherwise exploited in any manner without the express prior written permission of Khronos Group. You may use this specification for implementing the functionality therein, without altering or removing any trademark, copyright or other notice from the specification, but the receipt or possession of this specification does not convey any rights to reproduce, disclose, or distribute its contents, or to manufacture, use, or sell anything that it may describe, in whole or in part. Khronos Group grants express permission to any current Promoter, Contributor or Adopter member of Khronos to copy and redistribute UNMODIFIED versions of this specification in any fashion, provided that NO CHARGE is made for the specification and the latest available update of the specification for any version of the API is used whenever possible. Such distributed specification may be reformatted AS LONG AS the contents of the specification are not changed in any way. The specification may be incorporated into a product that is sold as long as such product includes significant independent work developed by the seller. A link to the current version of this specification on the Khronos Group website should be included whenever possible with specification distributions.
    [Show full text]
  • The Opencl Specification
    The OpenCL Specification Version: 2.0 Document Revision: 22 Khronos OpenCL Working Group Editor: Aaftab Munshi Last Revision Date: 3/18/14 Page 1 1. INTRODUCTION ............................................................................................................... 10 2. GLOSSARY ......................................................................................................................... 12 3. THE OPENCL ARCHITECTURE .................................................................................... 23 3.1 Platform Model ................................................................................................................................ 23 3.2 Execution Model .............................................................................................................................. 25 3.2.1 Execution Model: Mapping work-items onto an NDRange ........................................................................28 3.2.2 Execution Model: Execution of kernel-instances ........................................................................................30 3.2.3 Execution Model: Device-side enqueue ......................................................................................................31 3.2.4 Execution Model: Synchronization .............................................................................................................32 3.2.5 Execution Model: Categories of Kernels ....................................................................................................33 3.3 Memory
    [Show full text]
  • Khronos Native Platform Graphics Interface (EGL Version 1.4 - April 6, 2011)
    Khronos Native Platform Graphics Interface (EGL Version 1.4 - April 6, 2011) Editor: Jon Leech 2 Copyright (c) 2002-2011 The Khronos Group Inc. All Rights Reserved. This specification is protected by copyright laws and contains material proprietary to the Khronos Group, Inc. It or any components may not be reproduced, repub- lished, distributed, transmitted, displayed, broadcast or otherwise exploited in any manner without the express prior written permission of Khronos Group. You may use this specification for implementing the functionality therein, without altering or removing any trademark, copyright or other notice from the specification, but the receipt or possession of this specification does not convey any rights to reproduce, disclose, or distribute its contents, or to manufacture, use, or sell anything that it may describe, in whole or in part. Khronos Group grants express permission to any current Promoter, Contributor or Adopter member of Khronos to copy and redistribute UNMODIFIED versions of this specification in any fashion, provided that NO CHARGE is made for the specification and the latest available update of the specification for any version of the API is used whenever possible. Such distributed specification may be re- formatted AS LONG AS the contents of the specification are not changed in any way. The specification may be incorporated into a product that is sold as long as such product includes significant independent work developed by the seller. A link to the current version of this specification on the Khronos Group web-site should be included whenever possible with specification distributions. Khronos Group makes no, and expressly disclaims any, representations or war- ranties, express or implied, regarding this specification, including, without limita- tion, any implied warranties of merchantability or fitness for a particular purpose or non-infringement of any intellectual property.
    [Show full text]
  • 모바일 그래픽스 라이브러리들: 크로노스 그룹의 표준을 중심으로 Mobile Graphics Libraries: Focusing on the Standards from Khronos Group
    50 한국콘텐츠학회 제8권 제2호 모바일 그래픽스 라이브러리들: 크로노스 그룹의 표준을 중심으로 Mobile Graphics Libraries: focusing on the standards from Khronos Group 백낙훈 (경북대학교), 이환용 (㈜휴원 CTO, 경북대학교 박사과정) 차 례 1. 서론 2. OpenGL ES 3. OpenGL SC 4. OpenVG 5. 결론 1. 서론 전력 소모가 낮은 기기를 채택할 수 밖에 없는 것이다. 액정뿐만 아니라, 모든 컴퓨팅 자원들이 궁극적으로 전 컴퓨터는 그 출현 이후, 계속해서 그 크기를 줄여 왔고, 력 문제에 민감하여야 하고, 이 때문에, 제한된 기능만을 현재는 휴대폰, 네비게이터, 휴대용 게임기 등의 형태로 제공할 수 밖에 없는 상황이다. 모바일 컴퓨팅 환경을 제공하고 있다. 모바일 컴퓨팅 환 경의 대두와 함께, 이를 이용한 그래픽스 출력이 요구되 었고, 모바일 환경에서의 그래픽스 기능을 의미하는, 모 바일 그래픽스 환경이 구축되었다. 이 글에서는 현재의 모바일 그래픽스 환경 중에서도 특히 표준 라이브러리들 에 대해 이야기하고자 한다. 지난 10여년 사이에 모바일 그래픽스 분야는 눈부신 발전을 이루었다. 가장 대표적 인 기기인 휴대폰을 기준으로 본다면, 최초에 나온, 저해 상도에 흑백의 투박한 액정을 가진 모델이 불과 몇 년 사 이에 상당한 수준의 컬러 액정을 가진 제품으로 변했고, 3차원 그래픽스를 지원하는 특별한 하드웨어 칩들을 사 (a) 저해상도 2D (b) 3D 용하는 것도 이상하지 않은 상황이 되었다. 이에 따라, 소프트웨어 기술들도 눈부시게 발전하여, 그림 1에서 보 는 바와 같이, 2차원 저해상도에서 3차원 화면을 거쳐, 거의 PC 화면에 필적하는 수준의 고해상도 3차원 화면 이 급속히 사용되고 있다. 모바일 그래픽스 환경은 태생 상, 기존의 데스크 탑 또는 그 이상의 고급 기종들에 비 해, 상대적으로 열등한 하드웨어 환경을 제공할 수 밖에 없다. 가장 문제가 되는 것은 제한된 용량의 전원, 즉 배 터리의 수명을 고려해야 한다는 점이다. PC급의 고해상 (c) 하드웨어로 가속되는 3D 도 액정이 기술적으로 문제가 있는 것이 아니라, 채택하 ▶▶ 그림 1.
    [Show full text]
  • The Opengl ES Shading Language
    The OpenGL ES® Shading Language Language Version: 3.20 Document Revision: 12 246 JuneAugust 2015 Editor: Robert J. Simpson, Qualcomm OpenGL GLSL editor: John Kessenich, LunarG GLSL version 1.1 Authors: John Kessenich, Dave Baldwin, Randi Rost 1 Copyright (c) 2013-2015 The Khronos Group Inc. All Rights Reserved. This specification is protected by copyright laws and contains material proprietary to the Khronos Group, Inc. It or any components may not be reproduced, republished, distributed, transmitted, displayed, broadcast, or otherwise exploited in any manner without the express prior written permission of Khronos Group. You may use this specification for implementing the functionality therein, without altering or removing any trademark, copyright or other notice from the specification, but the receipt or possession of this specification does not convey any rights to reproduce, disclose, or distribute its contents, or to manufacture, use, or sell anything that it may describe, in whole or in part. Khronos Group grants express permission to any current Promoter, Contributor or Adopter member of Khronos to copy and redistribute UNMODIFIED versions of this specification in any fashion, provided that NO CHARGE is made for the specification and the latest available update of the specification for any version of the API is used whenever possible. Such distributed specification may be reformatted AS LONG AS the contents of the specification are not changed in any way. The specification may be incorporated into a product that is sold as long as such product includes significant independent work developed by the seller. A link to the current version of this specification on the Khronos Group website should be included whenever possible with specification distributions.
    [Show full text]
  • Introduction to Opencl Adaptation and Diffusion Strictly Forbidden Without Acsys Written Agreement Written Acsys Without Forbidden Strictly Diffusion and Adaptation
    Introduction to OpenCL Adaptation and diffusion strictly forbidden without Acsys written agreement written Acsys without forbidden strictly diffusion and Adaptation RTS 2013 April 11th 2013 training This lecture is brought to you by Bernard Dautrevaux Chief Technical Officer – Ac6 Alumni of École Normale Supérieure (ENS Cachan) Master of Mathematics Master of Computer Science University of Paris, Orsay Should you have any question later on feel free to contact me at Adaptation and diffusion strictly forbidden without Acsys written agreement written Acsys without forbidden strictly diffusion and Adaptation mailto:[email protected] You could also find more information on our web site: http://www.ac6.fr or http://www.ac6-training.com training Page 1 Agenda Why OpenCL? The Goals of OpenCL Overview Adaptation and diffusion strictly forbidden without Acsys written agreement written Acsys without forbidden strictly diffusion and Adaptation The OpenCL Language OpenCL Implementations training Page 2 Why OpenCL? Adaptation and diffusion strictly forbidden without Acsys written agreement written Acsys without forbidden strictly diffusion and Adaptation training Processor Parallelism CPUs GPUs Multiple cores Increasingly general provides increased Emerging purpose data-parallel performance Intersection computing Adaptation and diffusion strictly forbidden without Acsys written agreement written Acsys without forbidden strictly diffusion and Adaptation Multiprocessor Heteregeneous Graphics APIs and programming Computing Shading Languages (for example OpenMP) OpenCL is a programming framework for heterogeneous computing resources training Page 4 Original graphics design from The Khronos Group The Origins of OpenCL AMD Ericsson Merged, needed Nokia commonality across products IBM ATI Sony EA Freescale GPU vendor, wants TI Nvidia to steal market share from CPU vendors Wrote a rough draft, STM straw man API ..
    [Show full text]
  • News Release for More Information: Neil Trevett, President, Khronos | [email protected] | Phone: +1 (408) 464 7053
    News Release For more information: Neil Trevett, President, Khronos | [email protected] | Phone: +1 (408) 464 7053 Khronos Releases OpenVX 1.1 Specification for High Performance, Low Power Computer Vision Acceleration Expanded range of processing functions; Enhanced flexibility for data access and processing; Full conformance tests available; Safety Critical specification in development May 2nd 2016 – Embedded Vision Summit, Santa Clara, CA – The Khronos™ Group, an open consortium of leading hardware and software companies, announces the immediate availability of the OpenVX™ 1.1 specification for cross platform acceleration of computer vision applications and libraries. OpenVX enables performance and power optimized computer vision algorithms for use cases such as face, body and gesture tracking, smart video surveillance, automatic driver assistance systems, object and scene reconstruction, augmented reality, visual inspection, robotics and more. Conformant OpenVX 1.0 implementations and tools are shipping from AMD, Imagination, Intel, NVIDIA, Synopsis and VeriSilicon. OpenVX 1.1 builds on this momentum by adding new processing functions for use cases such as computational photography, and enhances application control over how data is accessed and processed. An open source OpenVX 1.1 sample implementation and full conformance tests will be available before mid-2016. Details on the OpenVX specifications and Adopters Program are available at: www.khronos.org/openvx. “More and more products are incorporating computer vision, and OpenVX
    [Show full text]
  • Brad Biddle, Andrew White and Sean Woods Arizona State Universi
    HOW MANY STANDARDS IN A LAPTOP? (AND OTHER EMPIRICAL QUESTIONS) Brad Biddle, Andrew White and Sean Woods Arizona State University Sandra Day O’Connor College of Law ABSTRACT omissions. Accordingly, we believe our count sets only a floor: a modern laptop embodies or utilizes at least An empirical study which identifies 251 technical 251 interoperability standards, but the actual number is interoperability standards implemented in a modern laptop certainly much higher (the authors would be computer, and estimates that the total number of standards unsurprised by a total number of 500 or more). relevant to such a device is much higher. Of the identified Including other types of relevant standards, such as standards, the authors find that 44% were developed by environmental or safety standards, in addition to consortia, 36% by formal standards development interoperability standards would further raise the count organizations, and 20% by single companies. The dramatically. intellectual property rights policies associated with 197 of • Of the 251 standards we identified, 112 (44%) were the standards are assessed: 75% were developed under developed by consortia, 90 (36%) by formal standards “RAND” terms, 22% under “royalty free” terms, and 3% development organizations, and 49 (20%) by individual utilize a patent pool. The authors make certain companies (see Figure 1). observations based on their findings, and identify promising areas for future research. • We were able to allocate 197 of the 251 standards into one of three broad intellectual property model Keywords— standards, SDOs, consortia, intellectual categories: RAND, RF or patent pool (we lacked property rights (IPR), RAND, royalty free sufficient information to categorize the remaining 54 standards).
    [Show full text]
  • Khronos Group SYCL 1.2.1 Specification
    SYCL™ Specification SYCL™ integrates OpenCL™ devices with modern C++ Version 1.2.1 Document Revision: 6 Revision Date: May 14, 2019 Git revision: heads/travis-0-g4f9a12d-dirty Khronos® OpenCL™ Working Group — SYCL™ subgroup Editors: Ronan Keryell, Maria Rovatsou & Lee Howes Copyright 2011-2019 The Khronos® Group Inc. All Rights Reserved SYCL 1.2.1 Copyright© 2013-2019 The Khronos® Group Inc. All Rights Reserved. This specification is protected by copyright laws and contains material proprietary to the Khronos® Group, Inc. It or any components may not be reproduced, republished, distributed, transmitted, displayed, broadcast, or other- wise exploited in any manner without the express prior written permission of Khronos® Group. You may use this specification for implementing the functionality therein, without altering or removing any trademark, copyright or other notice from the specification, but the receipt or possession of this specification does not convey any rights to reproduce, disclose, or distribute its contents, or to manufacture, use, or sell anything that it may describe, in whole or in part. Khronos® Group grants express permission to any current Promoter, Contributor or Adopter member of Khronos® to copy and redistribute UNMODIFIED versions of this specification in any fashion, provided that NO CHARGE is made for the specification and the latest available update of the specification for any version of the API is used whenever possible. Such distributed specification may be reformatted AS LONG AS the contents of the specification are not changed in any way. The specification may be incorporated into a product that is sold as long as such product includes significant independent work developed by the seller.
    [Show full text]
  • Opencl™ ICD Installation Guidelines
    OpenCL™ ICD Installation Guidelines Khronos® OpenCL Working Group Version V2.2-11, Fri, 19 Jul 2019 14:14:09 +0000 Table of Contents 1. Introduction. 2 2. General Guidelines. 3 2.1. Compatibility With Non-ICD implementations . 3 3. Windows ICD Installation and Uninstallation. 4 3.1. Windows ICD Installation. 4 3.2. Windows ICD Uninstallation . 5 3.3. OpenCL.dll Versioning . 5 4. Android ICD Installation. 6 4.1. Target Device Filesystem . 6 4.2. Android SDK/NDK. 6 Copyright 2008-2019 The Khronos Group. This specification is protected by copyright laws and contains material proprietary to the Khronos Group, Inc. Except as described by these terms, it or any components may not be reproduced, republished, distributed, transmitted, displayed, broadcast or otherwise exploited in any manner without the express prior written permission of Khronos Group. Khronos Group grants a conditional copyright license to use and reproduce the unmodified specification for any purpose, without fee or royalty, EXCEPT no licenses to any patent, trademark or other intellectual property rights are granted under these terms. Parties desiring to implement the specification and make use of Khronos trademarks in relation to that implementation, and receive reciprocal patent license protection under the Khronos IP Policy must become Adopters and confirm the implementation as conformant under the process defined by Khronos for this specification; see https://www.khronos.org/adopters. Khronos Group makes no, and expressly disclaims any, representations or warranties, express or implied, regarding this specification, including, without limitation: merchantability, fitness for a particular purpose, non-infringement of any intellectual property, correctness, accuracy, completeness, timeliness, and reliability.
    [Show full text]
  • The Opengl ES Shading Language
    The OpenGL ES® Shading Language Language Version: 3.00 Document Revision: 4 6 March 2013 Editor: Robert J. Simpson, Qualcomm OpenGL GLSL editor: John Kessenich, LunarG GLSL version 1.1 Authors: John Kessenich, Dave Baldwin, Randi Rost Copyright (c) 2008-2013 The Khronos Group Inc. All Rights Reserved. This specification is protected by copyright laws and contains material proprietary to the Khronos Group, Inc. It or any components may not be reproduced, republished, distributed, transmitted, displayed, broadcast or otherwise exploited in any manner without the express prior written permission of Khronos Group. You may use this specification for implementing the functionality therein, without altering or removing any trademark, copyright or other notice from the specification, but the receipt or possession of this specification does not convey any rights to reproduce, disclose, or distribute its contents, or to manufacture, use, or sell anything that it may describe, in whole or in part. Khronos Group grants express permission to any current Promoter, Contributor or Adopter member of Khronos to copy and redistribute UNMODIFIED versions of this specification in any fashion, provided that NO CHARGE is made for the specification and the latest available update of the specification for any version of the API is used whenever possible. Such distributed specification may be re-formatted AS LONG AS the contents of the specification are not changed in any way. The specification may be incorporated into a product that is sold as long as such product includes significant independent work developed by the seller. A link to the current version of this specification on the Khronos Group web-site should be included whenever possible with specification distributions.
    [Show full text]