Code Sample

Cilk™ Plus并行程序的串行等价程序的执行过程

    C++社区的趋势近年来主要是通过以添加更多的库而不是语言关键字来实现增加程序的功能性,比如Threading Building Blocks以及Parallel Patterns库,但与主流发展趋势不同的是,Intel的Cilk™ Plus的实现方式则是以后者的形式——语言关键字来增加程序功能的,本文将就此给出分析。

    其中的一个主要原因是语言及其扩展主要是由编译器来实现转换,并且编译器能够提供一定程度的保证,比如串行等价语义等。

    每一个使用关键字来定义并行Cilk™ Plus的程序都有一个已在编译器实现中定义好的串行语义。 通过将每一个cilk_sync及cilk_spawn替换为空,且将每一个cilk_for以for关键字来替代,编译器由此将并行的Cilk™ Plus程序处理为一个有效的串行C/C++程序。 当两个逻辑并行的线程同时访问同一内存位置且至少一个为写内存操作时,程序行为此时出现竞态,如果一个Cilk™ Plus并行程序没有竞态发生的话,此时它将产生与其串行等价程序相同的结果。编译器是如何保证其串行等价的结果一致的?考虑以下的代码:

  • Developers
  • C/C++
  • Intel® C++ Composer XE
  • Intel® Cilk™ Plus
  • License Agreement: 

    Java vs C vs IPP vs TBB: test di performance su dispositivi Intel

    Di recente ci siamo trovati nella situazione di voler ottimizzare una nostra applicazione per la realta’ aumentata (http://picshare.jooink.com) su dispositivi mobile. Picshare e' interamente scritto in javascript ed essendo il nostro target quello di ottimizzarlo per dispositivi mobile la strada più naturale ci è sembrata quella di riscrivere nativamente parte degli algoritmi computazionalmente rilevanti e, con l’occasione, mettere a confronto diverse implementazioni ‘native’ al fine di capire quale strategia fosse preferibile.

  • Developers
  • Android*
  • Android*
  • C/C++
  • Java*
  • Intermediate
  • Intel Hardware Accelerated Execution Manager (HAXM)
  • Intel® Integrated Native Developer Experience (INDE)
  • Intel
  • android
  • x86
  • ottimizzazione
  • IPP
  • primitive
  • OpenGL* ES 3.0 Precompiled Shaders

    Another great Android OpenGL ES 3.0 sample from Cristiano Ferreira - Graphics Software Engineer with Intel Corporation.

    Programmatically compiling all shaders the first time an application is run and saving the binaries for reuse can significantly reduce load times for games in subsequent runs. The OpenGL* ES 3.0 sample code introduced here demonstrates a simple implementation of this capability.

  • Developers
  • Partners
  • Professors
  • Students
  • Android*
  • Android*
  • Game Development
  • C/C++
  • Advanced
  • Intermediate
  • OpenGL*
  • GameCodeSample
  • License Agreement: 

    OpenGL* ES 3.0 Instanced Rendering

    This Android OpenGL ES 3.0 Sample was written by Cristiano Ferreira - Software Engineer at Intel Corporation.

    By batch-rendering multiple versions of the same mesh, instanced rendering can help developers using OpenGL* ES 3.0 and later dramatically improve performance and resource efficiency. The sample code introduced here demonstrates a simple technique for using this capability.

  • Developers
  • Partners
  • Professors
  • Students
  • Android*
  • Android*
  • Game Development
  • C/C++
  • GameCodeSample
  • OpenGL*
  • Game Development
  • License Agreement: 

    Controlling floating-point modes when using Intel® Threading Building Blocks

    Intel® Threading Building Blocks (Intel® TBB) 4.2 Update 4 introduced enhanced support for managing floating-pointing settings. Floating-point settings can now be specified at the invocation of most parallel algorithms (including flow::graph). In this blog I want to pay attention to some peculiarities and details of the new feature and overall floating-point settings support in Intel TBB. This blog is not devoted to general floating-point support in the CPU.

  • Developers
  • Intel AppUp® Developers
  • Partners
  • Professors
  • Students
  • Android*
  • Linux*
  • Microsoft Windows* (XP, Vista, 7)
  • Microsoft Windows* 8
  • Unix*
  • Android*
  • Server
  • Windows*
  • C/C++
  • Advanced
  • Beginner
  • Intermediate
  • Intel® Threading Building Blocks
  • tbb
  • floating-point
  • fp
  • FPU
  • floating-point settings
  • FP settings
  • FPU settings
  • FPU controls
  • CPU settings
  • CPU controls
  • Development Tools
  • Education
  • Open Source
  • Parallel Computing
  • Threading
  • Subscribe to Code Sample