Commit 29e68f5f by Tianqi Chen Committed by GitHub

Fix compiler warnings (#939)

parent 07cc21f1
......@@ -159,7 +159,8 @@ Value IRBuilder::FloatImm(const SType& dtype, double value) {
return GetConst_(dtype, reinterpret_cast<uint64_t*>(&value));
} else if (dtype.type.bits() == 32) {
float fvalue = static_cast<float>(value);
uint64_t data = reinterpret_cast<uint32_t*>(&fvalue)[0];
uint32_t* ptr = reinterpret_cast<uint32_t*>(&fvalue);
uint64_t data = ptr[0];
return GetConst_(dtype, &data);
} else {
CHECK_EQ(dtype.type.bits(), 16);
......
......@@ -344,7 +344,7 @@ class IRBuilder {
* \tparams Args The positional arguments
*/
template<typename... Args>
Value DeclareGlobal(spv::Op op, Args&& ...args) {
void DeclareGlobal(spv::Op op, Args&& ...args) {
ib_.Begin(op).AddSeq(std::forward<Args>(args)...).Commit(&decorate_);
}
/*!
......
......@@ -47,7 +47,7 @@ inline Tensor softmax(const Tensor &x,
Array<Expr> eval_range;
int arg_counter = 0;
for (size_t i = 0; i < ndim; ++i) {
if (i == axis)
if (static_cast<int>(i) == axis)
eval_range.push_back(reduce_index);
else
eval_range.push_back(indices[arg_counter++]);
......@@ -70,7 +70,7 @@ inline Tensor softmax(const Tensor &x,
const Array<Var> &indices) {
Array<Expr> non_reduce_indices;
for (size_t i = 0; i < ndim; ++i) {
if (i != axis)
if (static_cast<int>(i) != axis)
non_reduce_indices.push_back(indices[i]);
}
return tvm::exp(x(indices) - max_elem(non_reduce_indices)) /
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment