A CPU-GPU Data Transfer Optimization Approach Based on Code Migration and Merging

Cong Fu, Zhenhua Wang, Yanlong Zhai
{"title":"A CPU-GPU Data Transfer Optimization Approach Based on Code Migration and Merging","authors":"Cong Fu, Zhenhua Wang, Yanlong Zhai","doi":"10.1109/DCABES.2017.13","DOIUrl":null,"url":null,"abstract":"Porting applications to CPU-GPU architecture remains a challenge to average programmers, which have to explicitly manage data transfers between the host and device memories. In this paper, we proposed an approach to optimize the data transfer operations between CPU and GPU by analysing the data dependency and reorganizing source code. We found that not only the data transmission through PCIe bus is time consuming, but also the preparation and cleaning work for data transfer operations. This cost will be dramatically increased if the program contains many kernel calls. Therefore, we firstly defined and analyzed the data copy in (out) path for each data transfer operation utilizing compiler techniques. The data copy in or copy out operation can be migrated along with its data copy path. Multiple data transfer operations could be merged into one operation if they are of the same transfer direction and their data copy paths have overlap. Migrating and merging multiple data transfer operations could obviously reduce the number of data exchange times and the system resource consumption.","PeriodicalId":446641,"journal":{"name":"2017 16th International Symposium on Distributed Computing and Applications to Business, Engineering and Science (DCABES)","volume":"1 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2017-10-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"4","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"2017 16th International Symposium on Distributed Computing and Applications to Business, Engineering and Science (DCABES)","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1109/DCABES.2017.13","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 4

Abstract

Porting applications to CPU-GPU architecture remains a challenge to average programmers, which have to explicitly manage data transfers between the host and device memories. In this paper, we proposed an approach to optimize the data transfer operations between CPU and GPU by analysing the data dependency and reorganizing source code. We found that not only the data transmission through PCIe bus is time consuming, but also the preparation and cleaning work for data transfer operations. This cost will be dramatically increased if the program contains many kernel calls. Therefore, we firstly defined and analyzed the data copy in (out) path for each data transfer operation utilizing compiler techniques. The data copy in or copy out operation can be migrated along with its data copy path. Multiple data transfer operations could be merged into one operation if they are of the same transfer direction and their data copy paths have overlap. Migrating and merging multiple data transfer operations could obviously reduce the number of data exchange times and the system resource consumption.
一种基于代码迁移和合并的CPU-GPU数据传输优化方法
将应用程序移植到CPU-GPU架构对普通程序员来说仍然是一个挑战,他们必须明确地管理主机和设备内存之间的数据传输。本文提出了一种通过分析数据依赖关系和重组源代码来优化CPU和GPU之间数据传输操作的方法。我们发现,通过PCIe总线传输数据不仅耗时,而且数据传输操作的准备和清理工作也很耗时。如果程序包含许多内核调用,则此成本将急剧增加。因此,我们首先利用编译器技术定义并分析了每个数据传输操作的数据拷贝入(出)路径。数据拷贝入或拷贝出操作可以与其数据拷贝路径一起迁移。如果多个数据传输操作具有相同的传输方向,且数据复制路径有重叠,则可以合并为一个操作。迁移和合并多个数据传输操作可以明显减少数据交换次数和系统资源消耗。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:604180095
Book学术官方微信