Remove ThenExecuteFunction references from eager XLA op dispatch.
The cleanup behavior is supplied by default by the GPU and XLA backends. PiperOrigin-RevId: 337127562 Change-Id: I539251f3932703af27e17a59bd39c120624a143d
This commit is contained in:
parent
b881485eb5
commit
08be643e74
@ -274,18 +274,6 @@ void XlaLocalLaunchBase::Compute(OpKernelContext* ctx) {
|
||||
run_options.set_allocator(allocator);
|
||||
run_options.set_intra_op_thread_pool(&ctx->eigen_cpu_device());
|
||||
run_options.set_rng_seed(GetXLARandomSeed());
|
||||
xla::ThenExecuteFunction then_execute;
|
||||
if (ctx->op_device_context()) {
|
||||
then_execute = [&](se::Stream* stream, std::function<void()> fn) {
|
||||
Status status = ctx->op_device_context()->ThenExecute(
|
||||
down_cast<Device*>(ctx->device()), stream, std::move(fn));
|
||||
if (!status.ok()) {
|
||||
// This should never happen.
|
||||
LOG(ERROR) << "ThenExecute failed " << status;
|
||||
}
|
||||
};
|
||||
run_options.set_then_execute_function(&then_execute);
|
||||
}
|
||||
Env* env = Env::Default();
|
||||
auto start_time = env->NowMicros();
|
||||
|
||||
@ -522,18 +510,6 @@ void XlaRunOp::Compute(OpKernelContext* ctx) {
|
||||
run_options.set_allocator(allocator);
|
||||
run_options.set_intra_op_thread_pool(&ctx->eigen_cpu_device());
|
||||
run_options.set_rng_seed(GetXLARandomSeed());
|
||||
xla::ThenExecuteFunction then_execute;
|
||||
if (ctx->op_device_context()) {
|
||||
then_execute = [&](se::Stream* stream, std::function<void()> fn) {
|
||||
Status status = ctx->op_device_context()->ThenExecute(
|
||||
down_cast<Device*>(ctx->device()), stream, std::move(fn));
|
||||
if (!status.ok()) {
|
||||
// This should never happen.
|
||||
LOG(ERROR) << "ThenExecute failed " << status;
|
||||
}
|
||||
};
|
||||
run_options.set_then_execute_function(&then_execute);
|
||||
}
|
||||
Env* env = Env::Default();
|
||||
auto start_time = env->NowMicros();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user