| 44 | } |
| 45 | |
| 46 | Status CreateCLContext(const CLDevice& device, |
| 47 | cl_context_properties* properties, CLContext* result) { |
| 48 | int error_code; |
| 49 | cl_device_id device_id = device.id(); |
| 50 | cl_context context = |
| 51 | clCreateContext(properties, 1, &device_id, nullptr, nullptr, &error_code); |
| 52 | if (!context) { |
| 53 | return UnknownError(absl::StrCat("Failed to create a compute context - ", |
| 54 | CLErrorCodeToString(error_code))); |
| 55 | } |
| 56 | |
| 57 | *result = CLContext(context); |
| 58 | return OkStatus(); |
| 59 | } |
| 60 | |
| 61 | } // namespace |
| 62 |
no test coverage detected