MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / TEST

Function TEST

tensorflow/compiler/xla/python/semaphore_test.cc:26–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24namespace {
25
26TEST(SemaphoreTest, UnthreadedTests) {
27 Semaphore semaphore(2);
28 semaphore.Acquire(1);
29 semaphore.Release(1);
30
31 semaphore.Acquire(2);
32 semaphore.Release(2);
33
34 semaphore.Acquire(1);
35 semaphore.Acquire(1);
36 semaphore.Release(1);
37 semaphore.Acquire(1);
38 semaphore.Release(1);
39 semaphore.Acquire(1);
40 semaphore.Release(2);
41
42 {
43 auto a = semaphore.ScopedAcquire(1);
44 { auto b = semaphore.ScopedAcquire(1); }
45 { auto c = semaphore.ScopedAcquire(1); }
46 }
47}
48
49TEST(SemaphoreTest, ConcurrentTest) {
50 tensorflow::thread::ThreadPool pool(tensorflow::Env::Default(), "test", 2);

Callers

nothing calls this directly

Calls 8

DefaultFunction · 0.85
ScopedAcquireMethod · 0.80
HasBeenNotifiedMethod · 0.80
AcquireMethod · 0.45
ReleaseMethod · 0.45
ScheduleMethod · 0.45
NotifyMethod · 0.45
WaitForNotificationMethod · 0.45

Tested by

no test coverage detected