Code covered by the BSD License  

Highlights from
ICC_mex_tools

image thumbnail

ICC_mex_tools

by

 

09 Nov 2012 (Updated )

These tools provide a simple interface to Intel C++ compiler optimization features.

mex_ICC_PGOuse1(config)
function mex_ICC_PGOuse1(config)
%MEX_ICC_DEBUG uses ICC with general Profile Guided Optimization - use option
%
% .dyn files, created in output dir during profiled execution of mex
% created with mex_ICC_PGOgen, are merged to .dpi file in same dir, and
% used to compile profile-optimized mex file.
%
% mex_ICC_PGOuse1 uses data orderig optimizations: /Qprof-func-order /Qprof-data-order 
% it also uses single-file IPO: /Qip
%
% for more detail refer to
% http://software.intel.com/sites/products/documentation/doclib/stdxe/2013/composerxe/compiler/cpp-win/hh_goto.htm#GUID-42C5C93F-5F77-4B14-8A27-95798BC30CE3.htm

clc
clear mex

c=mex.getCompilerConfigurations;
if ~strcmp(c.Name,'Intel C++')
    warning('this file was supposed to be used with Intel C++ compilers');
end

mex(...
        'OPTIMFLAGS= /O3 /DNDEBUG /Qopenmp /QxHost /Qprec-div- /Qopenmp-report:2 /Qvec-report2 /Qopt-report:0 /Qip  /Qinline-calloc /Qprof-dir:%OUTDIR% /Qprof-use /Qprof-func-order /Qprof-data-order ',...
        config.cpp_file,...
        '-outdir', config.outdir,...
        ...'-g',...        
        '-largeArrayDims',...
        '-v'...
    );
end

Contact us