JP2000148731A - Information processor and record medium - Google Patents

Information processor and record medium

Info

Publication number
JP2000148731A
JP2000148731A JP10326494A JP32649498A JP2000148731A JP 2000148731 A JP2000148731 A JP 2000148731A JP 10326494 A JP10326494 A JP 10326494A JP 32649498 A JP32649498 A JP 32649498A JP 2000148731 A JP2000148731 A JP 2000148731A
Authority
JP
Japan
Prior art keywords
array
function
vector
processing
vectorizable
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP10326494A
Other languages
Japanese (ja)
Inventor
Hironori Sei
裕紀 清
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP10326494A priority Critical patent/JP2000148731A/en
Publication of JP2000148731A publication Critical patent/JP2000148731A/en
Pending legal-status Critical Current

Links

Landscapes

  • Complex Calculations (AREA)
  • Devices For Executing Special Programs (AREA)

Abstract

PROBLEM TO BE SOLVED: To perform the efficient vector process of an array built-in function. SOLUTION: An array built-in function detecting means 1 detects the array built-in function when an executable program is executed. An array built-in function kind specifying means 3 specifies the kind of the detected array built-in function. A threshold generating means 4 generates the threshold corresponding to the specified kind. A vectorizable part specifying means 2 analyzes the array included in the detected array built-in function to specify a vectorizable part and refers to the threshold supplied from the threshold generating means 4 to supply the vectorizable part to a vector processing means 5 when its length is larger than the threshold or to a scalar processing means 7 when not. An execution environment specifying means 6 specifies the execution environment of the program and supplies it to the vector processing means 5. The vector processing means 5 performs the vector process of the array built-in function according to the processing procedure corresponding to the environment specified by the execution environment specifying means 6. The scalar processing means 7 performs the scalar processing of the array.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明は、情報処理装置およ
び記録媒体に関し、特に、ベクトル処理が可能な情報処
理装置およびベクトル処理が可能なコンピュータにおい
て実行されるプログラムを記録したコンピュータ読み取
り可能な記録媒体に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an information processing apparatus and a recording medium, and more particularly to an information processing apparatus capable of performing vector processing and a computer-readable recording medium storing a program to be executed by a computer capable of performing vector processing. About.

【0002】[0002]

【従来の技術】例えば、科学技術計算などを行う場合に
は、複数のデータを繰り返して処理する場合が多いこと
から、このような繰り返し処理を高速化するためのベク
トル演算部を有するコンピュータが存在している。
2. Description of the Related Art For example, when performing scientific calculations, a plurality of data are often repeatedly processed. Therefore, there is a computer having a vector operation unit for speeding up such repetitive processing. are doing.

【0003】このようなコンピュータでは、ベクトル、
即ち、1次元配列データに対して一括して処理を行うこ
とが可能となるので、データを1つずつ処理する従来の
スカラ処理と比較して、1回に処理可能なベクトル長に
略比例して処理を高速化することが可能となる。
In such a computer, a vector,
That is, since the processing can be performed on the one-dimensional array data in a lump, it is substantially proportional to the vector length that can be processed at one time as compared with the conventional scalar processing that processes the data one by one. Processing can be speeded up.

【0004】ところで、ベクトル演算部を有するコンピ
ュータで実行されるプログラム(実行可能プログラム)
は、FortranやCなどの高級言語によって作成さ
れたソースプログラムをコンパイラによってコンパイル
することにより生成される。このとき、コンパイラは、
ソースプログラムに含まれている各ソースコードがベク
トル化可能か否かを判定し、ベクトル化が可能な場合に
は適切なベクトルコードを生成する必要がある。
A program (executable program) executed by a computer having a vector operation unit
Is generated by compiling a source program created in a high-level language such as Fortran or C with a compiler. At this time, the compiler
It is necessary to determine whether each source code included in the source program can be vectorized and, if vectorization is possible, generate an appropriate vector code.

【0005】図9は、引数として配列を使用可能な組み
込み関数である「配列組み込み関数」(ベクトル化対象
部分)が含まれているソースコードを、コンパイラが実
行可能型のプログラム(以下、実行可能プログラムと略
記する)に変換する場合に実行される処理の一例を説明
するフローチャートである。このフローチャートが開始
されると、以下の処理が実行される。 [S1]コンパイラは、ソースプログラムから配列組み
込み関数を取得する。 [S2]コンパイラは、取得した配列組み込み関数に含
まれている引数配列の次元と要素数が不明であるか否か
を判定し、不明である場合にはステップS3に進み、そ
れ以外の場合にはステップS4に進む。
FIG. 9 shows a source code including an "array built-in function" (portion to be vectorized) which is a built-in function that can use an array as an argument. 9 is a flowchart illustrating an example of a process executed when converting to a program. When this flowchart is started, the following processing is executed. [S1] The compiler acquires an array built-in function from a source program. [S2] The compiler determines whether the dimensions and the number of elements of the argument array included in the acquired array built-in function are unknown. If unknown, the process proceeds to step S3. Goes to step S4.

【0006】即ち、コンパイラは、配列組み込み関数に
含まれている配列の形状(例えば、次元)が不明である
場合や、オプショナル引数が使用されている場合であっ
て、そのオプショナル引数の内容が不明であるか否かを
判定し、これらの何れかが不明である場合にはステップ
S3に進み、それ以外の場合にはステップS4に進む。 [S3]コンパイラは、配列組み込み関数のライブラリ
を呼び出し、対象となる関数をスカラ処理化する処理を
行う。 [S4]コンパイラは、対象となる関数をインライン展
開することによりベクトル化する処理を行う。 [S5]コンパイラは、未処理のソースコードが存在す
るか否かを判定し、存在する場合にはステップS1に戻
って同様の処理を繰り返し、それ以外の場合には処理を
終了する。
In other words, the compiler determines whether the shape (for example, dimension) of an array included in an array built-in function is unknown, or if an optional argument is used, and the content of the optional argument is unknown. Is determined, and if any of them is unknown, the process proceeds to step S3, and otherwise, the process proceeds to step S4. [S3] The compiler calls a library of array built-in functions and performs a process of converting the target function into a scalar process. [S4] The compiler performs a vectorization process by performing inline expansion of the target function. [S5] The compiler determines whether there is any unprocessed source code, and if so, returns to step S1 and repeats the same processing. Otherwise, the processing ends.

