Skip to content

Commit cce682f

Browse files
authored
Merge pull request #4437 from luotao1/warning
fix compiler warning from MKLDNNLayer and so on
2 parents 9928eb8 + c53d214 commit cce682f

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

paddle/framework/lod_tensor_test.cu

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ TEST(LoDTensor, LoDInGPU) {
3636
lod_tensor.mutable_data<float>(place);
3737

3838
lod_tensor.set_lod(src_lod);
39-
CHECK_EQ(lod_tensor.lod_element(0, 2), 4);
40-
CHECK_EQ(lod_tensor.lod_element(0, 4), 8);
39+
CHECK_EQ(lod_tensor.lod_element(0, 2), 4UL);
40+
CHECK_EQ(lod_tensor.lod_element(0, 4), 8UL);
4141

4242
auto lod = lod_tensor.lod();
4343

paddle/gserver/layers/MKLDNNConvLayer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ bool MKLDNNConvLayer::init(const LayerMap& layerMap,
2828
if (!MKLDNNLayer::init(layerMap, parameterMap)) {
2929
return false;
3030
}
31-
CHECK_EQ(inputLayers_.size(), 1) << "Only support one input layer yet";
31+
CHECK_EQ(inputLayers_.size(), 1UL) << "Only support one input layer yet";
3232
CHECK_EQ(inputLayers_.size(), parameters_.size());
3333
CHECK(config_.shared_biases()) << "Only support shared biases yet";
3434

paddle/gserver/layers/MKLDNNFcLayer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ bool MKLDNNFcLayer::init(const LayerMap& layerMap,
2828
return false;
2929
}
3030

31-
CHECK_EQ(inputLayers_.size(), 1) << "Only support one input layer yet";
31+
CHECK_EQ(inputLayers_.size(), 1UL) << "Only support one input layer yet";
3232
CHECK_EQ(inputLayers_.size(), parameters_.size());
3333
CHECK(!parameters_[0]->isSparse()) << "Do not support sparse yet";
3434

paddle/gserver/tests/test_CrossEntropyOverBeamGrad.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ void genGroundTruth(vector<SingleBeamExpansion>& beamExpansions,
228228
curBeam.groundTruth[j] = *(start + n);
229229
curBeam.inBeam[j] = 1;
230230
} else {
231-
CHECK_LE(curBeam.rowIdxInBeam[j] + 1,
231+
CHECK_LE((size_t)curBeam.rowIdxInBeam[j] + 1,
232232
curBeam.subSeqStartPos.size() - 1);
233233
int start = curBeam.subSeqStartPos[curBeam.rowIdxInBeam[j]];
234234
int end = curBeam.subSeqStartPos[curBeam.rowIdxInBeam[j] + 1];

paddle/operators/multiplex_op.cu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class MultiplexGPUKernel : public framework::OpKernel {
4242
for (auto i = 0; i < rows; i++) {
4343
int32_t k = index[i];
4444
PADDLE_ENFORCE_GE(k, 0, "index must be nonnegative.");
45-
PADDLE_ENFORCE_LT(k, ins.size(),
45+
PADDLE_ENFORCE_LT((size_t)k, ins.size(),
4646
"index exceeds the number of candidate tensors.");
4747
memory::Copy(place, out->data<T>() + i * cols, place,
4848
ins[k]->data<T>() + i * cols, cols * sizeof(T), stream);

0 commit comments

Comments
 (0)