tensorflow/core/common_runtime/gpu/gpu_allocator_retry_test.cc
// Verifies OutOfMemory failure when retry is allowed but memory capacity
// is too low even for retry.
Verifies OutOfMemory failure when retry is allowed but memory capacity
is too low even for retry.
Verifies OutOfMemory failure when retry is allowed but memory capacity is too low even for retry .
TEST_F(GPUAllocatorRetryTest, RetryInsufficientFail) {
  alloc_.reset(new FakeAllocator(2, 1000));
  LaunchConsumerThreads(3, 2);
  Env::Default()->SleepForMicroseconds(50000);
  JoinConsumerThreads(true, 10000000);
  for (int i = 0; i < 3; ++i) {
    LOG(INFO) << "Consumer " << i << " is " << consumer_count_[i];
  }
  {
    mutex_lock l(mu_);
    EXPECT_TRUE(has_failed_);
  }
}
TEST_F ( GPUAllocatorRetryTest , RetryInsufficientFail ) { alloc_ . reset ( new FakeAllocator ( 2 , 1000 ) ) ; LaunchConsumerThreads ( 3 , 2 ) ; Env :: Default ( ) -> SleepForMicroseconds ( 50000 ) ; JoinConsumerThreads ( true , 10000000 ) ; for ( int i = 0 ; i < 3 ; ++ i ) { LOG ( INFO ) << " " << i << " " << consumer_count_ [ i ] ; } { mutex_lock l ( mu_ ) ; EXPECT_TRUE ( has_failed_ ) ; } }
Verifies OutOfMemory failure when retry is allowed but memory capacity
is too low even for retry.
Verifies OutOfMemory failure when retry is allowed but memory capacity is too low even for retry .
// Support up to 2 allocations simultaneously, waits up to 1000 msec for // a chance to alloc. // 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. // We're forcing a race condition, so this will fail quickly, but // give it 10 seconds anyway.