Commit ebf4e5a3 by Jammy Zhou Committed by Tianqi Chen

Additional mali target support (#794)

* Add Mali target support to tvm.target.create

* Add Mali target support in codegen
parent 742669a2
......@@ -73,6 +73,9 @@ EXPORT Target metal();
/*! \return A target for rasp */
EXPORT Target rasp();
/*! \return A target for Mali */
EXPORT Target mali();
/*! \return A target for stackvm */
EXPORT Target stackvm();
......
......@@ -81,6 +81,7 @@ class Target(object):
- :any:`tvm.target.rasp` create raspberry pi target
- :any:`tvm.target.cuda` create CUDA target
- :any:`tvm.target.rocm` create ROCM target
- :any:`tvm.target.mali` create Mali target
"""
current = None
......@@ -306,6 +307,8 @@ def create(target_str):
device_name = item.split("=")[1]
if device_name == "rasp":
return rasp(arr[1:])
if device_name == "mali":
return mali(arr[1:])
return Target(arr[0], arr[1:])
......
......@@ -70,7 +70,8 @@ Target Target::create(const std::string& target_str) {
auto result = device_name == "rasp" ?
target::rasp() :
TargetFromName(target_name);
(device_name == "mali" ? target::mali() :
TargetFromName(target_name));
std::string item;
while (ss >> item) {
......@@ -116,6 +117,15 @@ Target rasp() {
return Target("llvm", kDLCPU, 512, 1, keys, options);
}
Target mali() {
std::unordered_set<std::string> keys({ "rocm", "gpu" });
std::vector<std::string> options({
"-device=mali"
});
return Target("opencl", kDLOpenCL, 256, 1, keys, options);
}
Target stackvm() {
std::unordered_set<std::string> keys({ "stackvm", "cpu" });
std::vector<std::string> options;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment