diff --git a/tensorflow/core/common_runtime/gpu/BUILD b/tensorflow/core/common_runtime/gpu/BUILD index 503923c7fcae77..0bcfdcd27b21d4 100644 --- a/tensorflow/core/common_runtime/gpu/BUILD +++ b/tensorflow/core/common_runtime/gpu/BUILD @@ -414,15 +414,11 @@ tf_cuda_cc_test( tags = tf_cuda_tests_tags(), deps = [ "//tensorflow/cc:cc_ops", - "//tensorflow/core:framework", "//tensorflow/core:framework_internal", "//tensorflow/core:lib", "//tensorflow/core:lib_internal", - "//tensorflow/core:protos_all_cc", "//tensorflow/core:test", "//tensorflow/core:test_main", - "//tensorflow/core:testlib", - "//tensorflow/core/common_runtime:core_cpu", "//tensorflow/core/common_runtime:core_cpu_internal", "//tensorflow/core/common_runtime:direct_session_internal", ], diff --git a/tensorflow/core/common_runtime/gpu/gpu_allocator_retry_test.cc b/tensorflow/core/common_runtime/gpu/gpu_allocator_retry_test.cc index 4f334a8b4f7ff8..8c660c7547aae1 100644 --- a/tensorflow/core/common_runtime/gpu/gpu_allocator_retry_test.cc +++ b/tensorflow/core/common_runtime/gpu/gpu_allocator_retry_test.cc @@ -13,9 +13,10 @@ See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ -#include "tensorflow/core/common_runtime/allocator_retry.h" - +#include #include + +#include "tensorflow/core/common_runtime/allocator_retry.h" #include "tensorflow/core/lib/core/notification.h" #include "tensorflow/core/platform/env.h" #include "tensorflow/core/platform/logging.h" @@ -121,7 +122,7 @@ class GPUAllocatorRetryTest : public ::testing::Test { GPUAllocatorRetryTest() {} void LaunchConsumerThreads(int num_consumers, int cap_needed) { - barrier_.reset(new AlternatingBarrier(num_consumers)); + barrier_ = std::make_unique(num_consumers); consumer_count_.resize(num_consumers, 0); for (int i = 0; i < num_consumers; ++i) { consumers_.push_back(Env::Default()->StartThread( @@ -183,7 +184,7 @@ class GPUAllocatorRetryTest : public ::testing::Test { TEST_F(GPUAllocatorRetryTest, RetrySuccess) { // Support up to 2 allocations simultaneously, waits up to 1000 msec for // a chance to alloc. - alloc_.reset(new FakeAllocator(2, 1000)); + alloc_ = std::make_unique(2, 1000); // Launch 3 consumers, each of whom needs 1 unit at a time. LaunchConsumerThreads(3, 1); // This should be enough time for each consumer to be satisfied many times. @@ -208,7 +209,7 @@ TEST_F(GPUAllocatorRetryTest, RetrySuccess) { TEST_F(GPUAllocatorRetryTest, NoRetryFail) { // Support up to 2 allocations simultaneously, waits up to 0 msec for // a chance to alloc. - alloc_.reset(new FakeAllocator(2, 0)); + alloc_ = std::make_unique(2, 0); // Launch 3 consumers, each of whom needs 1 unit at a time. LaunchConsumerThreads(3, 1); Env::Default()->SleepForMicroseconds(50000); @@ -229,7 +230,7 @@ TEST_F(GPUAllocatorRetryTest, NoRetryFail) { TEST_F(GPUAllocatorRetryTest, RetryInsufficientFail) { // Support up to 2 allocations simultaneously, waits up to 1000 msec for // a chance to alloc. - alloc_.reset(new FakeAllocator(2, 1000)); + alloc_ = std::make_unique(2, 1000); // Launch 3 consumers, each of whom needs 2 units at a time. We expect // deadlock where 2 consumers each hold 1 unit, and timeout trying to // get the second.