-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support private half vectors and change ocl type of half from short t…
…o object
- Loading branch information
Showing
12 changed files
with
361 additions
and
14 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
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
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
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
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
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
27 changes: 27 additions & 0 deletions
27
...c/manchester/tornado/drivers/opencl/graal/phases/TornadoHalfFloatConstantReplacement.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,27 @@ | ||
package uk.ac.manchester.tornado.drivers.opencl.graal.phases; | ||
|
||
import org.graalvm.compiler.nodes.GraphState; | ||
import org.graalvm.compiler.nodes.StructuredGraph; | ||
import org.graalvm.compiler.nodes.ValueNode; | ||
import org.graalvm.compiler.phases.Phase; | ||
import uk.ac.manchester.tornado.runtime.graal.HalfFloatConstant; | ||
|
||
import java.util.Optional; | ||
|
||
public class TornadoHalfFloatConstantReplacement extends Phase { | ||
|
||
@Override | ||
public Optional<NotApplicable> notApplicableTo(GraphState graphState) { | ||
return ALWAYS_APPLICABLE; | ||
} | ||
|
||
protected void run(StructuredGraph graph) { | ||
|
||
for (HalfFloatConstant halfFloatConstant : graph.getNodes().filter(HalfFloatConstant.class)) { | ||
ValueNode input = halfFloatConstant.getValue(); | ||
halfFloatConstant.replaceAtUsages(input); | ||
halfFloatConstant.safeDelete(); | ||
} | ||
|
||
} | ||
} |
Oops, something went wrong.