Fixed some compilation warnings

This commit is contained in:
Benoit Steiner 2016-05-26 15:57:19 -07:00
parent 094f4a56c8
commit 1ae2567861
2 changed files with 4 additions and 4 deletions

View File

@ -625,7 +625,7 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT
};
// Decide whether we want to shard m x n contraction by columns or by rows.
static bool shardByCol(Index m, Index n, int num_threads) {
static bool shardByCol(Index m, Index n, Index num_threads) {
// Note: we are comparing both n and m against Traits::nr, it is not
// a mistake. We are trying to figure out how both n and m will fit into
// the main sharding dimension.

View File

@ -155,7 +155,7 @@ class NonBlockingThreadPoolTempl : public Eigen::ThreadPoolInterface {
// Steal tries to steal work from other worker threads in best-effort manner.
Task Steal() {
PerThread* pt = GetPerThread();
unsigned size = queues_.size();
const size_t size = queues_.size();
unsigned r = Rand(&pt->rand);
unsigned inc = coprimes_[r % coprimes_.size()];
unsigned victim = r % size;
@ -219,7 +219,7 @@ class NonBlockingThreadPoolTempl : public Eigen::ThreadPoolInterface {
int NonEmptyQueueIndex() {
PerThread* pt = GetPerThread();
unsigned size = queues_.size();
const size_t size = queues_.size();
unsigned r = Rand(&pt->rand);
unsigned inc = coprimes_[r % coprimes_.size()];
unsigned victim = r % size;
@ -240,7 +240,7 @@ class NonBlockingThreadPoolTempl : public Eigen::ThreadPoolInterface {
PerThread* pt = &per_thread_;
if (pt->inited) return pt;
pt->inited = true;
pt->rand = std::hash<std::thread::id>()(std::this_thread::get_id());
pt->rand = static_cast<unsigned>(std::hash<std::thread::id>()(std::this_thread::get_id()));
return pt;
}