mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-14 12:46:00 +08:00
Fixed several compilation warnings
This commit is contained in:
parent
6015422ee6
commit
f670613e4b
@ -135,7 +135,7 @@ class TensorExecutor<Expression, ThreadPoolDevice, Vectorizable> {
|
|||||||
{
|
{
|
||||||
const Index PacketSize = Vectorizable ? unpacket_traits<typename Evaluator::PacketReturnType>::size : 1;
|
const Index PacketSize = Vectorizable ? unpacket_traits<typename Evaluator::PacketReturnType>::size : 1;
|
||||||
const Index size = array_prod(evaluator.dimensions());
|
const Index size = array_prod(evaluator.dimensions());
|
||||||
int num_threads = device.numThreads();
|
size_t num_threads = device.numThreads();
|
||||||
#ifdef EIGEN_USE_COST_MODEL
|
#ifdef EIGEN_USE_COST_MODEL
|
||||||
if (num_threads > 1) {
|
if (num_threads > 1) {
|
||||||
num_threads = TensorCostModel<ThreadPoolDevice>::numThreads(
|
num_threads = TensorCostModel<ThreadPoolDevice>::numThreads(
|
||||||
|
@ -168,7 +168,7 @@ class RunQueue {
|
|||||||
// larger than it is during concurrent modifications. E.g. pop can
|
// larger than it is during concurrent modifications. E.g. pop can
|
||||||
// decrement size before the corresponding push has incremented it.
|
// decrement size before the corresponding push has incremented it.
|
||||||
// So the computed size can be up to kSize + 1, fix it.
|
// So the computed size can be up to kSize + 1, fix it.
|
||||||
if (size > kSize) size = kSize;
|
if (size > static_cast<int>(kSize)) size = kSize;
|
||||||
return size;
|
return size;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -30,11 +30,11 @@ void test_basic_runqueue()
|
|||||||
RunQueue<int, 4> q;
|
RunQueue<int, 4> q;
|
||||||
// Check empty state.
|
// Check empty state.
|
||||||
VERIFY(q.Empty());
|
VERIFY(q.Empty());
|
||||||
VERIFY_IS_EQUAL(0, q.Size());
|
VERIFY_IS_EQUAL(0u, q.Size());
|
||||||
VERIFY_IS_EQUAL(0, q.PopFront());
|
VERIFY_IS_EQUAL(0, q.PopFront());
|
||||||
std::vector<int> stolen;
|
std::vector<int> stolen;
|
||||||
VERIFY_IS_EQUAL(0, q.PopBackHalf(&stolen));
|
VERIFY_IS_EQUAL(0, q.PopBackHalf(&stolen));
|
||||||
VERIFY_IS_EQUAL(0, stolen.size());
|
VERIFY_IS_EQUAL(0u, stolen.size());
|
||||||
// Push one front, pop one front.
|
// Push one front, pop one front.
|
||||||
VERIFY_IS_EQUAL(0, q.PushFront(1));
|
VERIFY_IS_EQUAL(0, q.PushFront(1));
|
||||||
VERIFY_IS_EQUAL(1, q.Size());
|
VERIFY_IS_EQUAL(1, q.Size());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user