-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DFCxx kernel instantiation #52
base: master
Are you sure you want to change the base?
Conversation
@@ -28,6 +28,10 @@ class IO { | |||
|
|||
DFVariable inputScalar(const std::string &name, const DFType &type); | |||
|
|||
DFVariable hollow(const DFType &type); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is "hollow" synonym here? What does this method do exactly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's an unconnected node without specific operation behind it. Currently it can only be used to be bound to another kernel's output. By the end of kernel's construction there mustn't be any nodes like that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hollow -> unconnected?
hollow -> dummy?
It would be good to have more describing name for the method here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I get it, but Unconnected
- too long; Dummy
- too confusing. I am going to check MaxCompiler docs on how they call such things.
UPD: MaxCompiler has DFEType::newInstance
methods which do the same. I do not want to associate this functionality (at least now) with types, and instead treat them as kernel methods. Perhaps just newStream
and newScalar
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, newStream
and newScalar
look better
src/model/dfcxx/lib/dfcxx/graph.cpp
Outdated
if (it->target == output) { | ||
if (target.type == OpType::NONE) { | ||
outs.erase(it); | ||
for (auto &out: outputs[target]) { | ||
for (auto &in: inputs[out.target]) { | ||
if (in.source == target && out == in) { | ||
in.source = it->source; | ||
outs.push_back(in); | ||
} | ||
} | ||
auto conIt = connections.find(out.target); | ||
if (conIt != connections.end() && conIt->second.source == target) { | ||
conIt->second.source = it->source; | ||
} | ||
} | ||
target = it->source; | ||
} else { | ||
it->target = target; | ||
inputs[target].clear(); | ||
inputs[target].push_back(*it); | ||
connections[target] = *it; | ||
} | ||
break; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code fragment is too "nesting". Please decrease it, using "continue" operator inside loop, etc.
No description provided.