Skip to content
This repository was archived by the owner on Apr 28, 2023. It is now read-only.

Commit d538c0c

Browse files
Replace C2 TcOp::profile_ by TcOp::checkSizes_
C2 has its own way of profiling, this flag is unnecessary. Instead C2 needs to be able to check sizes so add that.. Note that on a size mismatch it is likely a CHECK will terminate the progra. I opened #351 to address that part. Still once #307 has landed there will be a need for memoization of OptionsCacheKey -> TcExecutor if you want a TcOp to work across multiple sizes and until we have some end-to-end parametric code generation.
1 parent 403ce94 commit d538c0c

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

tc/c2/tc_op.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class TcOp : public Operator<Context> {
4949
OperatorBase::GetSingleArgument<std::string>("tcGradDef", "ERROR");
5050
gradTcName_ =
5151
OperatorBase::GetSingleArgument<std::string>("tcGradName", "ERROR");
52-
profile_ = OperatorBase::GetSingleArgument<bool>("profile", false);
52+
checkSizes_ = OperatorBase::GetSingleArgument<bool>("checkSizes", false);
5353
compiled_ = false;
5454
handle_ = 0;
5555
ArgumentHelper args(operator_def);
@@ -122,9 +122,8 @@ class TcOp : public Operator<Context> {
122122
compiled_ = true;
123123
}
124124

125-
if (profile_) {
126-
executionEngine_->run(
127-
handle_, inputDLTensors_, outputDLTensors_, profile_);
125+
if (checkSizes_) {
126+
executionEngine_->run(handle_, inputDLTensors_, outputDLTensors_);
128127
} else {
129128
executionEngine_->uncheckedRun(handle_, inputVoidPtrs_, outputVoidPtrs_);
130129
}
@@ -137,7 +136,7 @@ class TcOp : public Operator<Context> {
137136
std::string gradTc_;
138137
std::string tcName_;
139138
std::string gradTcName_;
140-
bool profile_;
139+
bool checkSizes_;
141140
bool compiled_;
142141
size_t handle_;
143142
std::vector<const void*> inputVoidPtrs_;

0 commit comments

Comments
 (0)