Skip to content

Commit

Permalink
add test case for ttnn::event_query
Browse files Browse the repository at this point in the history
  • Loading branch information
ilkoo-lee committed Dec 24, 2024
1 parent 13fe5f5 commit f3adb9f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/ttnn/unit_tests/gtests/test_async_runtime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,13 @@ TEST_F(MultiCommandQueueSingleDeviceFixture, TestAsyncPreallocatedOutputs) {
ttnn::record_event(device_->command_queue(io_cq), write_event);
// Host stalls until write is completed, before sending workload
ttnn::event_synchronize(write_event);
EXPECT_EQ(ttnn::event_query(write_event), true);
// Dispatch workload. Preallocated output_tensor is populated by op/
ttnn::moreh_sum(input_tensor, /*dim*/ 3, false, output_tensor, std::nullopt, std::nullopt);
// Record completion of workload
ttnn::record_event(device_->command_queue(workload_dispatch_cq), workload_event);
ttnn::event_synchronize(workload_event);
EXPECT_EQ(ttnn::event_query(workload_event), true);
// Read output back, once workload is complete
ttnn::read_buffer(io_cq, output_tensor, {readback_data});
// Ensure that reference count book keeping is done correctly
Expand Down

0 comments on commit f3adb9f

Please sign in to comment.