C/C++

Source code conventions for optimizing branch prediction?

I have a code for which I know the statistics of a random branch, but I am struggling to understand how to convince the compiler to generate conditional branches of the correct parity for the static prediction to be correct as often as possible.

On the web page https://software.intel.com/en-us/articles/branch-and-loop-reorganization... the advice says:

error: declaration is incompatible (regparm involved)

hi, i'm trying to build a project (https://github.com/riclas/rstm/) with ICC but i get the following error:

libstm/txthread.cpp(138): error: declaration is incompatible with "__attribute((regparm(3))) bool (*volatile stm::TxThread::tmbegin)(stm::TxThread *)" (declared at line 152 of "include/stm/txthread.hpp")

    __attribute__((regparm(3))) bool (*volatile TxThread::tmbegin)(TxThread*) = begin_CGL;

 

txthread.cpp(138): bool TM_FASTCALL (*volatile TxThread::tmbegin)(TxThread*) = begin_CGL;

Missed optimization opportunity ANY(array .eq. 0.0)

It is a common occurrence to test a result array for conditions.

vector_mod = mod(vector_num, vector_i)
!dir$ if(.true.)
  if(ANY(vector_mod .eq. 0) return
!dir$ else
  do j=1,vector_length
    if(vector_mod(j) .eq. 0) return
  end do
!dir$ endif

Where the ANY intrinsic or short loop is performing a relational operation on an array with scalar.

The expanded code IVF V16.0 update 1 on Windows generates scalar code for both !dir$ expansions.

!$omp target device(0) map(to : min_limit,max_limit) not working

In Poor speed in MIC you will find a test case that exhibits a failure of the map(... clause of !$omp target device(0) not copying data to/from the device. The workaround was to use !$omp target update to(.. before, and !$omp target update from( after the !$omp target device(0) region.

Windows 7 Pro x64, IVF V16.0 update 1.

Look for commented out "!*!$omp ... clauses

How to set the compiler permanently?

As a student, I successfully installed the Intel Parallel Studio XE 2016 Update 1 on the latest Ubuntu Mate in Virtualbox (I know, that the virtualization makes some features not work, but for me basically the compiler is needed at this time). It works well, but I would like to be able to use it just by typing icc in the terminal. I followed the steps of https://www.cms.hu-berlin.de/de/dl/systemservice/computeservice/docs/sta..., i.e.

Upcoming IXPUG meeting in Ostrav, Czech Republic - March 15-18

Please join IXPUG (Intel® Xeon Phi™ Users Group) for a meeting at the Clarion Congress Hotel, hosted by IT4Innovations, VŠB - Technical University of Ostrava in Ostrava, Czech Republic. The meeting will combine Intel PCC members-only meeting (March 14-15) with IXPUG Workshops and Tutorials, which will be free and open to the public, March 15th – 18th. We encourage you to join us in Ostrava!

S’abonner à C/C++