一个源到源CUDA到SYCL代码迁移工具:英特尔®dpc++兼容性工具

Zhiming Wang, Yury Plyakhin, Chenwei Sun, Ziran Zhang, Z. Jiang, Andy Huang, Hao Wang
{"title":"一个源到源CUDA到SYCL代码迁移工具:英特尔®dpc++兼容性工具","authors":"Zhiming Wang, Yury Plyakhin, Chenwei Sun, Ziran Zhang, Z. Jiang, Andy Huang, Hao Wang","doi":"10.1145/3529538.3529562","DOIUrl":null,"url":null,"abstract":"oneAPI [1] is an industry initiative creating an open, standards-based, cross-architecture programming model to simplify development for a wide range of data-centric workloads across a variety of architectures including CPU, GPU, FPGA, and other accelerators. It includes a cross-architecture compiler, Data Parallel C++ (DPC++), [2] to support ISO C++ and Khronos Group's SYCL [3] and advanced libraries. Intel has created a product implementation of oneAPI with the Intel oneAPI Toolkits. These help developers efficiently build, analyze, and optimize high-performance, cross-architecture applications for CPUs, GPUs, and FPGAs. SYCL [3] is an open standard from Khronos for a portable, architecture-neutral language for expressing parallelism. The SYCL specification can be implemented by anybody for any platform. To take advantage of oneAPI and SYCL, for applications written in another language e.g., CUDA, developers seek to migrate existing code to SYCL. Once a customer migrates their code to SYCL, they are no longer tied to a single platform and can run the code on any platform that has SYCL compiler support. Intel® DPC++ Compatibility Tool is included in the Intel® oneAPI Base Toolkit, it is a tool that assists developers to do source-to-source migration, e.g., migrate code written in CUDA to SYCL code [3] to enable their code to run on multiple platforms. The tool generates human readable and maintainable code whenever possible and provides inline comments to help developers complete their code. Typically, about 90-95% of CUDA code in applications can be migrated by this tool.1 Completion of the code and verification of the final code is expected to be a manual process done by the developers. The goal of the compatibility tool is to make it as easy as possible for developers to migrate their existing CUDA codebase to SYCL to facilitate more hardware choices and access to the advantages of oneAPI and SYCL. The compatibility tool is based on LLVM/Clang [4]. It mainly contains 3 functional components: • The intercept-build tool: It is used to collect compilation options of the user input project by intercepting build process of user input project, like build option, macro definitions, include folders and so on information. During source-to-source migration, those compilation options are used to identify the active code path, header files dependencies to build a right abstract syntax tree for the user input project. • The ‘dpct’ binary tool: The tool is the main migration tool, which does source-to-source migration based on compiler front end technology. It implements a set of migration rules to migrate source language elements like types, APIs, macros to functionally compatible elements in target language. If some C/C++ code is the same between source and target language, then the tool keeps this C/C++ code unchanged. Also, the tool provides a way to let users define migration rules by themselves in migration rule description file to guide a customized migration. • Helper header library: It provides helper functions and macros to assist the migration of input source code. These header files written in C/C++/SYCL are intended to become part of migrated code generated by the compatibility tool. User can copy these header files if needed and include them with the generated code. The compatibility tool can assist developers to migrate code written in CUDA to code written in SYCL with proper performance, minimizing developer's efforts. The tool can enrich the oneAPI ecosystem by assisting developers in migration of more applications to SYCL running on oneAPI. Notices & Disclaimers Intel technologies may require enabled hardware, software or service activation. No product or component can be absolutely secure. Your costs and results may vary. © Intel Corporation. Intel, the Intel logo, and other Intel marks are trademarks of Intel Corporation or its subsidiaries. Other names and brands may be claimed as the property of others.","PeriodicalId":73497,"journal":{"name":"International Workshop on OpenCL","volume":null,"pages":null},"PeriodicalIF":0.0000,"publicationDate":"2022-05-10","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"5","resultStr":"{\"title\":\"A source-to-source CUDA to SYCL code migration tool: Intel® DPC++ Compatibility Tool\",\"authors\":\"Zhiming Wang, Yury Plyakhin, Chenwei Sun, Ziran Zhang, Z. Jiang, Andy Huang, Hao Wang\",\"doi\":\"10.1145/3529538.3529562\",\"DOIUrl\":null,\"url\":null,\"abstract\":\"oneAPI [1] is an industry initiative creating an open, standards-based, cross-architecture programming model to simplify development for a wide range of data-centric workloads across a variety of architectures including CPU, GPU, FPGA, and other accelerators. It includes a cross-architecture compiler, Data Parallel C++ (DPC++), [2] to support ISO C++ and Khronos Group's SYCL [3] and advanced libraries. Intel has created a product implementation of oneAPI with the Intel oneAPI Toolkits. These help developers efficiently build, analyze, and optimize high-performance, cross-architecture applications for CPUs, GPUs, and FPGAs. SYCL [3] is an open standard from Khronos for a portable, architecture-neutral language for expressing parallelism. The SYCL specification can be implemented by anybody for any platform. To take advantage of oneAPI and SYCL, for applications written in another language e.g., CUDA, developers seek to migrate existing code to SYCL. Once a customer migrates their code to SYCL, they are no longer tied to a single platform and can run the code on any platform that has SYCL compiler support. Intel® DPC++ Compatibility Tool is included in the Intel® oneAPI Base Toolkit, it is a tool that assists developers to do source-to-source migration, e.g., migrate code written in CUDA to SYCL code [3] to enable their code to run on multiple platforms. The tool generates human readable and maintainable code whenever possible and provides inline comments to help developers complete their code. Typically, about 90-95% of CUDA code in applications can be migrated by this tool.1 Completion of the code and verification of the final code is expected to be a manual process done by the developers. The goal of the compatibility tool is to make it as easy as possible for developers to migrate their existing CUDA codebase to SYCL to facilitate more hardware choices and access to the advantages of oneAPI and SYCL. The compatibility tool is based on LLVM/Clang [4]. It mainly contains 3 functional components: • The intercept-build tool: It is used to collect compilation options of the user input project by intercepting build process of user input project, like build option, macro definitions, include folders and so on information. During source-to-source migration, those compilation options are used to identify the active code path, header files dependencies to build a right abstract syntax tree for the user input project. • The ‘dpct’ binary tool: The tool is the main migration tool, which does source-to-source migration based on compiler front end technology. It implements a set of migration rules to migrate source language elements like types, APIs, macros to functionally compatible elements in target language. If some C/C++ code is the same between source and target language, then the tool keeps this C/C++ code unchanged. Also, the tool provides a way to let users define migration rules by themselves in migration rule description file to guide a customized migration. • Helper header library: It provides helper functions and macros to assist the migration of input source code. These header files written in C/C++/SYCL are intended to become part of migrated code generated by the compatibility tool. User can copy these header files if needed and include them with the generated code. The compatibility tool can assist developers to migrate code written in CUDA to code written in SYCL with proper performance, minimizing developer's efforts. The tool can enrich the oneAPI ecosystem by assisting developers in migration of more applications to SYCL running on oneAPI. Notices & Disclaimers Intel technologies may require enabled hardware, software or service activation. No product or component can be absolutely secure. Your costs and results may vary. © Intel Corporation. Intel, the Intel logo, and other Intel marks are trademarks of Intel Corporation or its subsidiaries. Other names and brands may be claimed as the property of others.\",\"PeriodicalId\":73497,\"journal\":{\"name\":\"International Workshop on OpenCL\",\"volume\":null,\"pages\":null},\"PeriodicalIF\":0.0000,\"publicationDate\":\"2022-05-10\",\"publicationTypes\":\"Journal Article\",\"fieldsOfStudy\":null,\"isOpenAccess\":false,\"openAccessPdf\":\"\",\"citationCount\":\"5\",\"resultStr\":null,\"platform\":\"Semanticscholar\",\"paperid\":null,\"PeriodicalName\":\"International Workshop on OpenCL\",\"FirstCategoryId\":\"1085\",\"ListUrlMain\":\"https://doi.org/10.1145/3529538.3529562\",\"RegionNum\":0,\"RegionCategory\":null,\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"\",\"PubModel\":\"\",\"JCR\":\"\",\"JCRName\":\"\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"International Workshop on OpenCL","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1145/3529538.3529562","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 5

摘要

oneAPI[1]是一项行业倡议,它创建了一个开放的、基于标准的、跨架构的编程模型,以简化跨各种架构(包括CPU、GPU、FPGA和其他加速器)的广泛数据中心工作负载的开发。它包括一个跨架构编译器,Data Parallel c++ (dpc++)[2],以支持ISO c++和Khronos Group的SYCL[3]和高级库。英特尔已经通过英特尔oneAPI工具包创建了一个oneAPI的产品实现。这些帮助开发人员高效地构建、分析和优化针对cpu、gpu和fpga的高性能、跨架构应用程序。SYCL[3]是来自Khronos的一个开放标准,用于表达并行性的可移植的、与体系结构无关的语言。任何人都可以在任何平台上实现SYCL规范。为了利用一个api和SYCL,对于用另一种语言(例如CUDA)编写的应用程序,开发人员寻求将现有代码迁移到SYCL。一旦客户将其代码迁移到SYCL,他们就不再受限于单一平台,可以在任何具有SYCL编译器支持的平台上运行代码。英特尔®dpc++兼容性工具包含在英特尔®oneAPI基础工具包中,它是一个帮助开发人员进行源到源迁移的工具,例如,将用CUDA编写的代码迁移到SYCL代码[3],以使他们的代码能够在多个平台上运行。该工具在可能的情况下生成人类可读和可维护的代码,并提供内联注释来帮助开发人员完成他们的代码。通常,应用程序中大约90-95%的CUDA代码可以通过该工具迁移1代码的完成和最终代码的验证预计将由开发人员手动完成。兼容性工具的目标是使开发人员尽可能容易地将他们现有的CUDA代码库迁移到SYCL,以方便更多的硬件选择,并访问oneAPI和SYCL的优势。兼容性工具基于LLVM/Clang[4]。它主要包含3个功能组件:•拦截构建工具:通过拦截用户输入项目的构建过程,收集用户输入项目的编译选项,如构建选项、宏定义、包含文件夹等信息。在源到源迁移期间,这些编译选项用于标识活动代码路径、头文件依赖项,以便为用户输入项目构建正确的抽象语法树。•“dpct”二进制工具:该工具是主要的迁移工具,它基于编译器前端技术进行源代码到源代码的迁移。它实现了一组迁移规则,将源语言元素(如类型、api、宏)迁移到目标语言中功能兼容的元素。如果某些C/ c++代码在源语言和目标语言之间是相同的,那么该工具将保持该C/ c++代码不变。此外,该工具还提供了一种方法,允许用户在迁移规则描述文件中自行定义迁移规则,以指导自定义的迁移。•Helper头库:它提供了帮助函数和宏来帮助输入源代码的迁移。这些用C/ c++ /SYCL编写的头文件旨在成为由兼容性工具生成的迁移代码的一部分。如果需要,用户可以复制这些头文件,并将它们包含在生成的代码中。兼容性工具可以帮助开发人员以适当的性能将用CUDA编写的代码迁移到用SYCL编写的代码,从而最大限度地减少开发人员的工作量。该工具可以通过帮助开发人员将更多应用程序迁移到运行在oneAPI上的SYCL来丰富oneAPI生态系统。英特尔技术可能需要启用硬件、软件或服务激活。没有任何产品或组件是绝对安全的。您的成本和结果可能会有所不同。©英特尔公司。“英特尔”、“英特尔”标识和其他“英特尔”标志均为“英特尔公司”或其子公司的商标。其他名称和品牌可以主张为他人的财产。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
查看原文
分享 分享
微信好友 朋友圈 QQ好友 复制链接
本刊更多论文
A source-to-source CUDA to SYCL code migration tool: Intel® DPC++ Compatibility Tool
oneAPI [1] is an industry initiative creating an open, standards-based, cross-architecture programming model to simplify development for a wide range of data-centric workloads across a variety of architectures including CPU, GPU, FPGA, and other accelerators. It includes a cross-architecture compiler, Data Parallel C++ (DPC++), [2] to support ISO C++ and Khronos Group's SYCL [3] and advanced libraries. Intel has created a product implementation of oneAPI with the Intel oneAPI Toolkits. These help developers efficiently build, analyze, and optimize high-performance, cross-architecture applications for CPUs, GPUs, and FPGAs. SYCL [3] is an open standard from Khronos for a portable, architecture-neutral language for expressing parallelism. The SYCL specification can be implemented by anybody for any platform. To take advantage of oneAPI and SYCL, for applications written in another language e.g., CUDA, developers seek to migrate existing code to SYCL. Once a customer migrates their code to SYCL, they are no longer tied to a single platform and can run the code on any platform that has SYCL compiler support. Intel® DPC++ Compatibility Tool is included in the Intel® oneAPI Base Toolkit, it is a tool that assists developers to do source-to-source migration, e.g., migrate code written in CUDA to SYCL code [3] to enable their code to run on multiple platforms. The tool generates human readable and maintainable code whenever possible and provides inline comments to help developers complete their code. Typically, about 90-95% of CUDA code in applications can be migrated by this tool.1 Completion of the code and verification of the final code is expected to be a manual process done by the developers. The goal of the compatibility tool is to make it as easy as possible for developers to migrate their existing CUDA codebase to SYCL to facilitate more hardware choices and access to the advantages of oneAPI and SYCL. The compatibility tool is based on LLVM/Clang [4]. It mainly contains 3 functional components: • The intercept-build tool: It is used to collect compilation options of the user input project by intercepting build process of user input project, like build option, macro definitions, include folders and so on information. During source-to-source migration, those compilation options are used to identify the active code path, header files dependencies to build a right abstract syntax tree for the user input project. • The ‘dpct’ binary tool: The tool is the main migration tool, which does source-to-source migration based on compiler front end technology. It implements a set of migration rules to migrate source language elements like types, APIs, macros to functionally compatible elements in target language. If some C/C++ code is the same between source and target language, then the tool keeps this C/C++ code unchanged. Also, the tool provides a way to let users define migration rules by themselves in migration rule description file to guide a customized migration. • Helper header library: It provides helper functions and macros to assist the migration of input source code. These header files written in C/C++/SYCL are intended to become part of migrated code generated by the compatibility tool. User can copy these header files if needed and include them with the generated code. The compatibility tool can assist developers to migrate code written in CUDA to code written in SYCL with proper performance, minimizing developer's efforts. The tool can enrich the oneAPI ecosystem by assisting developers in migration of more applications to SYCL running on oneAPI. Notices & Disclaimers Intel technologies may require enabled hardware, software or service activation. No product or component can be absolutely secure. Your costs and results may vary. © Intel Corporation. Intel, the Intel logo, and other Intel marks are trademarks of Intel Corporation or its subsidiaries. Other names and brands may be claimed as the property of others.
求助全文
通过发布文献求助,成功后即可免费获取论文全文。 去求助
来源期刊
自引率
0.00%
发文量
0
期刊最新文献
Improving Performance Portability of the Procedurally Generated High Energy Physics Event Generator MadGraph Using SYCL Acceleration of Quantum Transport Simulations with OpenCL CodePin: An Instrumentation-Based Debug Tool of SYCLomatic An Efficient Approach to Resolving Stack Overflow of SYCL Kernel on Intel® CPUs Ray Tracer based lidar simulation using SYCL
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
现在去查看 取消
×
提示
确定
0
微信
客服QQ
Book学术公众号 扫码关注我们
反馈
×
意见反馈
请填写您的意见或建议
请填写您的手机或邮箱
已复制链接
已复制链接
快去分享给好友吧!
我知道了
×
扫码分享
扫码分享
Book学术官方微信
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术
文献互助 智能选刊 最新文献 互助须知 联系我们:info@booksci.cn
Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。
Copyright © 2023 Book学术 All rights reserved.
ghs 京公网安备 11010802042870号 京ICP备2023020795号-1