【0007】以上の処理によれば、配列組み込み関数に
含まれている配列をベクトルコードに適宜変換すること
が可能となるので、ベクトル化された場合には処理を高
速化することが可能となる。
According to the above-described processing, the array included in the array built-in function can be appropriately converted into a vector code, so that the processing can be speeded up when the vectorization is performed. .

【0008】[0008]

【発明が解決しようとする課題】しかしながら、ベクト
ル化が可能か否かはコンパイル時には不明である場合が
多く、そのような場合には、コンパイラはベクトルコー
ドを生成することができないので、従来通りスカラ処理
が実行されることになり、ハードウエア環境を有効利用
することができない場合があるという問題点があった。
However, it is often unknown at the time of compiling whether vectorization is possible or not. In such a case, the compiler cannot generate a vector code, so that a scalar can be used as before. There is a problem that the processing is executed and the hardware environment cannot be used effectively.

【0009】そこで、コンパイル時に、ベクトル処理の
ための第1のオブジェクトと、スカラ処理のための第2
のオブジェクトと、これら2つのオブジェクトを選択す
るための第3のオブジェクトを生成し、実行時に、第3
のオブジェクトが第1または第2のオブジェクトの何れ
かを選択するようにすることで、以上のような問題点を
解決する方法が提案されている。
Therefore, at the time of compiling, a first object for vector processing and a second object for scalar processing
Object and a third object for selecting these two objects,
A method has been proposed to solve the above-mentioned problem by making the object select either the first object or the second object.

【0010】しかしながら、このような方法では、生成
される実行可能プログラムのサイズが大きくなるという
問題点があった。例えば、生成される配列の次元が不明
である場合には、想定される全ての配列に対応する第1
のオブジェクトを生成する必要があることから、生成さ
れる実行可能プログラムのサイズが大きくなる。
However, such a method has a problem that the size of the generated executable program is increased. For example, if the dimensions of the array to be generated are unknown, the first
, The size of the generated executable program increases.

【0011】また、配列のインデックスがとびとびの値
をとる場合には、ベクトル化が困難であるという問題点
もあった。例えば、3次元配列であるA[3,3,3]
を想定すると、この配列のメモリへの格納形態は、図1
0のようになる(この例では、列優先方式によって格納
されている)。即ち、1次元目のインデックス(括弧内
の左端の値)が1〜3までの値を一巡すると、2次元目
のインデックス(括弧内の中央の値)が1だけインクリ
メントされる。そして、2次元目のインデックスが1〜
3までの値を一巡すると、3次元目の値が1だけインク
リメントされる。この場合、各インデックスは1〜3ま
での全ての値をとり得るので、A[1,1,1]〜A
[3,3,3]の全ての領域に対して要素を格納可能で
ある(図10では要素が格納可能であることを意味する
マーク「○」が全ての領域に付されている)。
Also, when the index of the array takes discrete values, there is another problem that vectorization is difficult. For example, A [3,3,3] which is a three-dimensional array
Assuming that the array is stored in the memory as shown in FIG.
0 (in this example, stored by the column priority method). That is, when the first-dimensional index (the leftmost value in parentheses) goes through the values from 1 to 3, the second-dimensional index (the central value in parentheses) is incremented by one. And the second dimension index is 1
When the value of “3” is cycled, the value of the third dimension is incremented by “1”. In this case, since each index can take all the values from 1 to 3, A [1,1,1] to A [1,1,1]
Elements can be stored in all the areas [3, 3, 3] (in FIG. 10, a mark “「 ”indicating that the elements can be stored is attached to all the areas).

【0012】ところで、配列の宣言時に要素の格納間隔
を指定することが可能とされている場合がある。例え
ば、図10に示すように、3次元配列であるA[1:
3:2,1:3:2,3]では、1次元目と2次元目が
「3つ組式」(1:3:2)によって表現されている。
これは、インデックスが1〜3の間を2毎に増加するこ
とを示している。その結果、1次元目と2次元目のイン
デックスのとり得る値は、“1”,“3”の2種類とな
る。
In some cases, it is possible to specify the storage interval of elements when declaring an array. For example, as shown in FIG. 10, a three-dimensional array A [1:
3: 2, 1: 3: 2, 3], the first dimension and the second dimension are represented by a “triple expression” (1: 3: 2).
This indicates that the index increases from 1 to 3 every two. As a result, the possible values of the first and second dimension indices are two types, “1” and “3”.

