Main Content

target.Processor class

Package: target

Provide target processor information

Since R2019a

Description

Use the target.Processor class to provide information about your target processor. For example, name, manufacturer, and language implementation.

To create a target.Processor object, use the target.create function.

Properties

expand all

The object identifier is the hyphenated combination of the Manufacturer and Name property values. If the Manufacturer property is empty, the object identifier is the Name property value.

Attributes:

GetAccess
public
SetAccess
private

Associated target.LanguageImplementation object.

Attributes:

GetAccess
public
SetAccess
public

Name of the target processor.

Example: 'Cortex-A53'

Attributes:

GetAccess
public
SetAccess
public

Optional description of the target processor manufacturer.

Example: 'ARM Compatible'

Attributes:

GetAccess
public
SetAccess
public

Provide timer information.

Attributes:

GetAccess
public
SetAccess
public

Specify instrumentation overhead values for removal from execution-time measurements.

Attributes:

GetAccess
public
SetAccess
public

Number of physical cores in processor.

Attributes:

GetAccess
public
SetAccess
public

Data Types: uint

Number of threads per processor core.

Attributes:

GetAccess
public
SetAccess
public

Data Types: uint

Number of logical cores that processor provides, which is equal to NumberOfCores x NumberOfThreadsPerCore.

Attributes:

GetAccess
public
SetAccess
private

Data Types: uint

Examples

Create Timer Object

This example shows how you can create a timer object for your development computer.

Create the function signature for a timer. In this example, the function returns a uint64 data type and the function name timestamp_x86.

timerSignature = target.create('Function');
timerSignature.Name = 'timestamp_x86';
timerSignature.ReturnType = 'uint64';

Capture the function in an API object.

timerApi = target.create('API');
timerApi.Functions = timerSignature;
timerApi.Language = target.Language.C;
timerApi.Name = 'Linux Timer API';

Capture the dependencies of the function, that is, the source and header files that are required to run the function.

timerDependencies = target.create('BuildDependencies');
timerDependencies.IncludeFiles = {'host_timer_x86.h'};
timerDependencies.IncludePaths = ...
               {'$(MATLAB_ROOT)/toolbox/coder/profile/src'};
timerDependencies.SourceFiles = {'host_timer_x86.c'};

Create an object that combines the API and dependencies.

timerImplementation = target.create('APIImplementation');
timerImplementation.API = timerApi;
timerImplementation.BuildDependencies = timerDependencies;
timerImplementation.Name = 'Linux Timer Implementation';

Create the timer object and associate it with the timer information.

timer = target.create('Timer');
timer.APIImplementation = timerImplementation;
timer.Name = 'Linux Timer';

Note

Using name-value arguments, you can create the timer object with this command.

 timer = target.create('Timer', 'Name', 'Linux Timer', ...
           'FunctionName', 'timestamp_x86', ...
           'FunctionReturnType', 'uint64', ...
           'FunctionLanguage', target.Language.C, ...
           'SourceFiles', {'host_timer_x86.c'}, ...
           'IncludeFiles', {'host_timer_x86.h'}, ...
           'IncludePaths', {'$(MATLAB_ROOT)/toolbox/coder/profile/src'})

Assign the timer and add-ons to the processor object.

processor = target.get('Processor', 'Intel-x86-64 (Linux 64)');
processor.Timers = timer;

Create Description for Intel Core Processor

Create a description for the Intel Core® i7-8550U processor, which is a processor that supports hyperthreading.

i7 = target.create('Processor', ...
                   'Name', 'i7-8550U', ...
                   'Manufacturer', 'Intel', ...
                   'NumberOfCores', 4, ...
                   'NumberOfThreadsPerCore', 2);
target.add(i7);

Version History

Introduced in R2019a