请问我在使用C++编程的时候为了方便Intel的编译器优化应该注意哪些问题呢?

烟灯居士 2008-04-23 10:19:36
如上,谢谢
...全文
107 1 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
intel_iclifort 2008-04-23
  • 打赏
  • 举报
回复
首先, 不用刻意为之

当然, 如果能够参考一下编译器给出的优化报告, 就能够知道如何进一步改动了

如果想要看到优化报告, 可以在工程或者命令行中, 加入如下的编译选项(仅适用于Intel 编译器):

Linux and Mac OS X: -opt-report [n]
Windows: /Qopt-report[:n]

n Is the level of detail in the report. Possible values are:
0 Tells the compiler to generate no optimization report.
1 Tells the compiler to generate a report with the minimum level of detail.
2 Tells the compiler to generate a report with the medium level of detail.
3 Tells the compiler to generate a report with the maximum level of detail.

Linux and Mac OS X: -opt-report-phase[phase]
Windows: /Qopt-report-phase[:phase]

phase Is the phase to generate reports for. Some of the possible values are:
ipo The Interprocedural Optimizer phase
hlo The High Level Optimizer phase
hpo The High Performance Optimizer phase
ilo The Intermediate Language Scalar Optimizer phase
ecg The Code Generator phase (Windows and Linux systems using IA-64 architecture only)
ecg_swp The software pipelining component of the Code Generator phase (Windows and Linux systems using IA-64 architecture only)
pgo The Profile Guided Optimization phase
all All optimizer phases

Default
OFF No optimization reports are generated.
Intel C++ 编译器Windows版》(Intel.C.Plus.Plus.Compiler.v10.0.026)[Bin] 软件版权归原作者及原软件公司所有,如果你喜欢,请购买正版软件 常驻服务器 : DonkeyServer No2, 7x24, 根据工作需要暂停 [版本说明] 截止到2007-08-15为最新版, 仅包含Windows平台, 支持 IA32 / Intel64 / IA64处理器 [病毒检测] NOD32 v2.7 2007-08-15 [安装测试] Windows 2003 SP2 / Visual Studio 2005 SP1 [产品主页] [ http://www.intel.com/cd/software/products/...9578.htm ] [产品简介] 个人翻译, 以原版英文为准: 概要: -------------------------------------------------------------------------------- Intel C++编译器专业版为创建多线程应用程序提供最好的支持。只有专业版才提供对高级优化、多线程和处理器支持(?)。包括自动处理器派发、向量化、自动并行处理、OpenMP*、数据预取、循环展开,还有为并行化、数学运算和多媒体库而高度优化C++模版。 专业版把高效的编译器Intel® Threading Building Blocks (Intel® TBB), Intel® Integrated Performance Primitives (Intel® IPP) and Intel® Math Kernel Library (Intel® MKL)整合到了一起。虽然这些库也可以单独获取,但是专业版在一个显著折扣价位上为构建稳定高效的并行代码提供了一个强大的基础。 标准版编译器和专业版有着相同的效能和特性, 但是不提供多线程库。 特性: -------------------------------------------------------------------------------- 效能: 考虑使用Intel C++编译器专业版来最佳化效能。内间的优化技术和多线程支持帮助您创建可以在最新的多核处理器上运行best的代码。 高级优化特性: 使用IntelC++编译器Windows版编译的软件可以受益于高级优化特性, 这里有一些简要介绍, 并且链接到完整描述: * Multi-Threaded Application Support, including OpenMP and auto-parallelization for simple and efficient software threading. * Auto-vectorization 并行化代码来利用最新处理器的SSE指令集构架(SSE, SSE2, SSE3, SSSE3, and SSE4)。 * High-Performance Parallel Optimizer (HPO)(高效能并行优化器) 重新组织和优化循环来确定auto-vectorization, OpenMP, or auto-parallelization 最好的利用处理器的缓存、内存访问、SIMD指令集和多核能力。这个由10.0版本而来得新的革命性的能力,组合了向量化、并行化和循环转化到一个比先前分散模块更快、更有效率和更可靠的单个过程。 * Interprocedural Optimization (IPO) 大幅的改善了被频繁使用的中小规模函数的效能,尤其是在循环内包含调用的程序。这个优化器的分析能力还可以对代码弱点和代码错误给出反馈,诸如未初始化的变量或者OpenMP API issues这些严格依赖编译器前端的编译器不能检测到的状况。 * Profile-guided Optimization (PGO) 通过减少指令缓存thrashing、重新组织代码布局、收缩代码大小和降低分支预测失败来改善程序效能。 * Optimized Code Debugging with the Intel® Debugger(使用Intel调试器调试优化后的代码)改善了为Intel架构优化代码的调试过程的效率. 本版本新特性: -------------------------------------------------------------------------------- 此Intel C++编译器Windows版本构建于一个winning foundation之上。它使您能够为下一代硬件创建下一代应用。 改善的效能和Threading * 新的并行/循环优化器 * 改善的C++优化 * 异常处理和类层次分析 安全监测和诊断 * 缓冲区溢出静态验证 * OpenMP API 验证 VISTA 和 Visual Studio 2005 支持 优化报告 支持最新的多核处理器 * Intel® Core™2 Duo processor * Intel® Core™2 Quad processor * Quad-Core Intel® Xeon® processor 5300 series * Dual-Core Intel® Xeon® processor 3000 series * Dual-Core Intel® Xeon® processor 5000 series * Dual-Core Intel® Xeon® processor 7000 series * Dual-Core Intel® Itanium® 2 processor 提供专业版本 Advanced Optimization Features in Depth -------------------------------------------------------------------------------- ... ... 兼容性和适应性 -------------------------------------------------------------------------------- ... ... 可与Microsoft Visual Studio 2005, Visual Studio .NET 2002/2003, and Visual Studio 98集成,并提供扩展的32位和64位多核Intel处理器支持。 Intel C++ 编译器提供下列语言一致性 * ANSI/ISO C 语言标准一致性 (ISO/IEC 9899:1990) * ANSI/ISO C++语言标准一致 (ISO/IEC 14882:1998) * OpenMP 规范版本 2.5 系统需求

567

社区成员

发帖
与我相关
我的任务
社区描述
英特尔® 边缘计算,聚焦于边缘计算、AI、IoT等领域,为开发者提供丰富的开发资源、创新技术、解决方案与行业活动。
社区管理员
  • 英特尔技术社区
  • shere_lin
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