| 4317 | } |
| 4318 | |
| 4319 | void 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 | |
| 4349 | void testGetPlatformVersion_1_1(void) |
| 4350 | { |
nothing calls this directly
no test coverage detected