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,
104 std::string kernelPath,
110 float brightnessWeight,
111 float newnessWeight);
174 void setKernelArguments(
179 float volume_xspacing,
180 float volume_yspacing,
181 float volume_zspacing,
186 std::vector<cl::Buffer>& blocks,
187 cl::Buffer out_volume,
188 cl::Buffer plane_matrices,
190 size_t plane_eqs_size,
191 size_t close_planes_size,
193 size_t calculateSpaceNeededForClosePlanes(cl::Kernel kernel, cl::Device device,
size_t local_work_size,
size_t nPlanes_numberOfInputImages,
int nClosePlanes);
194 bool isUsingTooMuchMemory(
size_t outputVolumeSize,
size_t inputBlocksLength, cl_ulong globalMemUse);
195 void measureAndExecuteKernel(cl::CommandQueue queue, cl::Kernel kernel,
size_t global_work_size,
size_t local_work_size, std::string measurementName);
196 void measureAndReadBuffer(cl::CommandQueue queue, cl::Buffer outputBuffer,
size_t outputVolumeSize,
void *outputData, std::string measurementName);
198 void startProfiling(std::string name, cl::CommandQueue queue);
199 void stopProfiling(std::string name, cl::CommandQueue queue);
202 oul::ContextPtr mOulContex;
203 oul::RuntimeMeasurementsManagerPtr mRuntime;
204 std::set<std::string> mMeasurementNames;
205 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
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
virtual void freeFrameBlocks(frameBlock_t *framePointers, int numBlocks)
boost::shared_ptr< VNNclAlgorithm > VNNclAlgorithmPtr
double getKernelExecutionTime()