面向CPU-GPU架构的源到源自动映射方法.docxVIP

  • 0
  • 0
  • 约1.83万字
  • 约 14页
  • 2026-01-30 发布于浙江
  • 举报

面向CPU-GPU架构的源到源自动映射方法.docx

ComputerEngineeringandApplications计算机工程与应用2015,51(21)41

面向CPU-GPU架构的源到源自动映射方法

朱正东1,刘袁1,魏洪昌1,颜康1,王寅峰2,董小社1

ZHUZhengdong1,LIUYuan1,WEIHongchang1,YANKang1,WANGYinfeng2,DONGXiaoshe1

1.西安交通大学电子与信息工程学院,西安710049

2.深圳信息职业技术学院,广东深圳518172

1.SchoolofElectronicInformationEngineering,Xi’anJiaotongUniversity,Xi’an710049,China

2.ShenzhenInstituteofInformationTechnology,Shenzhen,Guangdong518172,China

ZHUZhengdong,LIUYuan,WEIHongchang,etal.NovelautomaticmappingtechnologyonCPU-GPUheteroge-neoussystems.ComputerEngineeringandApplications,2015,51(21):41-47.

Abstract:AimingatthedevelopingandportingdifficultiesofGPU-basedapplications,amappingapproachisproposed,whichconvertsserialcomputingsourcecodeintoequivalentparallelcomputingsourcecode.Thisapproachacquireshier-archiesofparallelizableloopsfromserialsources,establishesthecorrespondencebetweenloopstructuresandGPUthreads,andgeneratesthecorefunctioncodeforGPU.Meanwhile,CPUcontrolcodeisgeneratedaccordingtoread/writeattributesofvariablereferences.Acompilerprototypeisimplementedbasedonthisapproach,whichtranslatesCcodeintoCUDAcodeautomatically.FunctionalityandperformanceevaluationsoftheprototypeshowthattheCUDAcodegeneratedisfunctionallyequivalenttotheoriginalCcode,withsignificantimprovementinperformance,thusovercomesthediffi-cultyinportingcompute-intensiveapplicationstoCPU-GPUheterogeneoussystems.

Keywords:GeneralPurposeGraphicProcessingUnit(GPGPU);ComputeUnifiedDeviceArchitecture(CUDA);auto-maticmapping;sourcetosourcecompile

摘要:针对GPU上应用开发移植困难的问题,提出了一种串行计算源程序到并行计算源程序的映射方法。该方法从串行源程序中获得可并行化循环的层次信息,建立循环体结构与GPU线程的对应关系,生成GPU端核心函数代码;根据变量引用读写属性生成CPU端控制代码。基于该方法实现了一个编译原型系统,完成了C语言源程序到CUDA源程序的自动生成。对原型系统在功能和性能方面的测试结果表明,该系统生成的CUDA源程序与C语言源程序在功能上一致,其性能有显著提高,在一定程度上解决了计算密集型应用向CPU-GPU异构多核

文档评论(0)

1亿VIP精品文档

相关文档