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

Function testLinkProgramWithVectorProgramInput

tests/test_openclhpp.cpp:4319–4347  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4317}
4318
4319void testLinkProgramWithVectorProgramInput(void)
4320{
4321#if CL_HPP_TARGET_OPENCL_VERSION >= 120
4322 cl_int errcode;
4323 VECTOR_CLASS<cl::Program> prog_vec;
4324 std::array<int, ARRAY_SIZE(programPool)> refcount;
4325 for (int i=0;i<(int)ARRAY_SIZE(programPool);i++) {
4326 prog_vec.push_back(cl::Program(programPool[i]()));
4327 refcount[i] = 1;
4328 }
4329
4330 // verify if class cl::Program was not modified
4331 TEST_ASSERT_EQUAL(sizeof(cl_program), sizeof(cl::Program));
4332
4333 clGetProgramInfo_StubWithCallback(clGetProgramInfo_testProgramGetContext);
4334 clLinkProgram_StubWithCallback(clLinkProgram_testLinkProgram);
4335 prepare_programRefcounts(prog_vec.size(), reinterpret_cast<cl_program *>(prog_vec.data()), refcount.data());
4336
4337 clRetainContext_ExpectAndReturn(make_context(0), CL_SUCCESS);
4338 clReleaseContext_ExpectAndReturn(make_context(0), CL_SUCCESS);
4339
4340 cl::Program prog = linkProgram(prog_vec, nullptr, nullptr, nullptr, &errcode);
4341
4342 TEST_ASSERT_EQUAL_PTR(prog(), make_program(0));
4343 TEST_ASSERT_EQUAL(errcode, CL_SUCCESS);
4344
4345 prog() = nullptr;
4346#endif
4347}
4348
4349void testGetPlatformVersion_1_1(void)
4350{

Callers

nothing calls this directly

Calls 5

ProgramClass · 0.85
make_contextFunction · 0.85
linkProgramFunction · 0.85
make_programFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected