| 140 | } |
| 141 | |
| 142 | UTEST_F(ConcurrentSynchronizedContexts, sequentialDispatchCalls) |
| 143 | { |
| 144 | for (McInt32 i = 0; i < (McInt32)utest_fixture->contexts.size(); ++i) { |
| 145 | McEvent dispatchEvent = MC_NULL_HANDLE; |
| 146 | ASSERT_EQ(mcEnqueueDispatch( |
| 147 | utest_fixture->contexts[i], |
| 148 | MC_DISPATCH_VERTEX_ARRAY_DOUBLE, |
| 149 | utest_fixture->cubeVertices.data(), |
| 150 | utest_fixture->cubeFaces.data(), |
| 151 | utest_fixture->cubeFaceSizes.data(), |
| 152 | utest_fixture->numCubeVertices, |
| 153 | utest_fixture->numCubeFaces, |
| 154 | utest_fixture->cutMeshVertices.data(), |
| 155 | utest_fixture->cutMeshFaces.data(), |
| 156 | nullptr, // cutMeshFaceSizes, // no need to give 'faceSizes' parameter since cut-mesh is a triangle mesh |
| 157 | utest_fixture->numCutMeshVertices, |
| 158 | utest_fixture->numCutMeshFaces, |
| 159 | 0, NULL, &dispatchEvent), |
| 160 | MC_NO_ERROR); |
| 161 | |
| 162 | ASSERT_TRUE(dispatchEvent != MC_NULL_HANDLE); |
| 163 | |
| 164 | // |
| 165 | // wait until event is complete |
| 166 | // |
| 167 | ASSERT_EQ(mcWaitForEvents(1, &dispatchEvent), MC_NO_ERROR); |
| 168 | |
| 169 | McSize bytes = 0; |
| 170 | |
| 171 | ASSERT_EQ(mcGetEventInfo(dispatchEvent, MC_EVENT_COMMAND_EXECUTION_STATUS, 0, NULL, &bytes), MC_NO_ERROR); |
| 172 | ASSERT_EQ(bytes, sizeof(McEventCommandExecStatus)); |
| 173 | |
| 174 | McEventCommandExecStatus dispatchEventStatus = (McEventCommandExecStatus)MC_UNDEFINED_VALUE; |
| 175 | ASSERT_EQ(mcGetEventInfo(dispatchEvent, MC_EVENT_COMMAND_EXECUTION_STATUS, bytes, &dispatchEventStatus, NULL), MC_NO_ERROR); |
| 176 | |
| 177 | ASSERT_TRUE(dispatchEventStatus & McEventCommandExecStatus::MC_COMPLETE); |
| 178 | |
| 179 | ASSERT_EQ(mcReleaseEvents(1, &dispatchEvent), MC_NO_ERROR); |
| 180 | } |
| 181 | } |
| 182 | |
| 183 | UTEST_F(ConcurrentSynchronizedContexts, parallelButUnsynchronisedDispatchCalls) |
| 184 | { |
nothing calls this directly
no test coverage detected