Add a name to ScriptGroup2.Builder.create method
The name is not used in any meaningful way yet, but would be used to name the file for generated code for fused kernels in other coming CLs. A script group name cannot be null or empty, or longer than 100 characters. It can only contain letters, digits, '-', or '_'. Change-Id: I95fdbf58e6689da91ca98c2057dfa1a803d3b27b
This commit is contained in:
@@ -412,7 +412,11 @@ public class ScriptGroup2 extends BaseObj {
|
||||
return addInvoke(invoke, args.toArray(), bindingMap);
|
||||
}
|
||||
|
||||
public ScriptGroup2 create(Future... outputs) {
|
||||
public ScriptGroup2 create(String name, Future... outputs) {
|
||||
if (name == null || name.isEmpty() || name.length() > 100 ||
|
||||
!name.equals(name.replaceAll("[^a-zA-Z0-9-]", "_"))) {
|
||||
throw new RSIllegalArgumentException("invalid script group name");
|
||||
}
|
||||
ScriptGroup2 ret = new ScriptGroup2(mRS, mClosures, mInputs, outputs);
|
||||
return ret;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user