gusucode.com > target工具箱matlab源码程序 > target/extensions/processor/intelhost/tfl/addvectaddsubentry.m
function addvectaddsubentry(hLib, par, implname, dtype, key, srcPath, incPath) %ADDVECTADDSUBENTRY - Adds Vector Add or Subtract entry to a TFL table for Intel IPP % Copyright 2010 The MathWorks, Inc. lbound = 3; e = IntelHostTFL.VectVectOpEntry; e = locSetEntryParam(e, key, par, implname, srcPath, incPath); locEntry(hLib, e, dtype, [lbound 1; inf 1], [lbound 1; inf 1], [lbound 1; inf 1]); % register transposed shape as well e = IntelHostTFL.VectVectOpEntry; e = locSetEntryParam(e, key, par, implname, srcPath, incPath); locEntry(hLib, e, dtype, [1 lbound; 1 inf], [1 lbound; 1 inf], [1 lbound; 1 inf]); end % ------------------------------------------------------------------------- function locEntry(hLib, hEnt, dtype, outDims, in1Dims, in2Dims) if isempty(hLib) || isempty( hEnt ) return; end hEnt.createAndAddConceptualArg('RTW.TflArgMatrix',... 'Name', 'y1', 'BaseType', dtype, 'IOType', 'RTW_IO_OUTPUT', 'DimRange', outDims); hEnt.createAndAddConceptualArg('RTW.TflArgMatrix',... 'Name', 'u1', 'BaseType', dtype, 'DimRange', in1Dims); hEnt.createAndAddConceptualArg('RTW.TflArgMatrix',... 'Name', 'u2', 'BaseType', dtype, 'DimRange', in2Dims); % Specify replacement function Signature arg = hLib.getTflArgFromString('y2', 'void'); arg.IOType = 'RTW_IO_OUTPUT'; hEnt.Implementation.setReturn(arg); arg = hLib.getTflArgFromString('u1', [dtype '*']); hEnt.Implementation.addArgument(arg); arg = hLib.getTflArgFromString('u2', [dtype '*']); hEnt.Implementation.addArgument(arg); arg = hLib.getTflArgFromString('y1', [dtype '*']); arg.IOType = 'RTW_IO_OUTPUT'; hEnt.Implementation.addArgument(arg); arg = hLib.getTflArgFromString('Length', 'integer', 0); arg.PassByType = 'RTW_PASSBY_AUTO'; arg.Type.ReadOnly = true; hEnt.Implementation.addArgument(arg); hLib.addEntry( hEnt ); end % ------------------------------------------------------------------------- function e = locSetEntryParam(e, key, par, implname, srcPath, incPath) e.setTflCOperationEntryParameters(... 'Key', key, ... 'Priority', 100, ... 'ImplementationName', implname, ... 'ImplementationHeaderFile', 'mw_ippm.h', ... 'ImplementationSourceFile', 'mw_ippm.c', ... 'ImplementationHeaderPath', incPath, ... 'ImplementationSourcePath', srcPath, ... 'AdditionalHeaderFiles', {'ipp.h'}, ... 'AdditionalIncludePaths', par.AdditionalIncludePaths, ... 'AdditionalLinkObjs', par.AdditionalLinkObjs, ... 'AdditionalLinkObjsPaths', par.AdditionalLinkObjsPaths, ... 'AdditionalLinkFlags', par.AdditionalLinkFlags, ... 'SideEffects', true, ... 'SaturationMode', 'RTW_SATURATE_UNSPECIFIED', ... 'RoundingMode', 'RTW_ROUND_UNSPECIFIED'); end % LocalWords: TFL IPP Tfl PASSBY mw ippm ipp Objs