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_PGOuse2(config)
function mex_ICC_PGOuse2(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_PGOuse2 uses IPO optimizations : /Qipo
% this option requires Intel xilink linker
%
%
% 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

if isempty(strfind(c.LinkerName,'Intel'))
    warning('this file was supposed to be used with Intel C++ linker');
end



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

Contact us