Read the kernels that this plan uses from file, and store into the plan
| 670 | |
| 671 | // Read the kernels that this plan uses from file, and store into the plan |
| 672 | clfftStatus FFTAction::writeKernel( const clfftPlanHandle plHandle, const clfftGenerators gen, const FFTKernelSignatureHeader* data, const cl_context& context, const cl_device_id &device ) |
| 673 | { |
| 674 | FFTRepo& fftRepo = FFTRepo::getInstance( ); |
| 675 | |
| 676 | std::string kernelPath = getKernelName(gen, plHandle, true); |
| 677 | |
| 678 | // Logic to write string contents out to file |
| 679 | tofstreamRAII< std::ofstream, std::string > kernelFile( kernelPath.c_str( ) ); |
| 680 | if( !kernelFile.get( ) ) |
| 681 | { |
| 682 | std::cerr << "Failed to open kernel file for writing: " << kernelPath.c_str( ) << std::endl; |
| 683 | return CLFFT_FILE_CREATE_FAILURE; |
| 684 | } |
| 685 | |
| 686 | std::string kernel; |
| 687 | OPENCL_V( fftRepo.getProgramCode( gen, data, kernel, device, context ), _T( "fftRepo.getProgramCode failed." ) ); |
| 688 | |
| 689 | kernelFile.get( ) << kernel << std::endl; |
| 690 | |
| 691 | return CLFFT_SUCCESS; |
| 692 | } |
| 693 | |
| 694 | |
| 695 | // **************** TODO TODO TODO *********************** |
nothing calls this directly
no test coverage detected