| 124 | } |
| 125 | |
| 126 | Status CLProgram::GetBinary(std::vector<uint8_t>* result) const { |
| 127 | size_t binary_size; |
| 128 | RETURN_IF_ERROR(GetBinarySize(program_, &binary_size)); |
| 129 | result->resize(result->size() + binary_size); |
| 130 | uint8_t* binary_ptr = result->data() + result->size() - binary_size; |
| 131 | cl_int error_code = clGetProgramInfo(program_, CL_PROGRAM_BINARIES, |
| 132 | binary_size, &binary_ptr, nullptr); |
| 133 | if (error_code != CL_SUCCESS) { |
| 134 | return UnknownError(absl::StrCat("Failed to get program binary - ", |
| 135 | CLErrorCodeToString(error_code))); |
| 136 | } |
| 137 | return OkStatus(); |
| 138 | } |
| 139 | |
| 140 | Status CreateCLProgram(const std::string& code, |
| 141 | const std::string& compiler_options, |
no test coverage detected