-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
34 changed files
with
2,240 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<classpath> | ||
<classpathentry kind="src" path="src"/> | ||
<classpathentry kind="src" path="resources"/> | ||
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/> | ||
<classpathentry combineaccessrules="false" kind="src" path="/MatlabToCLV2"/> | ||
<classpathentry combineaccessrules="false" kind="src" path="/SpecsUtils"/> | ||
<classpathentry combineaccessrules="false" kind="src" path="/MatisseLib"/> | ||
<classpathentry combineaccessrules="false" kind="src" path="/MatisseLibTests"/> | ||
<classpathentry combineaccessrules="false" kind="src" path="/jOptions"/> | ||
<classpathentry combineaccessrules="false" kind="src" path="/CIR"/> | ||
<classpathentry combineaccessrules="false" kind="src" path="/MatlabProcessor"/> | ||
<classpathentry combineaccessrules="false" kind="src" path="/MatlabIR"/> | ||
<classpathentry combineaccessrules="false" kind="src" path="/MatisseInterface"/> | ||
<classpathentry combineaccessrules="false" kind="src" path="/MatlabToCLib"/> | ||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> | ||
<classpathentry kind="output" path="bin"/> | ||
</classpath> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<projectDescription> | ||
<name>MatlabToCLV2Tests</name> | ||
<comment></comment> | ||
<projects> | ||
</projects> | ||
<buildSpec> | ||
<buildCommand> | ||
<name>org.eclipse.jdt.core.javabuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
</buildSpec> | ||
<natures> | ||
<nature>org.eclipse.jdt.core.javanature</nature> | ||
<nature>org.apache.ivyde.eclipse.ivynature</nature> | ||
</natures> | ||
</projectDescription> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
eclipse.preferences.version=1 | ||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled | ||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 | ||
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve | ||
org.eclipse.jdt.core.compiler.compliance=1.8 | ||
org.eclipse.jdt.core.compiler.debug.lineNumber=generate | ||
org.eclipse.jdt.core.compiler.debug.localVariable=generate | ||
org.eclipse.jdt.core.compiler.debug.sourceFile=generate | ||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error | ||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error | ||
org.eclipse.jdt.core.compiler.source=1.8 |
14 changes: 14 additions & 0 deletions
14
MatlabToCLV2Tests/resources/directive/blockbuilder/functionwide.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
Function test | ||
block #0: | ||
line 1 | ||
line 2 | ||
A$1 = arg 0 | ||
line 3 | ||
A$2 = arg 1 | ||
line 4 | ||
parallel_block schedule(direct) sum_reduction_strategy(simple) #1, #2 | ||
block #1: | ||
A$3 = A$1 | ||
line 5 | ||
y$ret = A$2 | ||
block #2: |
15 changes: 15 additions & 0 deletions
15
MatlabToCLV2Tests/resources/directive/blockbuilder/functionwide_parameter.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
Function test | ||
block #0: | ||
line 2 | ||
A$1 = arg 0 | ||
line 3 | ||
A$2 = arg 1 | ||
line 1 | ||
$fixed_work_groups$1 = 4 | ||
parallel_block schedule(fixed_work_groups_sequential, $fixed_work_groups$1) sum_reduction_strategy(simple) #1, #2 | ||
block #1: | ||
line 4 | ||
A$3 = A$1 | ||
line 5 | ||
y$ret = A$2 | ||
block #2: |
16 changes: 16 additions & 0 deletions
16
MatlabToCLV2Tests/resources/directive/blockbuilder/functionwidewithbranch.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
Function test | ||
block #0: | ||
line 1 | ||
line 3 | ||
A$1 = arg 0 | ||
parallel_block schedule(direct) sum_reduction_strategy(simple) #4, #5 | ||
block #1: | ||
% If | ||
block #2: | ||
% Else | ||
block #3: | ||
% End if | ||
A$3 = A$1 | ||
block #4: | ||
branch A$1, #1, #2, #3 | ||
block #5: |
15 changes: 15 additions & 0 deletions
15
MatlabToCLV2Tests/resources/directive/blockbuilder/functionwidewithfor.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
Function test | ||
block #0: | ||
line 1 | ||
line 3 | ||
A$1 = arg 0 | ||
parallel_block schedule(direct) sum_reduction_strategy(simple) #3, #4 | ||
block #1: | ||
% For | ||
A$for = phi #3:A$1, #1:A$for | ||
block #2: | ||
% End for | ||
A$ret = phi #3:A$1, #1:A$for | ||
block #3: | ||
for A$1, A$1, A$1, #1, #2 | ||
block #4: |
14 changes: 14 additions & 0 deletions
14
MatlabToCLV2Tests/resources/directive/blockbuilder/nestedregion.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
Function test | ||
block #0: | ||
A$1 = arg 0 | ||
parallel_block schedule(direct) sum_reduction_strategy(simple) #4, #5 | ||
block #1: | ||
% If | ||
block #2: | ||
% Else | ||
block #3: | ||
% End if | ||
block #4: | ||
branch A$1, #1, #2, #3 | ||
block #5: | ||
A$3 = A$1 |
8 changes: 8 additions & 0 deletions
8
MatlabToCLV2Tests/resources/directive/blockbuilder/region.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Function test | ||
block #0: | ||
A$1 = arg 0 | ||
parallel_block schedule(direct) sum_reduction_strategy(simple) #1, #2 | ||
block #1: | ||
A$2 = A$1 | ||
block #2: | ||
A$3 = A$2 |
8 changes: 8 additions & 0 deletions
8
MatlabToCLV2Tests/resources/optimizer/gpusvmelimination/disparity_3_bug.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
block #0: | ||
$one$1 = 1 | ||
$arg$1 = arg 0 | ||
$mat$1 = call matisse_new_array_from_dims [DynamicMatrixType(DOUBLE weak, shape=[Matrix Shape: [1, -1], Dims: 1])] $one$1, $arg$1 | ||
$mat_gpu$1 = copy_to_gpu $mat$1 | ||
$mat_gpu$2 = copy_to_gpu $mat$1 | ||
invoke_kernel kernel1 [], $mat_gpu$1, $mat_gpu$2 | ||
$mat$2 = complete_reduction MATRIX_SET $mat_gpu$2, null, $mat$1 |
10 changes: 10 additions & 0 deletions
10
MatlabToCLV2Tests/resources/optimizer/gpusvmelimination/use_svm_then_copy_to_gpu.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
block #0: | ||
$int$1 = 1234 | ||
$mat$1 = call matisse_new_array_from_dims [DynamicMatrixType(DOUBLE weak, shape=[Matrix Shape: [1234, 1234], Dims: 2])] $int$1, $int$1 | ||
$begin$1 = 1 | ||
$numel_result$1 = call numel [INT (1522756)] $mat$1 | ||
$value$1 = 0 | ||
$mat_gpu$1 = copy_to_gpu $mat$1 | ||
set_gpu_range $mat_gpu$1, $begin$1, $numel_result$1, $value$1 | ||
$mat$2 = complete_reduction MATRIX_SET $mat_gpu$1, null, $mat$1 | ||
$buffer$1 = copy_to_gpu $mat$2 |
7 changes: 7 additions & 0 deletions
7
...ToCLV2Tests/resources/optimizer/gpusvmelimination/use_svm_then_return_no_added_copies.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
block #0: | ||
$int$1 = 1234 | ||
$mat$1 = call matisse_new_array_from_dims [DynamicMatrixType(DOUBLE weak, shape=[Matrix Shape: [1234, 1234], Dims: 2])] $int$1, $int$1 | ||
$begin$1 = 1 | ||
$numel_result$1 = call numel [INT (1522756)] $mat$1 | ||
$value$1 = 0 | ||
mat$ret = set_gpu_range $mat$1, $begin$1, $numel_result$1, $value$1 |
5 changes: 5 additions & 0 deletions
5
MatlabToCLV2Tests/resources/optimizer/redundantcopyforsize/end.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
block #0: | ||
arg$1 = arg 0 | ||
arg$2 = arg 0 | ||
out$1 = complete_reduction MATRIX_SET arg$2, null, arg$1 | ||
numel$1 = end arg$1, 0, 1 |
5 changes: 5 additions & 0 deletions
5
MatlabToCLV2Tests/resources/optimizer/redundantcopyforsize/ret_name_preservation.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
block #0: | ||
arg$1 = arg 0 | ||
arg$2 = arg 0 | ||
result$ret = complete_reduction MATRIX_SET arg$2, null, arg$1 | ||
numel$1 = untyped_call numel result$ret |
5 changes: 5 additions & 0 deletions
5
MatlabToCLV2Tests/resources/optimizer/redundantcopyforsize/simple.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
block #0: | ||
arg$1 = arg 0 | ||
arg$2 = arg 0 | ||
out$1 = complete_reduction MATRIX_SET arg$2, null, arg$1 | ||
numel$1 = untyped_call numel arg$1 |
20 changes: 20 additions & 0 deletions
20
MatlabToCLV2Tests/resources/optimizer/setreductionbuffer/loop/mid_if.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
block #0: | ||
$m$1 = arg 0 | ||
$buf$1 = arg 1 | ||
arg$1 = arg 2 | ||
$one$1 = 1 | ||
$m$2 = complete_reduction MATRIX_SET $buf$1, null, $m$1 | ||
for $one$1, $one$1, $arg$1, #1, #2 | ||
block #1: | ||
$m$3 = phi #0:$m$2, #5:$m$4 | ||
branch $one$1, #3, #4, #5 | ||
block #2: | ||
$m$5 = phi #0:$m$2, #5:$m$4 | ||
$result$1 = $buf$1 | ||
block #3: | ||
|
||
block #4: | ||
|
||
block #5: | ||
$test$1 = $buf$1 | ||
$m$4 = complete_reduction MATRIX_SET $buf$1, null, $m$3 |
18 changes: 18 additions & 0 deletions
18
MatlabToCLV2Tests/resources/optimizer/setreductionbuffer/loop/mid_loop.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
block #0: | ||
$m$1 = arg 0 | ||
$buf$1 = arg 1 | ||
arg$1 = arg 2 | ||
$one$1 = 1 | ||
$m$2 = complete_reduction MATRIX_SET $buf$1, null, $m$1 | ||
for $one$1, $one$1, $arg$1, #1, #2 | ||
block #1: | ||
$m$3 = phi #0:$m$2, #4:$m$4 | ||
for $one$1, $one$1, $one$1, #3, #4 | ||
block #2: | ||
$m$5 = phi #0:$m$2, #4:$m$4 | ||
$result$1 = $buf$1 | ||
block #3: | ||
|
||
block #4: | ||
$test$1 = $buf$1 | ||
$m$4 = complete_reduction MATRIX_SET $buf$1, null, $m$3 |
14 changes: 14 additions & 0 deletions
14
MatlabToCLV2Tests/resources/optimizer/setreductionbuffer/loop/simple.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
block #0: | ||
$m$1 = arg 0 | ||
$buf$1 = arg 1 | ||
arg$1 = arg 2 | ||
$one$1 = 1 | ||
$m$2 = complete_reduction MATRIX_SET $buf$1, null, $m$1 | ||
for $one$1, $one$1, $arg$1, #1, #2 | ||
block #1: | ||
$m$3 = phi #0:$m$2, #1:$m$4 | ||
$test$1 = $buf$1 | ||
$m$4 = complete_reduction MATRIX_SET $buf$1, null, $m$3 | ||
block #2: | ||
$m$5 = phi #0:$m$2, #1:$m$4 | ||
$result$1 = $buf$1 |
5 changes: 5 additions & 0 deletions
5
MatlabToCLV2Tests/resources/optimizer/setreductionbuffer/sequential/simple.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
block #0: | ||
arg$1 = arg 0 | ||
arg$2 = arg 1 | ||
$mat$1 = complete_reduction MATRIX_SET arg$1, null, arg$2 | ||
$stuff$1 = arg$1 |
35 changes: 35 additions & 0 deletions
35
MatlabToCLV2Tests/src/org/specs/matlabtocl/v2/tests/CLTestUtils.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/** | ||
* Copyright 2017 SPeCS. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on | ||
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations under the License. under the License. | ||
*/ | ||
|
||
package org.specs.matlabtocl.v2.tests; | ||
|
||
import java.util.Arrays; | ||
import java.util.HashMap; | ||
|
||
import org.specs.matlabtocl.v2.codegen.ReductionType; | ||
import org.specs.matlabtocl.v2.codegen.reductionstrategies.SumReductionStrategy; | ||
import org.specs.matlabtocl.v2.ssa.ParallelRegionSettings; | ||
import org.specs.matlabtocl.v2.ssa.ScheduleStrategy; | ||
|
||
public class CLTestUtils { | ||
public static ParallelRegionSettings buildDummySettings() { | ||
ParallelRegionSettings settings = new ParallelRegionSettings(); | ||
|
||
settings.schedule = ScheduleStrategy.DIRECT; | ||
settings.reductionStrategies = new HashMap<>(); | ||
settings.reductionStrategies.put(ReductionType.SUM, | ||
Arrays.asList(SumReductionStrategy.SIMPLE_SUM_REDUCTION.buildInstance())); | ||
|
||
return settings; | ||
} | ||
} |
Oops, something went wrong.