Commit 8d73a5c1 by Tianqi Chen Committed by GitHub

[CODEGEN] Fix Metal codegen when storage scope is needed (#469)

parent a85ec885
...@@ -142,6 +142,10 @@ std::string CodeGenC::GetBufferRef( ...@@ -142,6 +142,10 @@ std::string CodeGenC::GetBufferRef(
os << "*)("; os << "*)(";
if (!HandleTypeMatch(buffer, t.element_of())) { if (!HandleTypeMatch(buffer, t.element_of())) {
os << '('; os << '(';
if (scope.length() != 0) {
PrintStorageScope(scope, os);
}
os << ' ';
PrintType(t.element_of(), os); PrintType(t.element_of(), os);
os << "*)"; os << "*)";
} }
......
...@@ -192,6 +192,8 @@ void CodeGenMetal::PrintStorageScope( ...@@ -192,6 +192,8 @@ void CodeGenMetal::PrintStorageScope(
os << "device"; os << "device";
} else if (scope == "shared") { } else if (scope == "shared") {
os << "threadgroup"; os << "threadgroup";
} else {
os << "thread";
} }
} }
......
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