21
21
#include < glog/stl_logging.h>
22
22
23
23
#include " tc/autotuner/utils.h"
24
+ #include " tc/core/check.h"
24
25
#include " tc/core/compiler.h"
25
26
#include " tc/core/flags.h"
26
27
#include " tc/core/scope_guard.h"
@@ -127,9 +128,9 @@ void TuningHarness<Backend>::doEvaluate(
127
128
size_t populationSize,
128
129
Printer& printer) {
129
130
typename Backend::WithDevice wd (device);
130
- CHECK_EQ (inputs_.count (device), 1u );
131
+ TC_CHECK_EQ (inputs_.count (device), 1u );
131
132
auto & inputs = inputs_.at (device);
132
- CHECK_EQ (outputs_.count (device), 1u );
133
+ TC_CHECK_EQ (outputs_.count (device), 1u );
133
134
auto & outputs = outputs_.at (device);
134
135
135
136
while (true ) {
@@ -158,7 +159,7 @@ void TuningHarness<Backend>::doEvaluate(
158
159
if (!pExecutor.get ()) {
159
160
// If I popped an empty executor then compilation didn't go as
160
161
// planned, skip it.
161
- CHECK (pConf->invalid );
162
+ TC_CHECK (pConf->invalid );
162
163
continue ;
163
164
}
164
165
@@ -252,8 +253,8 @@ void TuningHarness<Backend>::runOneIteration(
252
253
size_t iteration) {
253
254
// Define tensors per device once globally
254
255
auto devices = detail::parseDevices<Backend>(FLAGS_tuner_devices);
255
- CHECK (executors_.empty ());
256
- CHECK (configurations_.empty ());
256
+ TC_CHECK (executors_.empty ());
257
+ TC_CHECK (configurations_.empty ());
257
258
258
259
{
259
260
// Initialize for this round
@@ -384,7 +385,7 @@ std::vector<size_t> inputDivisorsAndPowers2(
384
385
}
385
386
386
387
size_t largestDim (const std::vector<const DLConstTensor*>& inputs) {
387
- CHECK_GE (inputs.size (), 1u );
388
+ TC_CHECK_GE (inputs.size (), 1u );
388
389
auto maxElement = std::max_element (
389
390
inputs.begin (),
390
391
inputs.end (),
@@ -398,7 +399,7 @@ size_t largestDim(const std::vector<const DLConstTensor*>& inputs) {
398
399
void setupTuningParameters (
399
400
const std::vector<const DLConstTensor*>& inputs,
400
401
TuningConfiguration& configuration) {
401
- CHECK_GE (inputs.size (), 1u );
402
+ TC_CHECK_GE (inputs.size (), 1u );
402
403
auto range = inputDivisorsAndPowers2 (inputs);
403
404
// 0 is a valid tiling annotation and signals no tiling of that dimension
404
405
// 0 is not a valid block / grid annotation
@@ -428,12 +429,12 @@ Autotuner<Backend, SearchStrategy>::tune(
428
429
const std::string& cacheFileName,
429
430
const TuningParameterFixer& fixedParams) {
430
431
std::map<std::string, lang::TreeRef> tcEntryPointMap (tc::detail::parse (tc));
431
- CHECK_EQ (tcEntryPointMap.count (tcEntryPoint), 1u )
432
+ TC_CHECK_EQ (tcEntryPointMap.count (tcEntryPoint), 1u )
432
433
<< " Error looking up " << tcEntryPoint;
433
434
434
435
// Initialize a model configuration
435
436
TuningConfiguration modelConfiguration;
436
- CHECK_GE (inputs.size (), 1u );
437
+ TC_CHECK_GE (inputs.size (), 1u );
437
438
setupTuningParameters (inputs.begin ()->second , modelConfiguration);
438
439
modelConfiguration.fixParameters (fixedParams);
439
440
0 commit comments