| 666 | } |
| 667 | |
| 668 | void |
| 669 | KTest::readBuffers(std::stringstream& ss) |
| 670 | { |
| 671 | VarList list; |
| 672 | std::string size; |
| 673 | |
| 674 | ss << std::endl; |
| 675 | list = masterStep_->buffers(); |
| 676 | for (VarList::const_iterator it = list.begin(); it != list.end(); ++it) { |
| 677 | if (((*it)->flags() & CL_MEM_READ_WRITE) || |
| 678 | ((*it)->flags() & CL_MEM_WRITE_ONLY)) { |
| 679 | getBufferSizeExpr(*it, size); |
| 680 | ss << indent() << "err = clEnqueueReadBuffer(queue, " |
| 681 | << (*it)->name() << ", CL_TRUE, 0," << std::endl |
| 682 | << indent() << " " << size << ", " |
| 683 | << ((Variable*)(*it)->hostPtr())->name() << "," << std::endl |
| 684 | << indent() << " 0, NULL, NULL);" << std::endl; |
| 685 | ss << indent() << "assert(err == CL_SUCCESS);" << std::endl; |
| 686 | } |
| 687 | } |
| 688 | } |
| 689 | |
| 690 | void |
| 691 | KTest::mainFinish(std::stringstream& ss) |