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

Function testBuildProgramSingleDevice

tests/test_openclhpp.cpp:2608–2634  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2606}
2607
2608void testBuildProgramSingleDevice(void)
2609{
2610 cl_program program = make_program(0);
2611 cl_device_id device_id = make_device_id(0);
2612
2613 // Creating a device queries the platform version:
2614 clGetDeviceInfo_StubWithCallback(clGetDeviceInfo_platform);
2615 clGetPlatformInfo_StubWithCallback(clGetPlatformInfo_version_1_2);
2616
2617 clBuildProgram_StubWithCallback(clBuildProgram_testBuildProgram);
2618
2619 // Building the program queries the program build log:
2620 clRetainDevice_ExpectAndReturn(make_device_id(0), CL_SUCCESS);
2621 clGetProgramBuildInfo_StubWithCallback(clGetProgramBuildInfo_testGetBuildInfo);
2622 clGetProgramBuildInfo_StubWithCallback(clGetProgramBuildInfo_testGetBuildInfo);
2623 clReleaseDevice_ExpectAndReturn(make_device_id(0), CL_SUCCESS);
2624 clReleaseDevice_ExpectAndReturn(make_device_id(0), CL_SUCCESS);
2625
2626 clReleaseProgram_ExpectAndReturn(program, CL_SUCCESS);
2627
2628 cl::Program prog(program);
2629 cl::Device dev(device_id);
2630
2631 cl_int errcode = prog.build(dev);
2632
2633 TEST_ASSERT_EQUAL(errcode, CL_SUCCESS);
2634}
2635
2636void testBuildProgramSingleDeviceWithOptions(void)
2637{

Callers

nothing calls this directly

Calls 3

make_programFunction · 0.85
make_device_idFunction · 0.85
buildMethod · 0.80

Tested by

no test coverage detected