欢迎来到天天文库
浏览记录
ID:52000699
大小:339.00 KB
页数:20页
时间:2020-03-28
《程序地循环优化方法1.0.ppt》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、提升循环级并行IntelCopyright©2002IntelCorporationAgendaIntroductionWhoCares?DefinitionLoopDependenceandRemovalDependencyIdentificationLabSummaryIntroductionLoopsmustmeetcertaincriteria…IterationIndependenceMemoryDisambiguationHighLoopCountEtc…WhoCares实现真正的并行:OpenMPAutoParallelization…显式的指令级并行ILP
2、(InstructionLevelParallelism)StreamingSIMD(MMX,SSE,SSE2,…)SoftwarePipeliningonIntel®Itanium™ProcessorRemoveDependenciesfortheOut-of-OrderCoreMoreInstructionsruninparallelonIntelItanium-Processor自动编译器并行HighLevelOptimizationsDefinitioninta[MAX];for(J=0;J3、:IterationYofaloopisindependentofwhenorwhetheriterationXhappens图例OpenMP:TrueParallelismSIMD:VectorizationSWP:SoftwarePipeliningOOO:Out-of-OrderCoreILP:InstructionLevelParallelismGreen:BenefitsfromconceptYellow:SomeBenefitsfromConceptRed:NoBenefitfromConceptAgendaDefinitionWhoCares?LoopDep4、endenceandRemovalDataDependenciesRemovingDependenciesDataAmbiguityandtheCompilerDependencyRemovalLabSummaryFlowDependencyReadAfterWriteCross-IterationFlowDependence:Variableswrittenthenreadindifferentiterationsfor(J=1;J5、adCross-IterationAnti-Dependence:Variableswrittenthenreadindifferentiterationsfor(J=1;J6、[1]=B[1];A[2]=C[1];A[2]=B[1];A[3]=C[1];IntraIterationDependencyDependencywithinaniterationHurtsILPMaybeautomaticallyremovedbycompilerK=1;for(J=1;J7、ParallelismNotalldependenciescanberemovedfor(J=1;J
3、:IterationYofaloopisindependentofwhenorwhetheriterationXhappens图例OpenMP:TrueParallelismSIMD:VectorizationSWP:SoftwarePipeliningOOO:Out-of-OrderCoreILP:InstructionLevelParallelismGreen:BenefitsfromconceptYellow:SomeBenefitsfromConceptRed:NoBenefitfromConceptAgendaDefinitionWhoCares?LoopDep
4、endenceandRemovalDataDependenciesRemovingDependenciesDataAmbiguityandtheCompilerDependencyRemovalLabSummaryFlowDependencyReadAfterWriteCross-IterationFlowDependence:Variableswrittenthenreadindifferentiterationsfor(J=1;J5、adCross-IterationAnti-Dependence:Variableswrittenthenreadindifferentiterationsfor(J=1;J6、[1]=B[1];A[2]=C[1];A[2]=B[1];A[3]=C[1];IntraIterationDependencyDependencywithinaniterationHurtsILPMaybeautomaticallyremovedbycompilerK=1;for(J=1;J7、ParallelismNotalldependenciescanberemovedfor(J=1;J
5、adCross-IterationAnti-Dependence:Variableswrittenthenreadindifferentiterationsfor(J=1;J6、[1]=B[1];A[2]=C[1];A[2]=B[1];A[3]=C[1];IntraIterationDependencyDependencywithinaniterationHurtsILPMaybeautomaticallyremovedbycompilerK=1;for(J=1;J7、ParallelismNotalldependenciescanberemovedfor(J=1;J
6、[1]=B[1];A[2]=C[1];A[2]=B[1];A[3]=C[1];IntraIterationDependencyDependencywithinaniterationHurtsILPMaybeautomaticallyremovedbycompilerK=1;for(J=1;J7、ParallelismNotalldependenciescanberemovedfor(J=1;J
7、ParallelismNotalldependenciescanberemovedfor(J=1;J
此文档下载收益归作者所有