| 28 | } |
| 29 | |
| 30 | virtual void SetUp() { |
| 31 | cl_int err; |
| 32 | cl_context_properties props[] = { CL_CONTEXT_PLATFORM, 0, 0 }; |
| 33 | |
| 34 | ASSERT_EQ(CL_SUCCESS, clGetPlatformIDs(1, &platform, NULL)); |
| 35 | ASSERT_EQ(CL_SUCCESS, |
| 36 | clGetDeviceIDs(platform, CL_DEVICE_TYPE_GPU, 1, &device, NULL)); |
| 37 | props[1] = (cl_context_properties)platform; |
| 38 | context = clCreateContext(props, 1, &device, NULL, NULL, &err); |
| 39 | ASSERT_EQ(CL_SUCCESS, err) << "clCreateContext() failed"; |
| 40 | queue = clCreateCommandQueue(context, device, 0, &err); |
| 41 | ASSERT_EQ(CL_SUCCESS, err) << "clCreateCommandQueue() failed"; |
| 42 | } |
| 43 | |
| 44 | virtual void TearDown() { |
| 45 | if (queue != NULL) { |
nothing calls this directly
no outgoing calls
no test coverage detected