Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitkOclUtils.h
Go to the documentation of this file.
1 /*===================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 #ifndef __mitkOclUtils_h
18 #define __mitkOclUtils_h
19 
20 #include "mitkOpenCL.h"
21 
22 #include <string>
23 #include <MitkOpenCLExports.h>
24 
25 #define CHECK_OCL_ERR(_er) oclCheckError(_er, __FILE__, __LINE__);
26 
36 MITKOPENCL_EXPORT unsigned int iDivUp(unsigned int dividend, unsigned int divisor);
37 
45 MITKOPENCL_EXPORT std::string GetOclErrorAsString( int _clErr );
46 
50 MITKOPENCL_EXPORT void GetOclError(int _clErr);
51 
55 MITKOPENCL_EXPORT cl_int oclGetPlatformID(cl_platform_id* selectedPlatform);
56 
58 MITKOPENCL_EXPORT void oclPrintDeviceInfo(cl_device_id);
59 
62 MITKOPENCL_EXPORT void oclPrintMemObjectInfo( cl_mem memobj);
63 
68 MITKOPENCL_EXPORT bool oclCheckError(int _err, const char*, int);
69 
75 MITKOPENCL_EXPORT void oclLogBinary(cl_program clProg, cl_device_id clDev);
76 
82 MITKOPENCL_EXPORT void oclLogBuildInfo(cl_program clProg, cl_device_id clDev);
83 
89 MITKOPENCL_EXPORT void GetSupportedImageFormats(cl_context _context, cl_mem_object_type _type);
90 
94 MITKOPENCL_EXPORT std::string GetImageTypeAsString( const unsigned int _in);
95 
96 #endif //mitkOclUtils_h
MITKOPENCL_EXPORT std::string GetImageTypeAsString(const unsigned int _in)
Translates the internal image type identifier to a human readable description string.
MITKOPENCL_EXPORT bool oclCheckError(int _err, const char *, int)
Checks the given code for errors and produces a std::cout output if the _err does not equal CL_SUCCES...
MITKOPENCL_EXPORT std::string GetOclErrorAsString(int _clErr)
Returns the name of an OpenCL Error as a string.
MITKOPENCL_EXPORT void oclPrintMemObjectInfo(cl_mem memobj)
Prints the available memory info about the given object to std::cout.
MITKOPENCL_EXPORT unsigned int iDivUp(unsigned int dividend, unsigned int divisor)
Method to estimate an integer quotient C from given dividend and divisor higher or equal to the corre...
MITKOPENCL_EXPORT void GetOclError(int _clErr)
Checks whether the given value corresponds to an OpenCL Error value and prints this message out as MI...
MITKOPENCL_EXPORT void oclPrintDeviceInfo(cl_device_id)
Prints out the essential support information about current device.
MITKOPENCL_EXPORT void oclLogBuildInfo(cl_program clProg, cl_device_id clDev)
Shows the OpenCL-Program build info, called if clBuildProgram != CL_SUCCES.
MITKOPENCL_EXPORT void oclLogBinary(cl_program clProg, cl_device_id clDev)
Logs the GPU Program binary code.
MITKOPENCL_EXPORT void GetSupportedImageFormats(cl_context _context, cl_mem_object_type _type)
Print out all supported image formats for given image type.
MITKOPENCL_EXPORT cl_int oclGetPlatformID(cl_platform_id *selectedPlatform)
Returns a platform ID of an OpenCL-capable GPU, or throws an exception.