欢迎来到天天文库
浏览记录
ID:40057974
大小:776.99 KB
页数:10页
时间:2019-07-18
《CUDA_4.0_Readiness_Tech_Brief》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库。
1、CUDATOOLKIT4.0READINESSFORCUDAAPPLICATIONSMarch3,2011TechnicalBriefTECHNICALBRIEFINTRODUCTIONInNVIDIA®CUDATMToolkitversion4.0,amajoremphasishasbeenplacedonimprovingtheprogrammabilityofmulti-threadedandmulti-GPUapplicationsandonimprovingtheeaseofportingexistingcodetoCUDAC/C++.Thisdocumentdescri
2、besthekeyAPIchangesandimprovementsthathavebeenmadetowardthatend,particularlywheretheyhavethepotentialtoimpactexistingapplications.ThisdocumentalsohighlightsafewoftheimprovementsthathavebeenmadetothelibrariesbundledwiththeCUDAToolkit.Foracompletelistingofnewfeatures,pleaserefertotheCUDAToolkitR
3、eleaseNotes;forcompletedocumentationofCUDAAPIs,pleaserefertotheCUDAToolkitReferenceManual,theCUDACProgrammingGuide,andtheCUDAlibrarydocumentation.CUDATOOLKIT4.0READINESSFORCUDAAPPLICATIONS2TECHNICALBRIEFMULTI-GPUPROGRAMMINGInCUDAToolkit3.2andearlier,thereweretwobasicapproachesavailabletoexecut
4、eCUDAkernelsonmultipleGPUs(CUDA“devices”)concurrentlyfromasinglehostapplication:Useonehostthreadperdevice,sinceanygivenhostthreadcancallcudaSetDevice()atmostonetime.Usethepush/popcontextfunctionsprovidedbytheCUDADriverAPI.ForapplicationsthatdonotrequiretightcouplingofthevariousCUDAdeviceswit
5、hinasystem(e.g.,whenthedevicesareprocessingindependentdatasetswithlittleneedtocommunicateorsynchronizewitheachother),theseapproacheswereoftensufficient.However,forapplicationsthatneedatightercouplingoftheexecutionofworkacrossdevices,orwheretheuseofmultiplehostthreadsisotherwiseinconvenient,itw
6、ouldsometimesbebetterifasinglehostthreadcouldeasilylaunchworkontoanydevicesitneeded.CUDARuntimeAPITheCUDARuntimenowprovidesanativemeanstoaccomplishthis:ahostthreadcansimplycallcudaSetDevice()atanytime(ratherthanjustonceatthebeginningoftheprogram)tochangethecurrentlyactivedevice.Thishasthefollo
7、wingconsequences:Kernellauncheswillbeexecutedonthecurrentlyselecteddevice.Memoryallocationswillbemadeonthecurrentlyselecteddevice.Streamsandeventscreatedwillbeassociatedwiththecurrentlyselecteddevice.1Forexample:cudaSetDevice(0);//st
此文档下载收益归作者所有
点击更多查看相关文章~~