| 2928 | } |
| 2929 | |
| 2930 | void testCompileProgramDevices(void) |
| 2931 | { |
| 2932 | #if CL_HPP_TARGET_OPENCL_VERSION >= 120 |
| 2933 | cl_program program = make_program(0); |
| 2934 | cl_device_id device0 = make_device_id(0); |
| 2935 | cl_device_id device1 = make_device_id(1); |
| 2936 | |
| 2937 | clCompileProgram_StubWithCallback(clCompileProgram_devices); |
| 2938 | |
| 2939 | // Compiling the program queries the program build log: |
| 2940 | clGetProgramInfo_StubWithCallback(clGetProgramInfo_forBuildLog); |
| 2941 | clGetDeviceInfo_StubWithCallback(clGetDeviceInfo_platform); |
| 2942 | clGetPlatformInfo_StubWithCallback(clGetPlatformInfo_version_1_2); |
| 2943 | clRetainDevice_ExpectAndReturn(make_device_id(0), CL_SUCCESS); |
| 2944 | clRetainDevice_ExpectAndReturn(make_device_id(0), CL_SUCCESS); |
| 2945 | clGetProgramBuildInfo_StubWithCallback(clGetProgramBuildInfo_testGetBuildInfo); |
| 2946 | clReleaseDevice_ExpectAndReturn(make_device_id(0), CL_SUCCESS); |
| 2947 | clReleaseDevice_ExpectAndReturn(make_device_id(0), CL_SUCCESS); |
| 2948 | |
| 2949 | clReleaseProgram_ExpectAndReturn(program, CL_SUCCESS); |
| 2950 | clReleaseDevice_ExpectAndReturn(make_device_id(0), CL_SUCCESS); |
| 2951 | clReleaseDevice_ExpectAndReturn(make_device_id(1), CL_SUCCESS); |
| 2952 | |
| 2953 | std::vector<cl::Device> deviceList; |
| 2954 | deviceList.push_back(cl::Device(device0)); |
| 2955 | deviceList.push_back(cl::Device(device1)); |
| 2956 | |
| 2957 | cl::Program prog(program); |
| 2958 | cl_int errcode = prog.compile("", deviceList); |
| 2959 | |
| 2960 | TEST_ASSERT_EQUAL(errcode, CL_SUCCESS); |
| 2961 | |
| 2962 | // Clean up in a defined order |
| 2963 | prog = nullptr; |
| 2964 | deviceList[0] = nullptr; |
| 2965 | deviceList[1] = nullptr; |
| 2966 | #endif |
| 2967 | } |
| 2968 | |
| 2969 | /** |
| 2970 | * Stub implementation of clGetCommandQueueInfo that returns first one image then none |
nothing calls this directly
no test coverage detected