MCPcopy Create free account
hub / github.com/KhronosGroup/OpenCL-CLHPP / testLinkProgram

Function testLinkProgram

tests/test_openclhpp.cpp:4238–4262  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4236}
4237
4238void testLinkProgram(void)
4239{
4240#if CL_HPP_TARGET_OPENCL_VERSION >= 120
4241 cl_int errcode;
4242 int refcount[] = {1,1};
4243
4244 // verify if class cl::Program was not modified
4245 TEST_ASSERT_EQUAL(sizeof(cl_program), sizeof(cl::Program));
4246
4247 clGetProgramInfo_StubWithCallback(clGetProgramInfo_testProgramGetContext);
4248 clLinkProgram_StubWithCallback(clLinkProgram_testLinkProgram);
4249
4250 clRetainContext_ExpectAndReturn(make_context(0), CL_SUCCESS);
4251 clReleaseContext_ExpectAndReturn(make_context(0), CL_SUCCESS);
4252 prepare_programRefcounts(2, reinterpret_cast<cl_program *>(programPool), refcount);
4253
4254 cl::Program prog = cl::linkProgram(cl::Program(make_program(0)), cl::Program(make_program(1)),
4255 nullptr, nullptr, nullptr, &errcode);
4256
4257 TEST_ASSERT_EQUAL_PTR(prog(), make_program(0));
4258 TEST_ASSERT_EQUAL(errcode, CL_SUCCESS);
4259
4260 prog() = nullptr;
4261#endif
4262}
4263
4264void testLinkProgramWithOptions(void)
4265{

Callers

nothing calls this directly

Calls 4

make_contextFunction · 0.85
linkProgramFunction · 0.85
ProgramClass · 0.85
make_programFunction · 0.85

Tested by

no test coverage detected