Skip to content

Fix warnings on Linux/gcc49. #188

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

Merged
merged 1 commit into from
Dec 27, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions examples/ptb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ unsigned loadPTB(Tensor &inputWords, Tensor &targetWords, size_t numSteps,

void debug(Node *node) {
std::cout << (std::string)node->getName();
for (int i = 0; i < node->dims().size(); i++) {
for (size_t i = 0; i < node->dims().size(); i++) {
std::cout << " " << node->dims()[i];
}
std::cout << std::endl;
Expand Down Expand Up @@ -239,7 +239,7 @@ void testPTB() {

std::cout << "Training for " << numBatches << " rounds" << std::endl;

for (int iter = 0; iter < numEpochs; iter++) {
for (size_t iter = 0; iter < numEpochs; iter++) {
std::cout << "Training - iteration #" << (iter + 1) << std::endl;

llvm::Timer timer("Training", "Training");
Expand Down
4 changes: 2 additions & 2 deletions src/glow/Graph/Graph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -375,8 +375,8 @@ BatchedMatMulNode *Graph::createBatchedMatMul(llvm::StringRef name,
size_t b1 = RDims[1];
size_t b2 = RDims[2];

assert(a0 == 1 || b0 == 1 ||
a0 == b0 && "Batch size must be broadcasted or identical");
assert(((a0 == 1) || (b0 == 1) || (a0 == b0)) &&
"Batch size must be broadcasted or identical");

// Select the batch size. If the left operand is broadcast (value 1), select
// the RHS.
Expand Down
4 changes: 2 additions & 2 deletions src/glow/IR/Instrs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,8 @@ void BatchedMatMulInst::verify() const {
size_t c1 = DDims[1];
size_t c2 = DDims[2];

assert(a0 == 1 || b0 == 1 ||
a0 == b0 && "Batch size must be broadcasted or identical");
assert(((a0 == 1) || (b0 == 1) || (a0 == b0)) &&
"Batch size must be broadcasted or identical");

// Select the batch size. If the left operand is broadcast (value 1), select
// the RHS.
Expand Down
2 changes: 1 addition & 1 deletion src/glow/Optimizer/GraphOptimizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ struct CSEVisitor : NodeWalker {
// Replace current node by a found node, which is
// equivalent to it.
assert(N->isEqual(*FoundN));
for (int i = 0; i < N->getNumRes(); i++) {
for (unsigned i = 0; i < N->getNumRes(); i++) {
NodeValue FV(FoundN, i);
NodeValue(N, i).replaceAllUsesOfWith(FV);
}
Expand Down