【0013】従って、A[1:3:2,1:3:2,
3]の場合、1次元目のインデックスが“1”または
“3”の何れかであり、かつ、2次元目のインデックス
が“1”または“3”の何れかである領域にのみ配列の
要素を格納可能となる。従って、この配列A[1:3:
2,1:3:2,3]の場合では、図10に示すよう
に、とびとびの領域に要素が格納されることになる(図
10ではマーク「○」がとびとびに付されている)。
Therefore, A [1: 3: 2, 1: 3: 2,
In the case of [3], the elements of the array are only in the area where the first dimension index is either “1” or “3” and the second dimension index is either “1” or “3”. Can be stored. Therefore, this sequence A [1: 3:
In the case of [2: 1: 3: 2,3], elements are stored in discrete areas as shown in FIG. 10 (in FIG. 10, marks “○” are discretely marked).

【0014】このようにとびとびの領域に要素が格納さ
れた場合には、ベクトル化処理する上で不都合が生ずる
場合がある。即ち、ベクトル演算部によってベクトル演
算を行う場合には、演算の対象となるベクトル(1次元
配列)が格納されているメモリの先頭アドレスとベクト
ル長(データ長)とによって演算対象を特定する。この
とき、要素が所定の間隔毎に配置されている場合(例え
ば、1置きに配置されている場合)には、その間隔を
「ストライド」として指定する(前述の例では“1”を
ストライドとして指定する)ことによって、ベクトル演
算が可能となる。
When elements are stored in discrete areas in this way, problems may occur in vectorization processing. That is, when the vector operation is performed by the vector operation unit, the operation target is specified by the head address of the memory storing the vector (one-dimensional array) to be operated and the vector length (data length). At this time, if the elements are arranged at predetermined intervals (for example, every other element), the interval is designated as "stride" (in the above example, "1" is used as the stride). By doing so, vector operations can be performed.

【0015】しかしながら、図10に示す例では、要素
同士の配置間隔が一定ではないことから、このような配
列をベクトル演算の対象とすることは困難であるという
問題点があった。
However, in the example shown in FIG. 10, since the arrangement intervals between the elements are not constant, there is a problem that it is difficult to target such an array for the vector operation.

【0016】本発明はこのような点に鑑みてなされたも
のであり、配列組み込み関数を効率的にベクトル処理す
ることを可能とする情報処理装置を提供することを目的
とする。
The present invention has been made in view of such a point, and an object of the present invention is to provide an information processing apparatus capable of efficiently performing vector processing of an array built-in function.

【0017】[0017]

【課題を解決するための手段】本発明では上記課題を解
決するために、図1に示す、ベクトル処理が可能な情報
処理装置において、処理の対象となるプログラムに含ま
れている配列組み込み関数を実行時に検出する配列組み
込み関数検出手段1と、前記配列組み込み関数検出手段
1によって検出された配列組み込み関数に含まれている
配列を解析し、ベクトル化可能な部分を特定するベクト
ル化可能部分特定手段2と、前記ベクトル化可能部分特
定手段2によって特定されたベクトル化可能部分をベク
トル処理するベクトル処理手段5と、を有することを特
徴とする情報処理装置が提供される。
According to the present invention, in order to solve the above-mentioned problems, in an information processing apparatus capable of performing vector processing shown in FIG. 1, an array built-in function included in a program to be processed is used. Array built-in function detecting means 1 to be detected at the time of execution, and vectorizable part specifying means for analyzing an array included in the array built-in function detected by the array built-in function detecting means 1 and specifying a vectorizable part 2 and a vector processing means 5 for performing vector processing on the vectorizable part specified by the vectorizable part specifying means 2.

【0018】ここで、配列組み込み関数検出手段1は、
処理の対象となるプログラムに含まれている配列組み込
み関数を実行時に検出する。ベクトル化可能部分特定手
段2は、配列組み込み関数検出手段1によって検出され
た配列組み込み関数に含まれている配列を解析し、ベク
トル化可能な部分を特定する。ベクトル処理手段5は、
ベクトル化可能部分特定手段2によって特定されたベク
トル化可能部分をベクトル処理する。
Here, the array built-in function detecting means 1
Detects array built-in functions included in the program to be processed at execution time. The vectorizable part specifying means 2 analyzes the sequence included in the array built-in function detected by the array built-in function detecting means 1 and specifies a vectorizable part. The vector processing means 5
The vectorizable portion specified by the vectorizable portion specifying means 2 is subjected to vector processing.

【0019】[0019]

【発明の実施の形態】以下、本発明の実施の形態を図面
を参照して説明する。図1は、本発明の実施の形態の構
成例を示すブロック図である。この図において、配列組
み込み関数検出手段1は、処理の対象となる実行可能プ
ログラムが実行された場合に、実行可能プログラムから
配列組み込み関数を検出する。
Embodiments of the present invention will be described below with reference to the drawings. FIG. 1 is a block diagram illustrating a configuration example of an embodiment of the present invention. In this figure, when an executable program to be processed is executed, an array-embedded function detection unit 1 detects an array-embedded function from the executable program.

【0020】配列組み込み関数種特定手段3は、配列組
み込み関数検出手段1によって検出された配列組み込み
関数の種類を特定する。閾値発生手段4は、配列組み込
み関数種特定手段3によって特定された関数の種類に対
応する閾値を発生する。
The array built-in function type specifying means 3 specifies the type of the array built-in function detected by the array built-in function detecting means 1. The threshold value generating means 4 generates a threshold value corresponding to the type of the function specified by the array built-in function type specifying means 3.

【0021】ベクトル化可能部分特定手段2は、配列組
み込み関数検出手段1によって検出された配列組み込み
関数に含まれている引数配列を解析し、ベクトル化可能
な部分を特定するとともに、閾値発生手段4から供給さ
れた閾値を参照し、ベクトル化可能部分の長さが閾値よ
りも大きい場合にはベクトル処理手段5に供給し、それ
以外の場合にはスカラ処理手段7に供給する。
The vectorizable part specifying means 2 analyzes an argument array included in the array built-in function detected by the array built-in function detecting means 1 to specify a vectorizable part, and a threshold value generating means 4. Is supplied to the vector processing means 5 if the length of the vectorizable portion is larger than the threshold value, and to the scalar processing means 7 otherwise.

【0022】実行環境特定手段6は、プログラムの実行
環境を特定し、ベクトル処理手段5に供給する。ベクト
ル処理手段5は、実行環境特定手段6によって特定され
た環境に応じた処理手続に従って配列読み込み関数をベ
クトル処理する。
The execution environment specifying means 6 specifies the execution environment of the program and supplies it to the vector processing means 5. The vector processing means 5 performs vector processing on the array reading function according to a processing procedure according to the environment specified by the execution environment specifying means 6.

【0023】スカラ処理手段7は、配列読み込み関数に
対応するライブラリを読み出し、配列読み込み関数をス
カラ処理する。次に、以上の実施の形態の動作について
説明する。
The scalar processing means 7 reads a library corresponding to the array read function and performs scalar processing on the array read function. Next, the operation of the above embodiment will be described.

【0024】図2は、以上の実施の形態の全体の動作を
説明するフローチャートである。このフローチャートが
開始されると、以下の処理が実行される。 [S10]配列組み込み関数検出手段1は、実行可能プ
ログラムを入力する。 [S11]ベクトル化可能部分特定手段2は、実行可能
プログラムに含まれている配列組み込み関数を抽出する
とともに、その配列組み込み関数に含まれている配列の
要素のうち、ベクトル化可能な部分を特定する。
FIG. 2 is a flowchart for explaining the overall operation of the above embodiment. When this flowchart is started, the following processing is executed. [S10] The array built-in function detecting means 1 inputs an executable program. [S11] The vectorizable part specifying means 2 extracts an array built-in function included in the executable program and specifies a vectorizable part of the array elements included in the array built-in function. I do.

【0025】なお、この処理の詳細については、図3を
参照して後述する。 [S12]閾値発生手段4は、配列組み込み関数種特定
手段3によって特定された関数の種類に対応する閾値を
発生する。
The details of this process will be described later with reference to FIG. [S12] The threshold value generating means 4 generates a threshold value corresponding to the function type specified by the array built-in function type specifying means 3.

【0026】なお、この処理の詳細については、図5を
参照して後述する。 [S13]ベクトル化可能部分特定手段2は、ステップ
S11において特定したベクトル化可能部分のベクトル
長と閾値とを比較し、ベクトル長が閾値よりも大きい場
合には、ステップS14に進み、それ以外の場合にはス
テップS16に進む。 [S14]ベクトル処理手段5は、実行環境特定手段6
によって特定された実行環境に対応するベクトル化処理
を選択する。
The details of this process will be described later with reference to FIG. [S13] The vectorizable portion specifying means 2 compares the vector length of the vectorizable portion specified in step S11 with a threshold value. If the vector length is larger than the threshold value, the process proceeds to step S14. In this case, the process proceeds to step S16. [S14] The vector processing unit 5 executes the execution environment specifying unit 6
Select the vectorization process corresponding to the execution environment specified by.

【0027】なお、この処理の詳細については、図7を
参照して後述する。 [S15]ベクトル処理手段5は、ベクトル処理を実行
する。 [S16]スカラ処理手段7は、スカラ処理を実行す
る。 [S17]配列組み込み関数検出手段1は、実行可能プ
ログラムの実行が終了したか否かを判定し、実行が終了
した場合には処理を終了し(エンド)、それ以外の場合
にはステップS11に戻って同様の処理を繰り返す。
The details of this process will be described later with reference to FIG. [S15] The vector processing means 5 executes vector processing. [S16] The scalar processing means 7 executes scalar processing. [S17] The array-embedded function detection means 1 determines whether or not the execution of the executable program has been completed. If the execution has been completed, the processing ends (END). Otherwise, the process proceeds to step S11. Return and repeat the same process.

【0028】次に、図3を参照して、図2に示す「ベク
トル化可能部分特定処理」の詳細について説明する。図
3に示す処理では、配列のインデックスがとびとびの値
をとる場合に、配列に格納されている要素のうち、ベク
トル化可能な部分を特定する。このフローチャートが開
始されると、以下の処理が実行される。 [S20]ベクトル化可能部分特定手段2は、配列組み
込み関数検出手段1によって検出された配列組み込み関
数を取得する。 [S21]ベクトル化可能部分特定手段2は、配列組み
込み関数に含まれている配列の次元nが1次元であるか
否かを判定し、1次元である場合にはステップS22に
進み、それ以外の場合にはステップS24に進む。 [S22]ベクトル化可能部分特定手段2は、ベクトル
長を示す変数VLにSIZE[1]の値を設定する。
Next, with reference to FIG. 3, the details of the "vectorizable portion specifying process" shown in FIG. 2 will be described. In the processing shown in FIG. 3, when the index of the array takes discrete values, a vectorizable portion of the elements stored in the array is specified. When this flowchart is started, the following processing is executed. [S20] The vectorizable part specifying unit 2 acquires the array built-in function detected by the array built-in function detecting unit 1. [S21] The vectorizable part specifying means 2 determines whether or not the dimension n of the array included in the array built-in function is one-dimensional. If the dimension n is one-dimensional, the process proceeds to step S22; In the case of, the process proceeds to step S24. [S22] The vectorizable portion specifying unit 2 sets the value of SIZE [1] to the variable VL indicating the vector length.

【0029】ここで、SIZE[x]とは、配列の第x
次元目の要素の要素数を示す。例えば、配列A[4,
5,1]に対して、SIZE[1]=4であり、また、
SIZE[2]=5,SIZE[3]=1である。 [S23]ベクトル化可能部分特定手段2は、配列の次
元を示す変数ADを“1”に設定する。 [S24]ベクトル化可能部分特定手段2は、変数WO
RKにTERM[1]の値を代入する。
Here, SIZE [x] is the x-th of the array.
Indicates the number of elements of the dimension element. For example, the sequence A [4,
SIZE [1] = 4 for [5,1], and
SIZE [2] = 5, SIZE [3] = 1. [S23] The vectorizable part specifying means 2 sets the variable AD indicating the dimension of the array to "1". [S24] The vectorizable part specifying means 2 sets the variable WO
The value of TERM [1] is substituted for RK.

【0030】ここで、TERM[x]とは、配列の第x
次元目のインデックスが1だけ増加した場合に対するメ
モリ上の距離を示す。例えば、3次元配列A[x,y,
z]の場合、TERM[1]は、A[x,y,z]とA
[x+1,y,z]の間の距離を示す。また、TERM
[2]は、A[x,y,z]とA[x,y+1,z]の
間の距離を示す。
Here, TERM [x] is the x-th of the array.
It shows the distance on the memory when the index of the dimension increases by one. For example, a three-dimensional array A [x, y,
z], TERM [1] is A [x, y, z] and A
Shows the distance between [x + 1, y, z]. Also, TERM
[2] indicates the distance between A [x, y, z] and A [x, y + 1, z].

【0031】従って、ステップS24では、変数WOR
Kには、配列の1次元目のインデックスが1だけ増加し
た場合に対するメモリ上の距離(要素のデータ量に対応
する値)が代入される。 [S25]ベクトル化可能部分特定手段2は、変数iを
値1に初期設定する。 [S26]ベクトル化可能部分特定手段2は、変数WO
RKとSIZE[i]とを乗算して得られた値を、変数
WORKに格納する。
Therefore, in step S24, the variable WOR
For K, a distance in the memory (a value corresponding to the data amount of the element) with respect to a case where the index of the first dimension of the array is increased by 1 is substituted. [S25] The vectorizable part specifying means 2 initializes the variable i to a value of 1. [S26] The vectorizable part specifying means 2 sets the variable WO
The value obtained by multiplying RK and SIZE [i] is stored in a variable WORK.

【0032】いま、1回目の処理であるとすると、変数
WORKには1次元目のインデックスが1だけ増加した
場合の距離(各要素のデータ量に対応する値)が格納さ
れており、また、SIZE[1]には配列の1次元方向
の要素数が格納されていることから、これらの積は、2
次元方向の距離に相当することになる。
Assuming that the processing is the first time, the variable WORK stores a distance (a value corresponding to the data amount of each element) when the index of the first dimension is increased by one. Since SIZE [1] stores the number of elements in the one-dimensional direction of the array, their product is 2
This corresponds to the distance in the dimensional direction.

【0033】例えば、図10に示すA[3,3,3]を
例にとると、1回目の処理では変数WORKには、A
[1,1,1]とA[2,1,1]の間の距離が格納さ
れており、SIZE[1]の値は“3”であることか
ら、これらの積は、A[1,1,1]とA[1,2,
1]の距離(=TERM[2])に相当する。 [S27]ベクトル化可能部分特定手段2は、TERM
[i+1]の値と、WORKの値とが等しいか否かを判
定する。その結果、これらが等しい場合には、ステップ
S28に進み、それ以外の場合にはステップS30に進
む。
For example, taking A [3,3,3] shown in FIG. 10 as an example, in the first processing, the variable WORK contains A
The distance between [1,1,1] and A [2,1,1] is stored, and the value of SIZE [1] is “3”. [1,1] and A [1,2,
1] (= TERM [2]). [S27] The vectorizable part specifying unit 2 executes the TERM
It is determined whether or not the value of [i + 1] is equal to the value of WORK. As a result, if they are equal, the process proceeds to step S28; otherwise, the process proceeds to step S30.

【0034】即ち、変数WORKの値は、要素が連続的
に格納されている場合(その次元におけるインデックス
がとびとびの値を有しない場合)には、TERM[i+
1]の値と等しくなることから、その場合にはステップ
S28に進み、それ以外の場合(その次元のインデック
スがとびとびの値を有する場合)には、ステップS30
に進む。 [S28]ベクトル化可能部分特定手段2は、変数iの
値が配列の次元nから“1”を減算した値(n−1)よ
りも小さい場合にはステップS29に進み、それ以外の
場合にはステップS32に進む。 [S29]ベクトル化可能部分特定手段2は、変数iの
値を“1”だけインクリメントしてステップS26に戻
る。 [S30]ベクトル化可能部分特定手段2は、ベクトル
長を示す変数VLに対して、SIZE[1]×SIZE
[2]×・・・×SIZE[i]の値を代入する。
That is, the value of the variable WORK is set to TERM [i + when the elements are stored consecutively (when the index in that dimension has no discrete value).
1], the process proceeds to step S28 in that case, and otherwise (if the dimension index has discrete values), the process proceeds to step S30.
Proceed to. [S28] If the value of the variable i is smaller than the value (n-1) obtained by subtracting "1" from the dimension n of the array, the vectorizable portion specifying means 2 proceeds to step S29. Goes to step S32. [S29] The vectorizable portion specifying means 2 increments the value of the variable i by "1" and returns to step S26. [S30] The vectorizable part specifying unit 2 applies SIZE [1] × SIZE to the variable VL indicating the vector length.
[2] × ... × SIZE [i] is substituted.

【0035】例えば、2回目(i=2)の処理におい
て、TERM[i+1]≠WORKと判定された場合に
は、3次元目のインデックスがとびとびの値を有するの
で、ベクトル長VLとしては、1次元目と2次元目の要
素数の積であるSIZE[1]×SIZE[2]が採用
されることになる。
For example, when TERM [i + 1] ≠ WORK is determined in the second (i = 2) processing, the vector length VL is 1 because the third-dimensional index has discrete values. SIZE [1] × SIZE [2] which is the product of the dimension and the number of elements in the second dimension is adopted.

【0036】一例として、A[3,3,1:3:2]の
場合では、図4に示すように、3次元目のインデックス
が“1”または“3”である領域のみに要素が格納され
ており、要素が連続されて格納されている個数は、
“9”(=3×3)である。従って、この値“9”が、
ベクトル長VLとされる。 [S31]ベクトル化可能部分特定手段2は、配列の次
元を示す変数ADに対して値(n−i)を格納する。
As an example, in the case of A [3,3,1: 3: 2], as shown in FIG. 4, elements are stored only in the area where the third dimension index is "1" or "3". And the number of consecutive elements stored is
“9” (= 3 × 3). Therefore, this value “9” is
The vector length is VL. [S31] The vectorizable portion specifying means 2 stores the value (ni) for the variable AD indicating the dimension of the array.

【0037】図4の例では、i=2の場合にループを離
脱するので、(n−i)=(3−2)=1となり、配列
の次元は“1”となる。即ち、図4において連続して格
納されている要素群を1つのベクトル(1次元配列)と
して扱う。 [S32]ベクトル化可能部分特定手段2は、ベクトル
長を示す変数VLに対して、SIZE[1]×SIZE
[2]×・・・×SIZE[n]の値を代入する。
In the example of FIG. 4, since the loop is released when i = 2, (ni) = (3-2) = 1, and the dimension of the array is "1". That is, a group of elements stored continuously in FIG. 4 is handled as one vector (one-dimensional array). [S32] The vectorizable part specifying unit 2 applies SIZE [1] × SIZE to the variable VL indicating the vector length.
The value of [2] ×... × SIZE [n] is substituted.

【0038】即ち、全ての次元のインデックスが連続で
ある場合には、ベクトル長を示すVLには、SIZE
[1]×SIZE[2]×・・・×SIZE[n]の値
が代入される。例えば、A[3,3,3]の場合には、
変数VLには値“27”(=3×3×3)が代入される
ことになる。 [S33]ベクトル化可能部分特定手段2は、配列の次
元を示す変数ADに対して値“1”を格納する。
That is, when the indices of all the dimensions are continuous, the VL indicating the vector length includes SIZE
The value of [1] × SIZE [2] ×... × SIZE [n] is substituted. For example, in the case of A [3,3,3],
The value “27” (= 3 × 3 × 3) is substituted for the variable VL. [S33] The vectorizable portion specifying means 2 stores the value “1” for the variable AD indicating the dimension of the array.

【0039】即ち、全ての次元のインデックスが連続で
ある場合には、全ての要素を1つのベクトルとして扱う
ので、次元は“1”とされる。以上の処理により、配列
に含まれている要素のうち、ベクトル処理が可能な部分
を特定することが可能となる。
That is, when the indices of all the dimensions are continuous, all the elements are treated as one vector, so that the dimension is set to "1". Through the above processing, it is possible to specify a part that can be subjected to vector processing among the elements included in the array.

【0040】次に、図5を参照して、図2に示す「閾値
発生処理」の詳細について説明する。このフローチャー
トが開始されると、以下の処理が実行される。 [S40]配列組み込み関数種特定手段3は、配列組み
込み関数検出手段1によって検出された組み込み関数の
種類を特定し、閾値発生手段4に通知する。 [S41]閾値発生手段4は、配列組み込み関数種特定
手段3から通知された関数の種類に対応する閾値を図示
せぬテーブルから取得する。そして、元の処理へ復帰
(リターン)する。
Next, details of the "threshold generation process" shown in FIG. 2 will be described with reference to FIG. When this flowchart is started, the following processing is executed. [S40] The array built-in function type specifying unit 3 specifies the type of the built-in function detected by the array built-in function detecting unit 1, and notifies the threshold generating unit 4 of the type. [S41] The threshold value generating means 4 acquires a threshold value corresponding to the type of the function notified from the array built-in function type specifying means 3 from a table (not shown). Then, the process returns to the original process.

【0041】図6は、閾値発生手段4が参照するテーブ
ルの一例である。この例では、関数が配列の総和演算を
実行する場合には、閾値は“10”とされ、また、最大
値検索、配列要素シフト、または、配列複写の場合に
は、閾値はそれぞれ“5”,“3”,“2”とされる。
このような閾値は、情報処理装置が実行可能な全ての配
列組み込み関数に対して適当な数値を各々設定する。
FIG. 6 is an example of a table referred to by the threshold value generating means 4. In this example, the threshold value is "10" when the function executes the summation operation of the array, and the threshold value is "5" in the case of the maximum value search, array element shift, or array copy. , “3” and “2”.
As such a threshold, an appropriate numerical value is set for each of the array built-in functions executable by the information processing apparatus.

【0042】次に、図7を参照して、図2に示す「ベク
トル化処理選択処理」の詳細について説明する。このフ
ローチャートが開始されると、以下の処理が実行され
る。 [S50]実行環境特定手段6は、ハードウエア環境を
特定し、ベクトル処理手段5に通知する。
Next, with reference to FIG. 7, the details of the “vectorization processing selection processing” shown in FIG. 2 will be described. When this flowchart is started, the following processing is executed. [S50] The execution environment specifying means 6 specifies the hardware environment and notifies the vector processing means 5.

【0043】なお、ハードウエア環境は、例えば、ベク
トル演算部の処理能力その他に応じて分類されたハード
ウエアの種類(例えば、ハードウエアA、ハードウエア
B等)の中から対応するものが選択される。 [S51]ベクトル処理手段5は、実行環境特定手段6
から通知されたハードウエア環境に対応するベクトル化
処理(プログラム)を選択し、元の処理に復帰(リター
ン)する。
As the hardware environment, for example, a corresponding hardware environment is selected from hardware types (for example, hardware A, hardware B, etc.) classified according to the processing capability of the vector operation unit and the like. You. [S51] The vector processing unit 5 executes the execution environment specifying unit 6
Selects the vectorization processing (program) corresponding to the hardware environment notified from the above, and returns to the original processing (return).

【0044】例えば、ベクトル処理手段5は、図8に示
すような対応テーブルを有しており、実行環境特定手段
6から、自己のハードウエアがハードウエアAである旨
が通知された場合には、対応する処理であるベクトル化
処理Aを選択する。なお、ベクトル化処理A〜Dは、そ
れぞれ、ハードウエアA〜Dに最適な処理である。そし
て、元の処理に復帰して、ベクトル処理が実行されるこ
とになる。
For example, the vector processing means 5 has a correspondence table as shown in FIG. 8, and when the execution environment specifying means 6 notifies that its hardware is hardware A, , A corresponding vectorization process A is selected. Note that the vectorization processes A to D are processes optimal for hardware A to D, respectively. Then, returning to the original processing, the vector processing is executed.

【0045】以上の処理によれば、配列組み込み関数を
含む実行可能プログラムを実行した場合において、配列
組み込み関数に含まれている配列の要素のうち、ベクト
ル化可能な部分を特定するとともに、その処理の種類に
応じてベクトル化処理が有効であるか否かを判定し、有
効であると判定された場合には、実行下のハードウエア
環境に適合したベクトル処理を選択して、ベクトル化を
行い、ベクトル処理を実行するようにしたので、コンパ
イル時にその形態が決定されない配列に対しても、ベク
トル処理を行うことが可能となるので、ハードウエア資
産を有効に利用することが可能となる。
According to the above processing, when an executable program including an array built-in function is executed, a vectorizable part of the elements of the array included in the array built-in function is specified and the processing is performed. It is determined whether or not the vectorization processing is valid according to the type.If it is determined that the vectorization processing is valid, a vector processing suitable for the hardware environment under execution is selected and vectorization is performed. , Vector processing is executed, so that vector processing can be performed even for an array whose form is not determined at the time of compilation, and hardware resources can be effectively used.

【0046】また、ベクトル処理が有効ではないと判定
された場合には、スカラ処理を実行することから、配列
の形態、ハードウエア環境、または、関数の種類に応じ
て、最適な処理方法を選択することが可能となる。
If it is determined that the vector processing is not valid, the scalar processing is executed. Therefore, the optimum processing method is selected according to the form of the array, the hardware environment, or the type of the function. It is possible to do.

【0047】なお、上記の処理機能は、コンピュータに
よって実現することができる。その場合、情報処理装置
が有すべき機能の処理内容は、コンピュータで読み取り
可能な記録媒体に記録されたプログラムに記述されてお
り、このプログラムをコンピュータで実行することによ
り、上記処理がコンピュータで実現される。コンピュー
タで読み取り可能な記録媒体としては、磁気記録装置や
半導体メモリ等がある。
The above processing functions can be realized by a computer. In this case, the processing contents of the functions that the information processing apparatus should have are described in a program recorded on a computer-readable recording medium, and the above processing is realized by the computer by executing the program on the computer. Is done. Examples of the computer-readable recording medium include a magnetic recording device and a semiconductor memory.

【0048】市場に流通させる場合には、CD−ROM
(Compact Disk Read Only Memory)やフロッピーディス
ク等の可搬型記録媒体にプログラムを格納して流通させ
たり、ネットワークを介して接続されたコンピュータの
記憶装置に格納しておき、ネットワークを通じて他のコ
ンピュータに転送することもできる。コンピュータで実
行する際には、コンピュータ内のハードディスク装置等
にプログラムを格納しておき、メインメモリにロードし
て実行するようにすればよい。
When distributing in the market, a CD-ROM
(Compact Disk Read Only Memory) or a program stored in a portable recording medium such as a floppy disk and distributed, or stored in a storage device of a computer connected via a network and transferred to another computer via the network You can also. When the program is executed by the computer, the program may be stored in a hard disk device or the like in the computer, loaded into the main memory and executed.

【0049】[0049]

【発明の効果】以上説明したように本発明では、ベクト
ル処理が可能な情報処理装置において、処理の対象とな
るプログラムに含まれている配列組み込み関数を実行時
に検出する配列組み込み関数検出手段と、配列組み込み
関数検出手段によって検出された配列組み込み関数に含
まれている配列を解析し、ベクトル化可能な部分を特定
するベクトル化可能部分特定手段と、ベクトル化可能部
分特定手段によって特定されたベクトル化可能部分をベ
クトル処理するベクトル処理手段と、を有するようにし
たので、コンパイル時に形態が不確定である配列に対し
ても、ベクトル処理を実行することが可能となるので、
ハードウエア資産を有効に活用することが可能となる。
As described above, according to the present invention, in an information processing apparatus capable of vector processing, an array built-in function detecting means for detecting an array built-in function included in a program to be processed at the time of execution, Vectorizable part specifying means for analyzing an array included in the array built-in function detected by the array built-in function detecting means and specifying a vectorizable part, and vectorization specified by the vectorizable part specifying means And vector processing means for performing vector processing on possible parts, so that it becomes possible to execute vector processing even for an array whose form is uncertain at the time of compilation.
Hardware resources can be used effectively.

【図面の簡単な説明】[Brief description of the drawings]

【図1】本発明の実施の形態の構成例を示すブロック図
である。
FIG. 1 is a block diagram illustrating a configuration example of an embodiment of the present invention.

【図2】図1に示す実施の形態の全体の動作を説明する
フローチャートである。
FIG. 2 is a flowchart for explaining the overall operation of the embodiment shown in FIG. 1;

【図3】図2に示す「ベクトル化可能部分特定処理」の
詳細を説明するフローチャートである。
FIG. 3 is a flowchart illustrating details of a “vectorizable portion specifying process” illustrated in FIG. 2;

【図4】インデックスがとびとびの値を有する配列にお
ける要素の格納態様の一例を示す図である。
FIG. 4 is a diagram illustrating an example of a storage mode of elements in an array whose index has discrete values.

【図5】図2に示す「閾値発生処理」の詳細を説明する
フローチャートである。
FIG. 5 is a flowchart illustrating details of a “threshold generation process” illustrated in FIG. 2;

【図6】閾値発生手段が参照するテーブルの一例であ
る。
FIG. 6 is an example of a table referred to by a threshold generation unit.

【図7】図2に示す「ベクトル化処理選択処理」の詳細
を説明するフローチャートである。
FIG. 7 is a flowchart illustrating details of a “vectorization process selection process” illustrated in FIG. 2;

【図8】ベクトル処理手段が参照するテーブルの一例で
ある。
FIG. 8 is an example of a table referred to by a vector processing unit.

【図9】従来における配列のベクトル化判定処理の一例
を説明するフローチャートである。
FIG. 9 is a flowchart illustrating an example of a conventional array vectorization determination process.

【図10】インデックスが連続の値を有する配列と、と
びとびの値を有する配列における要素の格納態様の一例
を示す図である。
FIG. 10 is a diagram illustrating an example of an array in which indices have continuous values, and an example of a storage mode of elements in an array having discrete values.

【符号の説明】[Explanation of symbols]

1 配列組み込み関数検出手段 2 ベクトル化可能部分特定手段 3 配列組み込み関数種特定手段 4 閾値発生手段 5 ベクトル処理手段 6 実行環境特定手段 7 スカラ処理手段 DESCRIPTION OF SYMBOLS 1 Array built-in function detecting means 2 Vectorizable part specifying means 3 Array built-in function type specifying means 4 Threshold value generating means 5 Vector processing means 6 Execution environment specifying means 7 Scalar processing means

Claims (5)

【特許請求の範囲】[Claims] 【請求項1】 ベクトル処理が可能な情報処理装置にお
いて、 処理の対象となるプログラムに含まれている配列組み込
み関数を実行時に検出する配列組み込み関数検出手段
と、 前記配列組み込み関数検出手段によって検出された配列
組み込み関数に含まれている配列を解析し、ベクトル化
可能な部分を特定するベクトル化可能部分特定手段と、 前記ベクトル化可能部分特定手段によって特定されたベ
クトル化可能部分をベクトル処理するベクトル処理手段
と、 を有することを特徴とする情報処理装置。
1. An information processing apparatus capable of performing vector processing, comprising: an array built-in function detecting unit that detects an array built-in function included in a program to be processed at the time of execution; Vectorizable part specifying means for analyzing an array included in the array built-in function and specifying a vectorizable part, and a vector for vector-processing the vectorizable part specified by the vectorizable part specifying means An information processing apparatus comprising: processing means.
【請求項2】 前記ベクトル化可能部分特定手段は、配
列に格納されている要素が、連続的または一定の間隔毎
にされている部分をひとまとめにしてベクトル化可能部
分として特定することを特徴とする請求項1記載の情報
処理装置。
2. A method according to claim 1, wherein said vectorizable portion specifying means specifies, as a vectorizable portion, the elements stored in the array that collectively include portions that are continuous or at regular intervals. The information processing apparatus according to claim 1, wherein
【請求項3】 前記配列組み込み関数の種類を特定する
配列組み込み関数種特定手段と、 前記配列組み込み関数種特定手段によって特定された関
数の種類に対応する閾値を発生する閾値発生手段と、 前記ベクトル化可能部分特定手段によって特定されたベ
クトル化可能部分のベクトル長が前記閾値を下回る場合
には、スカラ処理を行うスカラ処理手段と、 を更に有することを特徴とする請求項1記載の情報処理
装置。
3. An array built-in function type specifying unit that specifies a type of the array built-in function; a threshold generation unit that generates a threshold corresponding to the type of the function specified by the array built-in function type specifying unit; 2. The information processing apparatus according to claim 1, further comprising: scalar processing means for performing scalar processing when the vector length of the vectorizable part specified by the convertible part specifying means is smaller than the threshold. .
【請求項4】 前記プログラムの実行環境を特定する実
行環境特定手段を更に有し、 前記ベクトル処理手段は、前記実行環境特定手段によっ
て特定された環境に応じた処理手続に従ってベクトル処
理を実行することを特徴とする請求項1記載の情報処理
装置。
4. An execution environment specifying means for specifying an execution environment of the program, wherein the vector processing means executes vector processing according to a processing procedure corresponding to the environment specified by the execution environment specification means. The information processing apparatus according to claim 1, wherein:
【請求項5】 ベクトル処理が可能なコンピュータにお
いて実行されるプログラムを記録したコンピュータ読み
取り可能な記録媒体において、 コンピュータを、 処理の対象となるプログラムに含まれている配列組み込
み関数を実行時に検出する配列組み込み関数検出手段、 前記配列組み込み関数検出手段によって検出された配列
組み込み関数に含まれている配列を解析し、ベクトル化
可能な部分を特定するベクトル化可能部分特定手段、 前記ベクトル化可能部分特定手段によって特定されたベ
クトル化可能部分をベクトル処理するベクトル処理手
段、 として機能させるプログラムを記録したコンピュータ読
み取り可能な記録媒体。
5. A computer-readable recording medium on which a program to be executed by a computer capable of vector processing is recorded, wherein the computer detects an array built-in function included in the program to be processed at the time of execution. Built-in function detection means, Vectorizable part specifying means for analyzing an array included in the array built-in function detected by the array built-in function detection means, and specifying a vectorizable part, The vectorizable part specifying means And a vector processing means for performing vector processing on the vectorizable portion specified by the computer.
JP10326494A 1998-11-17 1998-11-17 Information processor and record medium Pending JP2000148731A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP10326494A JP2000148731A (en) 1998-11-17 1998-11-17 Information processor and record medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP10326494A JP2000148731A (en) 1998-11-17 1998-11-17 Information processor and record medium

Publications (1)

Publication Number Publication Date
JP2000148731A true JP2000148731A (en) 2000-05-30

Family

ID=18188463

Family Applications (1)

Application Number Title Priority Date Filing Date
JP10326494A Pending JP2000148731A (en) 1998-11-17 1998-11-17 Information processor and record medium

Country Status (1)

Country Link
JP (1) JP2000148731A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB2406816A (en) * 2003-10-10 2005-04-13 Bosch Gmbh Robert Dust seal in a hand-held eccentric grinding tool

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB2406816A (en) * 2003-10-10 2005-04-13 Bosch Gmbh Robert Dust seal in a hand-held eccentric grinding tool
GB2406816B (en) * 2003-10-10 2005-11-30 Bosch Gmbh Robert Eccentric hand-held grinding machine tool

Similar Documents

Publication Publication Date Title
US7240343B2 (en) System and method for handling an exception in a program
US6550059B1 (en) Method for generating optimized vector instructions from high level programming languages
JP4339907B2 (en) Optimal code generation method and compiling device for multiprocessor
US5598561A (en) Optimizing compiler which generates multiple instruction streams to be executed in parallel
US20020095666A1 (en) Program optimization method, and compiler using the same
JP4118456B2 (en) Program language processing system, code optimization method, and machine-readable storage medium
JP2001167060A (en) Task paralleling method
JP2004038225A (en) Compiler program and compiling method
JP5966509B2 (en) Program, code generation method, and information processing apparatus
EP1164477A2 (en) A loop optimization method and a compiler
US20040025151A1 (en) Method for improving instruction selection efficiency in a DSP/RISC compiler
JP2000148731A (en) Information processor and record medium
Coons et al. Feature selection and policy optimization for distributed instruction placement using reinforcement learning
Ayguade et al. Detecting and using affinity in an automatic data distribution tool
US20070011440A1 (en) Processor and processing method
KR20150040663A (en) Method and Apparatus for instruction scheduling using software pipelining
CN114385180A (en) Data processing method, device and equipment and computer storage medium
JPH1040112A (en) Dynamic information utilization type program optimizing device
US6055371A (en) Compile device, compile method and recording medium for recording compiler
Zegarra et al. Automatic scan parallelization in openmp
Tayeb et al. Autovesk: Automatic vectorized code generation from unstructured static kernels using graph transformations
JP3817073B2 (en) Memory access processing device, memory access processing system, and recording medium
JP3152194B2 (en) Compiling device, compiling method, and recording medium recording compiler
Merouani et al. Progress Report: A Deep Learning Guided Exploration of Affine Unimodular Loop Transformations
Connors et al. Adaptive OpenCL (ACL) execution in GPU architectures

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20040723

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20040726

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20060921

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20060926

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20061127

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20070612