| 527 | } |
| 528 | |
| 529 | cl_int FFTBinaryLookup::populateCache() |
| 530 | { |
| 531 | // FIXME: support MSB |
| 532 | this->m_header.magic_key[0] = 'C'; |
| 533 | this->m_header.magic_key[1] = 'L'; |
| 534 | this->m_header.magic_key[2] = 'B'; |
| 535 | this->m_header.magic_key[3] = '\0'; |
| 536 | |
| 537 | std::vector<unsigned char*> data; |
| 538 | cl_int err = getSingleBinaryFromProgram(this->m_program, data); |
| 539 | |
| 540 | if (err != CL_SUCCESS) |
| 541 | { |
| 542 | return err; |
| 543 | } |
| 544 | |
| 545 | this->m_header.header_size = sizeof(Header); |
| 546 | this->m_header.binary_size = data.size(); |
| 547 | this->m_header.whole_file_size = this->m_header.header_size + this->m_header.binary_size + this->m_header.signature_size; |
| 548 | |
| 549 | writeCacheFile(data); // ignore return code, because it does nothing if |
| 550 | // the file could not be written (i.e the current |
| 551 | // thread did not create the file |
| 552 | delete [] data[0]; |
| 553 | |
| 554 | return CL_SUCCESS; |
| 555 | } |
| 556 | |
| 557 | cl_int FFTBinaryLookup::buildFromSource(const char * source) |
| 558 | { |
no test coverage detected