Main Content

target.Processor クラス

名前空間: target

ターゲット プロセッサ情報の提供

説明

target.Processor クラスを使用して、ターゲット プロセッサに関する情報を提供します。たとえば、名前、製造元、言語実装などです。

target.Processor オブジェクトの作成には関数 target.create を使用します。

プロパティ

すべて展開する

オブジェクト識別子は、ManufacturerName プロパティ値をハイフンでつないだ組み合わせです。Manufacturer プロパティが空の場合、オブジェクト識別子は Name プロパティ値です。

属性:

GetAccess
public
SetAccess
private

関連付けられている target.LanguageImplementation オブジェクト。

属性:

GetAccess
public
SetAccess
public

ターゲット プロセッサの名前。

例: 'Cortex-A53'

属性:

GetAccess
public
SetAccess
public

ターゲット プロセッサの製造元に関するオプションの説明。

例: 'ARM Compatible'

属性:

GetAccess
public
SetAccess
public

タイマー情報を提供します。

属性:

GetAccess
public
SetAccess
public

実行時間の測定から除くインストルメンテーション オーバーヘッド値を指定します。

属性:

GetAccess
public
SetAccess
public

プロセッサ内の物理コア数。

属性:

GetAccess
public
SetAccess
public

データ型: uint

プロセッサ コアあたりのスレッド数。

属性:

GetAccess
public
SetAccess
public

データ型: uint

プロセッサが提供する論理コア数 (NumberOfCores x NumberOfThreadsPerCore と等しい)。

属性:

GetAccess
public
SetAccess
private

データ型: uint

新しいハードウェア実装の作成

このクラスを使用する例については、次を参照してください。

timer オブジェクトの作成

この例では、開発用コンピューター向けの timer オブジェクトの作成方法を示します。

タイマーの関数シグネチャを作成します。この例では、関数は uint64 データ型と関数名 timestamp_x86 を返します。

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

API オブジェクト内の関数を取得します。

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

関数の依存関係、つまり関数を実行するために必要なソース ファイルとヘッダー ファイルを取得します。

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

API と依存関係を組み合わせるオブジェクトを作成します。

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

timer オブジェクトを作成してタイマー情報に関連付けます。

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

メモ

名前と値の引数を使用して、次のコマンドで timer オブジェクトを作成できます。

 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'})

タイマーとアドオンを processor オブジェクトに割り当てます。

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

Intel Core プロセッサの説明の作成

ハイパースレッディングをサポートするプロセッサである Intel Core® i7-8550U プロセッサの説明を作成します。

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

バージョン履歴

R2019a で導入