Skip to content

Commit e4ce447

Browse files
ezhulenevtensorflower-gardener
authored andcommitted
[xla:cpu] Replace FloorOfRatio with simple division
PiperOrigin-RevId: 801094325
1 parent adddbdb commit e4ce447

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

third_party/xla/xla/backends/cpu/runtime/BUILD

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1213,7 +1213,6 @@ cc_library(
12131213
hdrs = ["work_queue.h"],
12141214
deps = [
12151215
"//xla/tsl/concurrency:async_value",
1216-
"//xla/tsl/lib/math:math_util",
12171216
"//xla/tsl/platform:logging",
12181217
"@com_google_absl//absl/base:core_headers",
12191218
"@com_google_absl//absl/container:fixed_array",

third_party/xla/xla/backends/cpu/runtime/work_queue.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ limitations under the License.
3333
#include "Eigen/ThreadPool"
3434
#include "xla/tsl/concurrency/async_value_ref.h"
3535
#include "xla/tsl/concurrency/chain.h"
36-
#include "xla/tsl/lib/math/math_util.h"
3736
#include "xla/tsl/platform/logging.h"
3837

3938
#define EIGEN_USE_THREADS
@@ -130,8 +129,7 @@ inline WorkQueue::WorkQueue(size_t num_tasks, size_t num_partitions)
130129
: partitions_(num_partitions),
131130
empty_(num_tasks == 0),
132131
num_work_stealing_workers_(0) {
133-
size_t partition_size =
134-
tsl::MathUtil::FloorOfRatio(num_tasks, num_partitions);
132+
size_t partition_size = num_tasks / num_partitions;
135133
size_t rem_tasks = num_tasks % num_partitions;
136134
for (size_t i = 0, begin = 0, end = 0; i < num_partitions; ++i, begin = end) {
137135
end = begin + partition_size + ((i < rem_tasks) ? 1 : 0);

0 commit comments

Comments
 (0)