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

Function testSetDefaultDevice

tests/test_openclhpp.cpp:3300–3317  ·  view source on GitHub ↗

Note that default tests maintain state when run from the same unit process. One default setting test will maintain the defaults until the end.

Source from the content-addressed store, hash-verified

3298// unit process.
3299// One default setting test will maintain the defaults until the end.
3300void testSetDefaultDevice(void)
3301{
3302 clGetDeviceInfo_StubWithCallback(clGetDeviceInfo_platform);
3303 clGetPlatformInfo_StubWithCallback(clGetPlatformInfo_version_2_0);
3304
3305 clRetainDevice_ExpectAndReturn(make_device_id(1), CL_SUCCESS);
3306 clRetainDevice_ExpectAndReturn(make_device_id(1), CL_SUCCESS);
3307 clRetainDevice_ExpectAndReturn(make_device_id(1), CL_SUCCESS);
3308 clReleaseDevice_ExpectAndReturn(make_device_id(1), CL_SUCCESS);
3309 clReleaseDevice_ExpectAndReturn(make_device_id(1), CL_SUCCESS);
3310 clReleaseDevice_ExpectAndReturn(make_device_id(1), CL_SUCCESS);
3311
3312 cl::Device d(make_device_id(1));
3313 cl::Device d2 = cl::Device::setDefault(d);
3314 cl::Device d3 = cl::Device::getDefault();
3315 TEST_ASSERT_EQUAL(d(), d2());
3316 TEST_ASSERT_EQUAL(d(), d3());
3317}
3318
3319#if CL_HPP_TARGET_OPENCL_VERSION >= 200
3320static cl_command_queue clCreateCommandQueueWithProperties_testCommandQueueDevice(

Callers

nothing calls this directly

Calls 1

make_device_idFunction · 0.85

Tested by

no test coverage detected