Commit 1f9441a4 authored by Derek Murray's avatar Derek Murray Committed by TensorFlower Gardener
Browse files

Reduce overhead of constructing an `OpKernelContext` on non-GPU devices.

The current `OpKernelContext` constructor unconditionally makes a virtual call to get an allocator that is only used when the kernel is running on a GPU device. Since we can tell if this is necessary after the call to `params_->ensure_eigen_gpu_device()`, we can avoid the call, plus the virtual call to `ReinitializeGpuDevice()`, when we know that it is not a GPU device.

PiperOrigin-RevId: 203523500
parent 071ec6da
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment