Medical Imaging Interaction Toolkit  2018.4.99-12ad79a3
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 (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef __mitkOclUtils_h
14 #define __mitkOclUtils_h
15 
16 #include "mitkOpenCL.h"
17 
18 #include <string>
19 #include <MitkOpenCLExports.h>
20 
21 #define CHECK_OCL_ERR(_er) oclCheckError(_er, __FILE__, __LINE__);
22 
32 MITKOPENCL_EXPORT unsigned int iDivUp(unsigned int dividend, unsigned int divisor);
33 
41 MITKOPENCL_EXPORT std::string GetOclErrorAsString( int _clErr );
42 
46 MITKOPENCL_EXPORT void GetOclError(int _clErr);
47 
51 MITKOPENCL_EXPORT cl_int oclGetPlatformID(cl_platform_id* selectedPlatform);
52 
54 MITKOPENCL_EXPORT void oclPrintDeviceInfo(cl_device_id);
55 
57 MITKOPENCL_EXPORT cl_ulong oclGetGlobalMemSize(cl_device_id device);
58 
61 MITKOPENCL_EXPORT void oclPrintMemObjectInfo( cl_mem memobj);
62 
67 MITKOPENCL_EXPORT bool oclCheckError(int _err, const char*, int);
68 
74 MITKOPENCL_EXPORT void oclLogBinary(cl_program clProg, cl_device_id clDev);
75 
81 MITKOPENCL_EXPORT void oclLogBuildInfo(cl_program clProg, cl_device_id clDev);
82 
88 MITKOPENCL_EXPORT void GetSupportedImageFormats(cl_context _context, cl_mem_object_type _type);
89 
93 MITKOPENCL_EXPORT std::string GetImageTypeAsString( const unsigned int _in);
94 
95 #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 cl_ulong oclGetGlobalMemSize(cl_device_id device)
Returns the Global memory size of the current device.
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.