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

Function testLinkProgramWithOptions

tests/test_openclhpp.cpp:4264–4289  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4262}
4263
4264void testLinkProgramWithOptions(void)
4265{
4266#if CL_HPP_TARGET_OPENCL_VERSION >= 120
4267 cl_int errcode;
4268 int refcount[] = {1,1};
4269
4270 // verify if class cl::Program was not modified
4271 TEST_ASSERT_EQUAL(sizeof(cl_program), sizeof(cl::Program));
4272
4273 clGetProgramInfo_StubWithCallback(clGetProgramInfo_testProgramGetContext);
4274 clLinkProgram_StubWithCallback(clLinkProgram_testLinkProgram);
4275
4276 clRetainContext_ExpectAndReturn(make_context(0), CL_SUCCESS);
4277 clReleaseContext_ExpectAndReturn(make_context(0), CL_SUCCESS);
4278 prepare_programRefcounts(2, reinterpret_cast<cl_program *>(programPool), refcount);
4279
4280 cl::Program prog = cl::linkProgram(
4281 cl::Program(make_program(0)), cl::Program(make_program(1)),
4282 "-cl-program-link-options", nullptr, nullptr, &errcode);
4283
4284 TEST_ASSERT_EQUAL_PTR(prog(), make_program(0));
4285 TEST_ASSERT_EQUAL(errcode, CL_SUCCESS);
4286
4287 prog() = nullptr;
4288#endif
4289}
4290
4291void testLinkProgramWithStringOptions(void)
4292{

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