Skip to content

Commit

Permalink
UT for getHostTimer (#253)
Browse files Browse the repository at this point in the history
  • Loading branch information
piotr-wozniak-mobica authored Nov 15, 2023
1 parent 4456ec6 commit f96b8f8
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/test_openclhpp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4571,4 +4571,25 @@ void testgetObjectInfo() {
TEST_ASSERT_EQUAL(type, CL_GL_OBJECT_BUFFER);
TEST_ASSERT_EQUAL(bufobj, 0);
}
#if CL_HPP_TARGET_OPENCL_VERSION >= 210
static cl_int clGetHostTimer_testgetHostTimer(cl_device_id device,
cl_ulong *host_timestamp,
int num_calls) {
TEST_ASSERT_EQUAL_PTR(devicePool[0](), device);
TEST_ASSERT_EQUAL(0, num_calls);
*host_timestamp = 1;
return 0;
}

void testgetHostTimer() {
cl_ulong retVal = 0;
cl_int *error = nullptr;

clGetHostTimer_StubWithCallback(clGetHostTimer_testgetHostTimer);
retVal = devicePool[0].getHostTimer(error);
TEST_ASSERT_EQUAL(retVal, 1);
}
#else
void testgetHostTimer() {}
#endif // CL_HPP_TARGET_OPENCL_VERSION >= 210
} // extern "C"

0 comments on commit f96b8f8

Please sign in to comment.