Skip to content

Commit

Permalink
Fix various compilation errors with AppleClang 14.0.3 (#7578)
Browse files Browse the repository at this point in the history
* Change & -> && usage

Newer versions of Xcode trigger `-Wbitwise-instead-of-logical` for this usage, which we treat as an error

* Also fix `error: variable 'i' set but not used [-Werror,-Wunused-but-set-variable]`

* Also fix `retrain_cost_model.cpp:419:17: error: variable 'counter' set but not used [-Werror,-Wunused-but-set-variable]`
  • Loading branch information
steven-johnson authored May 18, 2023
1 parent 6c8f7aa commit 2ed955e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/autoschedulers/adams2019/AutoSchedule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ IntrusivePtr<State> optimal_schedule_pass(FunctionDAG &dag,
#endif

// This loop is beam search over the sequence of decisions to make.
for (int i = 0;; i++) {
for (;;) {
std::unordered_map<uint64_t, int> hashes;
q.swap(pending);

Expand Down
4 changes: 0 additions & 4 deletions src/autoschedulers/adams2019/retrain_cost_model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -416,8 +416,6 @@ int main(int argc, char **argv) {
float v_correct_ordering_rate_count[kModels] = {0};

for (int e = 0; e < flags.epochs; e++) {
int counter = 0;

float worst_miss = 0;
uint64_t worst_miss_pipeline_id = 0;
uint64_t worst_miss_schedule_id = 0;
Expand Down Expand Up @@ -536,8 +534,6 @@ int main(int argc, char **argv) {
}
}
}

counter++;
}

std::cout << "Loss: ";
Expand Down
8 changes: 4 additions & 4 deletions test/correctness/float16_t_constants.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ int main() {
// Try converting to native float types
float infinityPf = (float)infinityP;
double infinityPd = (double)infinityP;
h_assert(std::isinf(infinityPf) & !std::signbit(infinityPf),
h_assert(std::isinf(infinityPf) && !std::signbit(infinityPf),
"positive infinity conversion to float invalid");
h_assert(std::isinf(infinityPd) & !std::signbit(infinityPd),
h_assert(std::isinf(infinityPd) && !std::signbit(infinityPd),
"positive infinity conversion to double invalid");
}

Expand All @@ -101,9 +101,9 @@ int main() {
// Try converting to native float types
float infinityNf = (float)infinityN;
double infinityNd = (double)infinityN;
h_assert(std::isinf(infinityNf) & std::signbit(infinityNf),
h_assert(std::isinf(infinityNf) && std::signbit(infinityNf),
"negative infinity conversion to float invalid");
h_assert(std::isinf(infinityNd) & std::signbit(infinityNd),
h_assert(std::isinf(infinityNd) && std::signbit(infinityNd),
"negative infinity conversion to double invalid");
}

Expand Down

0 comments on commit 2ed955e

Please sign in to comment.