33 #ifndef CXVNNCLALGORITHM_H_
34 #define CXVNNCLALGORITHM_H_
37 #define __CL_ENABLE_EXCEPTIONS //telling the opencl c++ wrapper to throw exceptions
40 #include "OpenCLManager.hpp"
41 #include "RuntimeMeasurementManager.hpp"
82 virtual bool initCL(QString kernelFile,
88 float brightnessWeight,
102 virtual cl::Program
buildCLProgram(std::string program_src, std::string kernelPath,
108 float brightnessWeight,
109 float newnessWeight);
172 void setKernelArguments(
177 float volume_xspacing,
178 float volume_yspacing,
179 float volume_zspacing,
184 std::vector<cl::Buffer>& blocks,
185 cl::Buffer out_volume,
186 cl::Buffer plane_matrices,
188 size_t plane_eqs_size,
189 size_t close_planes_size,
191 size_t calculateSpaceNeededForClosePlanes(cl::Kernel kernel, cl::Device device,
size_t local_work_size,
size_t nPlanes_numberOfInputImages,
int nClosePlanes);
192 bool isUsingTooMuchMemory(
size_t outputVolumeSize,
size_t inputBlocksLength, cl_ulong globalMemUse);
193 void measureAndExecuteKernel(cl::CommandQueue queue, cl::Kernel kernel,
size_t global_work_size,
size_t local_work_size, std::string measurementName);
194 void measureAndReadBuffer(cl::CommandQueue queue, cl::Buffer outputBuffer,
size_t outputVolumeSize,
void *outputData, std::string measurementName);
196 void startProfiling(std::string name, cl::CommandQueue queue);
197 void stopProfiling(std::string name, cl::CommandQueue queue);
200 oul::ContextPtr mOulContex;
201 oul::RuntimeMeasurementsManagerPtr mRuntime;
202 std::set<std::string> mMeasurementNames;
203 std::string mKernelMeasurementName;
virtual bool initCL(QString kernelFile, int nMaxPlanes, int nPlanes, int method, int planeMethod, int nStarts, float brightnessWeight, float newnessWeight)
struct cx::VNNclAlgorithm::__frameBlock_t frameBlock_t
virtual void freeFrameBlocks(frameBlock_t *framePointers, int numBlock)
double getTotalExecutionTime()
virtual void fillPlaneMatrices(float *planeMatrices, ProcessedUSInputDataPtr input)
virtual cl::Program buildCLProgram(std::string program_src, std::string kernelPath, int nMaxPlanes, int nPlanes, int method, int planeMethod, int nStarts, float brightnessWeight, float newnessWeight)
virtual bool reconstruct(ProcessedUSInputDataPtr input, vtkImageDataPtr outputData, float radius, int nClosePlanes)
virtual bool initializeFrameBlocks(frameBlock_t *framePointers, int numBlocks, ProcessedUSInputDataPtr inputFrames)
void setProfiling(bool on)
boost::shared_ptr< class ProcessedUSInputData > ProcessedUSInputDataPtr
boost::shared_ptr< VNNclAlgorithm > VNNclAlgorithmPtr
double getKernelExecutionTime()