Lines Matching refs:dctx
5 static PetscErrorCode CheckIdle(PetscDeviceContext dctx, const char operation[]) in CheckIdle() argument
10 PetscCall(PetscDeviceContextQueryIdle(dctx, &idle)); in CheckIdle()
12 PetscCall(PetscDeviceContextView(dctx, NULL)); in CheckIdle()
18 static PetscErrorCode TestQueryIdle(PetscDeviceContext dctx) in TestQueryIdle() argument
24 PetscCall(PetscDeviceContextSynchronize(dctx)); in TestQueryIdle()
25 PetscCall(CheckIdle(dctx, "synchronization")); in TestQueryIdle()
29 PetscCall(CheckIdle(dctx, "creating unrelated dctx")); in TestQueryIdle()
33 PetscCall(CheckIdle(dctx, "destroying unrelated dctx")); in TestQueryIdle()
36 PetscCall(PetscDeviceContextDuplicate(dctx, &other)); in TestQueryIdle()
37 PetscCall(CheckIdle(dctx, "duplication")); in TestQueryIdle()
41 PetscCall(PetscDeviceContextWaitForContext(other, dctx)); in TestQueryIdle()
46 PetscCall(CheckIdle(dctx, "other context waited on it, and synchronizing the NULL context")); in TestQueryIdle()
56 PetscDeviceContext dctx = NULL; in main() local
61 PetscCall(PetscDeviceContextCreate(&dctx)); in main()
62 PetscCall(PetscDeviceContextSetStreamType(dctx, PETSC_STREAM_NONBLOCKING)); in main()
63 PetscCall(PetscDeviceContextSetUp(dctx)); in main()
64 PetscCall(TestQueryIdle(dctx)); in main()
65 PetscCall(PetscDeviceContextDestroy(&dctx)); in main()