IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
Macros
ProcessingAlgorithmSrcMacros.h File Reference

Source part of macros set for processing algorithm class implementation. More...

#include <IPSDKBaseProcessing/Algorithm/ProcessingAlgorithmSrcDetailsMacros.h>
#include <IPSDKBaseProcessing/Algorithm/ProcessingInfo.h>
#include <IPSDKCore/ComputerInfo/LocalComputerInfoUtils.h>
#include <IPSDKUtil/BaseCollections.h>
#include <IPSDKUtil/Tools/MutexMacros.h>
#include <boost/thread/lock_guard.hpp>

Go to the source code of this file.

Macros

#define IPSDK_IMPLEMENT_PROCESSING_ALGORITHM(libraryName, namespaceSeq, className, eMsgEnum, version)
 macro allowing to implement a processing algorithm
 
#define IPSDK_START_ALGORITHM_FUNCTIONS_REGISTRATION(className)
 macro allowing to start registration for processing algorithm functions More...
 
#define IPSDK_REGISTER_GENERIC_ALGORITHM_FUNCTION(dataTypeSeq, isSeq, functionEfficiency, functionName)
 macro allowing to register a generic (template) processing algorithm function More...
 
#define IPSDK_REGISTER_SPECIFIC_ALGORITHM_FUNCTION(dataTypeSeq, isSeq, functionEfficiency, functionName)
 macro allowing to register a specific processing algorithm function More...
 
#define IPSDK_END_ALGORITHM_FUNCTIONS_REGISTRATION()
 macro allowing to end registration for image processing functions More...
 
#define IPSDK_IMPLEMENT_GPU_PROCESSING_ALGORITHM(libraryName, namespaceSeq, className, eMsgEnum, version)
 macro allowing to implement a processing algorithm More...
 
#define IPSDKCUDA_GET_IDENTIFIER_SEQ_VALUE_IBT(r, data, value)   (ipsdk::image::ImageType2Buffer<ipsdk::image::eImageBufferType::value>::type)
 
#define IPSDKCUDA_CAST_FCT_PTR(ST)
 
#define IPSDKCUDA_REGISTER_FUNCTION(r, product)
 
#define IPSDKCUDA_REGISTER_GENERIC_GPU_ALGORITHM_FUNCTION(ST)
 
#define IPSDKCUDA_REGISTER_NOTYPE_GPU_ALGORITHM_FUNCTION()
 
#define IPSDKCUDA_START_GPU_FUNCTIONS_REGISTRATION(AlgoName)
 
#define IPSDKCUDA_END_GPU_FUNCTIONS_REGISTRATION()
 
#define IPSDKCUDA_GENERATE_GPU_IMAGE_NAME(ImgName)   BOOST_PP_CAT(img, ImgName)
 Generates the name of the variable storing the GPU image corresponding to ImgName.
 
#define IPSDKCUDA_GENERATE_IMAGE_BUFFER_NAME(ImgName)   BOOST_PP_CAT(IPSDKCUDA_GENERATE_GPU_IMAGE_NAME(ImgName), Buf)
 Generates the name of the variable storing the GPU image buffer corresponding to ImgName by adding the suffix "Buf" to the gpu image variable name generated by IPSDKCUDA_GENERATE_GPU_IMAGE_NAME For instance, IPSDKCUDA_GENERATE_IMAGE_BUFFER_NAME(_pInSubGpuImg) yields img_pInSubGpuImgBuf.
 
#define IPSDKCUDA_GENERATE_IMAGE_BUFFER_NAME_COLL(imgName)   BOOST_PP_CAT(p, IPSDKCUDA_GENERATE_IMAGE_BUFFER_NAME(imgName))
 Generates the name of the array storing the GPU image buffers corresponding to ImgName by adding the suffix "p" to the gpu buffer image variable name generated by IPSDKCUDA_GENERATE_IMAGE_BUFFER_NAME For instance, IPSDKCUDA_GENERATE_IMAGE_BUFFER_NAME_COLL(_pInSubGpuImg) yields pimg_pInSubGpuImgBuf.
 
#define IPSDKCUDA_EXTRACT_DATA_FROM_IMAGE_MACRO(r, data, elem)
 Macro allowing to extract the GPU image from the attribute indicated in the 3rd item of elem and also extract the corresponding buffer. The argument data is ignored and elem is a triplet. If the image is an input constant data, elem looks like (const, T, _pInImg), where T is the buffer data type (e.g. int). If the image is an output data, the first fiel of elem is empty : (, T, _pOutImg) As an example, the output of IPSDKCUDA_EXTRACT_DATA_FROM_IMAGE_MACRO(r, data, (const, TIn1, _pInSubGpuImg1)) is : const CudaImage& img_pInSubGpuImg1 = static_cast<const CudaImage&>(_pInSubGpuImg1->getImage()); const TIn1* img_pInSubGpuImg1Buf = ipsdk::image::tools::extractBufferData<TIn1>(img_pInSubGpuImg1, _deviceIdx);. More...
 
#define IPSDKCUDA_EXTRACT_DATA_FROM_IMAGES(SI)
 This macro calls IPSDKCUDA_EXTRACT_DATA_FROM_IMAGE_MACRO for each item of the image attribute sequence SI to extract the image and their buffers and then extract the sizes along X, Y, Z, C and T from the first item of SI. More...
 
#define IPSDKCUDA_CHECK_INSITU(pImageAttr1, pImageAttr2)   launcherInfo._bInSituProcess = pImageAttr1->getImage().containSameData(pImageAttr2->getImage())
 This macro stores in launcherInfo._bInSituProcess the value true if the two input image attributes point to the same data.
 
#define IPSDKCUDA_GET_BLOCK_SIZE_2D
 This macro calls stores in an already declared variable launcherInfo (of type LauncherInfo) the number of threads per blocks in both x and y directions. More...
 
#define IPSDKCUDA_GET_BLOCK_SIZE_3D
 This macro calls stores in an already declared variable launcherInfo (of type LauncherInfo) the number of threads per blocks in each direction for a 3D process. More...
 
#define IPSDKCUDA_FREE_BUFFER_DATA_MACRO(r, data, elem)   ipsdk::image::tools::freeBufferDataColl(IPSDKCUDA_GENERATE_IMAGE_BUFFER_NAME_COLL(elem));
 Free the data contained by elem. elem is anGpuLvl3 image attributes and the T** data stored on the device is obtained thanks to the macro IPSDKCUDA_GENERATE_IMAGE_BUFFER_NAME_COLL.
 
#define IPSDKCUDA_FREE_BUFFER_DATA_COLL(SI)   BOOST_PP_SEQ_FOR_EACH(IPSDKCUDA_FREE_BUFFER_DATA_MACRO, _, SI)
 Free the data contained all the images contained in the sequence images SI.
 
#define IPSDKCUDA_LAUNCH_KERNEL(AlgoName, SeqArg)
 Macro calling the kernel launcher function. The called function is named AlgoName_knlLauncher and its first parameters must be launcherInfo. The other parameters are listed in SeqArg For image parameters, the parameter must be the image data buffer, accessible thanks to the macro IPSDKCUDA_GENERATE_IMAGE_BUFFER_NAME. The result of the function is tested to notify the calculation success or failure. More...
 
#define IPSDKCUDA_LAUNCH_KERNEL_WITH_FILTERING_INFO(AlgoName, TIn, SeqArg)
 Macro calling the kernel launcher function with filtering parameters. The additional parameters, in comparison with the IPSDKCUDA_LAUNCH_KERNEL macro are : More...
 
#define IPSDKCUDA_LAUNCH_KERNEL_WITH_SE_INFO(AlgoName, T, SeqArg)
 Macro calling the kernel launcher function with structuring element parameters. The additional parameters, in comparison with the IPSDKCUDA_LAUNCH_KERNEL macro are : More...
 
#define IPSDKCUDA_EXTRACT_FILTERING_INFO_2D(pInKnlXY, vOffsetsX, vOffsetsY, vCoefs)
 Macro declaring and filling the FilteringKernelInfo data structure that will be passed to the Cuda Kernel for 2D filtering. More...
 
#define IPSDKCUDA_EXTRACT_FILTERING_INFO_3D(pInKnlXYZ, vOffsetsX, vOffsetsY, vOffsetsZ, vCoefs)
 Macro declaring and filling the FilteringKernelInfo data structure that will be passed to the Cuda Kernel for 3D filtering. More...
 
#define IPSDKCUDA_EXTRACT_SE_INFO_2D(pInSEXY, vOffsetsX, vOffsetsY)
 Macro declaring and filling the StructuringElementInfo data structure that will be passed to the Cuda Kernel for 2D filtering. More...
 
#define IPSDKCUDA_EXTRACT_SE_INFO_3D(pInSEXYZ, vOffsetsX, vOffsetsY, vOffsetsZ)
 Macro declaring and filling the StructuringElementInfo data structure that will be passed to the Cuda Kernel for 3D filtering. More...
 

Detailed Description

Source part of macros set for processing algorithm class implementation.

Author
E. Noirfalise
Date
2014/02/17

Macro Definition Documentation

◆ IPSDK_START_ALGORITHM_FUNCTIONS_REGISTRATION

#define IPSDK_START_ALGORITHM_FUNCTIONS_REGISTRATION (   className)
Value:
static bool details::functionRegistration() { \
typedef className CurProcessorType; \
className::DataTypeIdColl dataTypeIdColl; \
ipsdk::processor::InstructionSetsIdentifier instructionSetsIdentifier; \
className::FunctionType functionPtr; \
(functionPtr); \
className::FunctionId functionId; \
ipsdk::BoolResult bRegistred; \
std::string errorMsgColl; \
className::FunctionSelector& functionSelector = className::retrieveFunctionSelector();
ProcessingResult< bool > BoolResult
typedef for boolean results associated to a string description
Definition: ProcessingResultTypes.h:29

macro allowing to start registration for processing algorithm functions

◆ IPSDK_REGISTER_GENERIC_ALGORITHM_FUNCTION

#define IPSDK_REGISTER_GENERIC_ALGORITHM_FUNCTION (   dataTypeSeq,
  isSeq,
  functionEfficiency,
  functionName 
)
Value:
{ \
BOOST_STATIC_ASSERT_MSG(BOOST_PP_DEC(BOOST_PP_SEQ_SIZE((_)dataTypeSeq)) == \
CurProcessorType::g_nbTypesForFunSelection, \
"Invalid number of data type in sequence for function selection"); \
instructionSetsIdentifier.init(BOOST_PP_ENUM(BOOST_PP_SEQ_SIZE(isSeq), \
if (functionSelector.isSupported(instructionSetsIdentifier) == true) { \
functionPtr = static_cast<CurProcessorType::FunctionType>( \
&CurProcessorType::functionName< \
BOOST_PP_ENUM(BOOST_PP_DEC(BOOST_PP_SEQ_SIZE((_)dataTypeSeq)), \
BOOST_PP_COMMA_IF(BOOST_PP_DEC(BOOST_PP_SEQ_SIZE((_)dataTypeSeq))) \
BOOST_PP_ENUM(BOOST_PP_SEQ_SIZE(isSeq), IPSDK_ENUM_INSTRUCTION_SET_MACRO, isSeq) \
>); \
BOOST_PP_SEQ_FOR_EACH_I(IPSDK_INIT_IDENTIFIER_FROM_VALUE_MACRO, \
_, ((_)(_))dataTypeSeq); \
IPSDK_REGISTER_ALGORITHM_FUNCTION_MACRO(CurProcessorType, dataTypeSeq, \
instructionSetsIdentifier, functionEfficiency) \
} \
}
#define IPSDK_INIT_IDENTIFIER_FROM_VALUE_MACRO(r, _, idx, dataType)
[Internal] macro allowing to generate a data type identifier from a value (first element is not proce...
Definition: ProcessingAlgorithmSrcDetailsMacros.h:38
#define IPSDK_ENUM_IDENTIFIER_VALUE_MACRO(z, n, dataTypeSeq)
[Internal] macro allowing to enumerate data type identifiers underlying values
Definition: ProcessingAlgorithmSrcDetailsMacros.h:30
#define IPSDK_ENUM_INSTRUCTION_SET_MACRO(z, n, seq)
[Internal] macro allowing to enumerate instruction sets
Definition: ProcessingAlgorithmHdrDetailsMacros.h:35

macro allowing to register a generic (template) processing algorithm function

◆ IPSDK_REGISTER_SPECIFIC_ALGORITHM_FUNCTION

#define IPSDK_REGISTER_SPECIFIC_ALGORITHM_FUNCTION (   dataTypeSeq,
  isSeq,
  functionEfficiency,
  functionName 
)
Value:
{ \
BOOST_STATIC_ASSERT_MSG(BOOST_PP_DEC(BOOST_PP_SEQ_SIZE((_)dataTypeSeq)) == \
CurProcessorType::g_nbTypesForFunSelection, \
"Invalid number of data type in sequence for function selection"); \
instructionSetsIdentifier.init(BOOST_PP_ENUM(BOOST_PP_SEQ_SIZE(isSeq), \
if (functionSelector.isSupported(instructionSetsIdentifier) == true) { \
functionPtr = static_cast<CurProcessorType::FunctionType>(&CurProcessorType:: \
BOOST_PP_EXPAND functionName); \
BOOST_PP_SEQ_FOR_EACH_I(IPSDK_INIT_IDENTIFIER_FROM_VALUE_MACRO, \
_, ((_)(_))dataTypeSeq); \
IPSDK_REGISTER_ALGORITHM_FUNCTION_MACRO(CurProcessorType, dataTypeSeq, \
instructionSetsIdentifier, functionEfficiency) \
} \
}
#define IPSDK_INIT_IDENTIFIER_FROM_VALUE_MACRO(r, _, idx, dataType)
[Internal] macro allowing to generate a data type identifier from a value (first element is not proce...
Definition: ProcessingAlgorithmSrcDetailsMacros.h:38
#define IPSDK_ENUM_INSTRUCTION_SET_MACRO(z, n, seq)
[Internal] macro allowing to enumerate instruction sets
Definition: ProcessingAlgorithmHdrDetailsMacros.h:35

macro allowing to register a specific processing algorithm function

◆ IPSDK_END_ALGORITHM_FUNCTIONS_REGISTRATION

#define IPSDK_END_ALGORITHM_FUNCTIONS_REGISTRATION ( )
Value:
if (errorMsgColl.size() != 0) { \
IPSDKBASEPROCESSING_LOG_TRACE( \
errorMsgColl); \
} \
return true; \
} \
static bool details::safeFunctionRegistration() { \
if ((ipsdk::eInstructionSet::COMPIL_IS_TYPE1 == ipsdk::eInstructionSet::eIS_Standard || \
ipsdk::core::isAvailable(ipsdk::eInstructionSet::COMPIL_IS_TYPE1) == true) && \
(ipsdk::eInstructionSet::COMPIL_IS_TYPE2 == ipsdk::eInstructionSet::eIS_Standard || \
ipsdk::core::isAvailable(ipsdk::eInstructionSet::COMPIL_IS_TYPE2) == true) && \
(ipsdk::eInstructionSet::COMPIL_IS_TYPE3 == ipsdk::eInstructionSet::eIS_Standard || \
ipsdk::core::isAvailable(ipsdk::eInstructionSet::COMPIL_IS_TYPE3) == true)) \
return details::functionRegistration(); \
else \
return false; \
} \
static bool g_bAlgorithmFunctionsRegistred = details::safeFunctionRegistration();
IPSDKCORE_API bool isAvailable(const eInstructionSet &instructionSet)
function allowing to check for instruction set availability on local processor
Failed to register image processing function s.
Definition: AlgorithmFunctionLogMessages.h:59
compiler optimisations only
Definition: InstructionSetTypes.h:34

macro allowing to end registration for image processing functions

◆ IPSDK_IMPLEMENT_GPU_PROCESSING_ALGORITHM

#define IPSDK_IMPLEMENT_GPU_PROCESSING_ALGORITHM (   libraryName,
  namespaceSeq,
  className,
  eMsgEnum,
  version 
)
Value:
const className::FunctionSelector& className::accessFunctionSelector() \
{ \
return retrieveFunctionSelector(); \
} \
const className::FunctionSelector& className::getFunctionSelector() const \
{ \
return retrieveFunctionSelector(); \
} \
className::FunctionSelector& className::retrieveFunctionSelector() \
{ \
static className::FunctionSelector g_functionSelector; \
return g_functionSelector; \
} \
IPSDK_IMPLEMENT_PROCESSOR(libraryName, namespaceSeq, className, eMsgEnum, version)

macro allowing to implement a processing algorithm

◆ IPSDKCUDA_CAST_FCT_PTR

#define IPSDKCUDA_CAST_FCT_PTR (   ST)
Value:
functionPtr = static_cast<CudaFunctionSelector::FunctionType>( \
&CurProcessorType::genericKernelLauncher< \
BOOST_PP_SEQ_ENUM( \
BOOST_PP_SEQ_FOR_EACH(IPSDKCUDA_GET_IDENTIFIER_SEQ_VALUE_IBT, _, ST))>);

◆ IPSDKCUDA_REGISTER_FUNCTION

#define IPSDKCUDA_REGISTER_FUNCTION (   r,
  product 
)
Value:
IPSDKCUDA_CAST_FCT_PTR(product) \
ISPDKCUDA_INIT_IDENTIFIERS(product); \
dataTypeIdColl.init(BOOST_PP_ENUM(BOOST_PP_SEQ_SIZE(product), \
functionId.init(dataTypeIdColl, functionPtr); \
bRegistred = functionSelector.registerFunction(functionId); \
if (bRegistred == false) \
errorMsgColl += bRegistred.getMsg() + "\n";
#define IPSDK_ENUM_DATATYPE_IDENTIFIER_MACRO(z, n, _)
[Internal] macro allowing to enumerate data type identifiers
Definition: ProcessingAlgorithmHdrDetailsMacros.h:30

◆ IPSDKCUDA_REGISTER_GENERIC_GPU_ALGORITHM_FUNCTION

#define IPSDKCUDA_REGISTER_GENERIC_GPU_ALGORITHM_FUNCTION (   ST)
Value:
ISPDKCUDA_DECLARE_IDENTIFIERS(BOOST_PP_SEQ_ELEM(0, ST)); \
BOOST_PP_SEQ_FOR_EACH_PRODUCT(IPSDKCUDA_REGISTER_FUNCTION, ST)

◆ IPSDKCUDA_REGISTER_NOTYPE_GPU_ALGORITHM_FUNCTION

#define IPSDKCUDA_REGISTER_NOTYPE_GPU_ALGORITHM_FUNCTION ( )
Value:
functionPtr = static_cast<CudaFunctionSelector::FunctionType>(&CurProcessorType::genericKernelLauncher);\
dataTypeIdColl.init(); \
functionId.init(dataTypeIdColl, functionPtr); \
bRegistred = functionSelector.registerFunction(functionId); \
if (bRegistred == false) \
errorMsgColl += bRegistred.getMsg() + "\n";

◆ IPSDKCUDA_START_GPU_FUNCTIONS_REGISTRATION

#define IPSDKCUDA_START_GPU_FUNCTIONS_REGISTRATION (   AlgoName)
Value:
bool details::functionRegistration() \
{ \
typedef AlgoName CurProcessorType; \
ipsdk::processor::DataTypeIdentifierColl dataTypeIdColl; \
typedef CudaFunctionSelector::FunctionType FunctionType; \
FunctionType functionPtr; \
(functionPtr); \
CudaFunctionSelector::FunctionId functionId; \
ipsdk::BoolResult bRegistred; \
std::string errorMsgColl; \
CudaFunctionSelector& functionSelector = \
CurProcessorType::retrieveFunctionSelector();
ProcessingResult< bool > BoolResult
typedef for boolean results associated to a string description
Definition: ProcessingResultTypes.h:29

◆ IPSDKCUDA_END_GPU_FUNCTIONS_REGISTRATION

#define IPSDKCUDA_END_GPU_FUNCTIONS_REGISTRATION ( )
Value:
if (errorMsgColl.size() != 0) { \
IPSDKBASEPROCESSING_LOG_TRACE( \
errorMsgColl); \
} \
return true; \
} \
static bool g_bAlgorithmFunctionsRegistred = details::functionRegistration();
Failed to register image processing function s.
Definition: AlgorithmFunctionLogMessages.h:59

◆ IPSDKCUDA_EXTRACT_DATA_FROM_IMAGE_MACRO

#define IPSDKCUDA_EXTRACT_DATA_FROM_IMAGE_MACRO (   r,
  data,
  elem 
)
Value:
BOOST_PP_TUPLE_ELEM(0, elem) CudaImage& IPSDKCUDA_GENERATE_GPU_IMAGE_NAME(BOOST_PP_TUPLE_ELEM(2, elem)) = \
static_cast<BOOST_PP_TUPLE_ELEM(0, elem) CudaImage&>(BOOST_PP_TUPLE_ELEM(2, elem)->getImage()); \
BOOST_PP_TUPLE_ELEM(0, elem) BOOST_PP_TUPLE_ELEM(1, elem)** \
IPSDKCUDA_GENERATE_IMAGE_BUFFER_NAME_COLL(BOOST_PP_TUPLE_ELEM(2, elem)) = \
ipsdk::image::tools::extractBufferDataCollToGpu<BOOST_PP_TUPLE_ELEM(1, elem)>( \
IPSDKCUDA_GENERATE_GPU_IMAGE_NAME(BOOST_PP_TUPLE_ELEM(2, elem)));
#define IPSDKCUDA_GENERATE_GPU_IMAGE_NAME(ImgName)
Generates the name of the variable storing the GPU image corresponding to ImgName.
Definition: ProcessingAlgorithmSrcMacros.h:249

Macro allowing to extract the GPU image from the attribute indicated in the 3rd item of elem and also extract the corresponding buffer. The argument data is ignored and elem is a triplet. If the image is an input constant data, elem looks like (const, T, _pInImg), where T is the buffer data type (e.g. int). If the image is an output data, the first fiel of elem is empty : (, T, _pOutImg) As an example, the output of IPSDKCUDA_EXTRACT_DATA_FROM_IMAGE_MACRO(r, data, (const, TIn1, _pInSubGpuImg1)) is : const CudaImage& img_pInSubGpuImg1 = static_cast<const CudaImage&>(_pInSubGpuImg1->getImage()); const TIn1* img_pInSubGpuImg1Buf = ipsdk::image::tools::extractBufferData<TIn1>(img_pInSubGpuImg1, _deviceIdx);.

◆ IPSDKCUDA_EXTRACT_DATA_FROM_IMAGES

#define IPSDKCUDA_EXTRACT_DATA_FROM_IMAGES (   SI)
Value:
BOOST_PP_SEQ_FOR_EACH(IPSDKCUDA_EXTRACT_DATA_FROM_IMAGE_MACRO, _, SI) \
const unsigned long sizeX = static_cast<unsigned long>(IPSDKCUDA_GENERATE_GPU_IMAGE_NAME(BOOST_PP_TUPLE_ELEM(2, BOOST_PP_SEQ_ELEM(0, SI))).getSizeX()); \
const unsigned long sizeY = static_cast<unsigned long>(IPSDKCUDA_GENERATE_GPU_IMAGE_NAME(BOOST_PP_TUPLE_ELEM(2, BOOST_PP_SEQ_ELEM(0, SI))).getSizeY()); \
const unsigned long sizeZ = static_cast<unsigned long>(IPSDKCUDA_GENERATE_GPU_IMAGE_NAME(BOOST_PP_TUPLE_ELEM(2, BOOST_PP_SEQ_ELEM(0, SI))).getSizeZ()); \
const unsigned long sizeC = static_cast<unsigned long>(IPSDKCUDA_GENERATE_GPU_IMAGE_NAME(BOOST_PP_TUPLE_ELEM(2, BOOST_PP_SEQ_ELEM(0, SI))).getSizeC()); \
const unsigned long sizeT = static_cast<unsigned long>(IPSDKCUDA_GENERATE_GPU_IMAGE_NAME(BOOST_PP_TUPLE_ELEM(2, BOOST_PP_SEQ_ELEM(0, SI))).getSizeT()); \
ipsdk::gpu::LauncherInfo launcherInfo; \
launcherInfo._bInSituProcess = false; \
launcherInfo._imgSizeInfo._sizeX = sizeX; \
launcherInfo._imgSizeInfo._sizeY = sizeY; \
launcherInfo._imgSizeInfo._sizeZ = sizeZ; \
launcherInfo._imgSizeInfo._sizeC = sizeC; \
launcherInfo._imgSizeInfo._sizeT = sizeT;
#define IPSDKCUDA_EXTRACT_DATA_FROM_IMAGE_MACRO(r, data, elem)
Macro allowing to extract the GPU image from the attribute indicated in the 3rd item of elem and also...
Definition: ProcessingAlgorithmSrcMacros.h:275
#define IPSDKCUDA_GENERATE_GPU_IMAGE_NAME(ImgName)
Generates the name of the variable storing the GPU image corresponding to ImgName.
Definition: ProcessingAlgorithmSrcMacros.h:249

This macro calls IPSDKCUDA_EXTRACT_DATA_FROM_IMAGE_MACRO for each item of the image attribute sequence SI to extract the image and their buffers and then extract the sizes along X, Y, Z, C and T from the first item of SI.

◆ IPSDKCUDA_GET_BLOCK_SIZE_2D

#define IPSDKCUDA_GET_BLOCK_SIZE_2D
Value:
launcherInfo._blockSize = gpuDescription.getBlockSize2d(static_cast<int>(_deviceIdx)); \
launcherInfo._nbMultiProcessors = gpuDescription.getNbMultiProcessors(static_cast<int>(_deviceIdx)); \
launcherInfo._nbThreadsPerMP = gpuDescription.getMaxThreadsPerMultiProcessor(static_cast<int>(_deviceIdx)); \
launcherInfo._nbThreadsPerBlock = gpuDescription.getMaxThreadsPerBlock(static_cast<int>(_deviceIdx));
hard::ComputerDescription & getComputerDescription()
retrieve computer description associated to computer informations
GpuDescription & getGpuDescription()
computer host name
LocalComputerInfo & getLocalComputerInfo()
retrieve local computer informations associated to pool
static ComputerInfoPool & getInstance()
retrieve single instance of object

This macro calls stores in an already declared variable launcherInfo (of type LauncherInfo) the number of threads per blocks in both x and y directions.

◆ IPSDKCUDA_GET_BLOCK_SIZE_3D

#define IPSDKCUDA_GET_BLOCK_SIZE_3D
Value:
launcherInfo._blockSize = gpuDescription.getBlockSize3d(static_cast<int>(_deviceIdx)); \
launcherInfo._nbMultiProcessors = gpuDescription.getNbMultiProcessors(static_cast<int>(_deviceIdx)); \
launcherInfo._nbThreadsPerMP = gpuDescription.getMaxThreadsPerMultiProcessor(static_cast<int>(_deviceIdx)); \
launcherInfo._nbThreadsPerBlock = gpuDescription.getMaxThreadsPerBlock(static_cast<int>(_deviceIdx));
hard::ComputerDescription & getComputerDescription()
retrieve computer description associated to computer informations
GpuDescription & getGpuDescription()
computer host name
LocalComputerInfo & getLocalComputerInfo()
retrieve local computer informations associated to pool
static ComputerInfoPool & getInstance()
retrieve single instance of object

This macro calls stores in an already declared variable launcherInfo (of type LauncherInfo) the number of threads per blocks in each direction for a 3D process.

◆ IPSDKCUDA_LAUNCH_KERNEL

#define IPSDKCUDA_LAUNCH_KERNEL (   AlgoName,
  SeqArg 
)
Value:
ipsdk::gpu::CudaResult res = BOOST_PP_CAT(AlgoName, _knlLauncher)(&launcherInfo, BOOST_PP_SEQ_ENUM(SeqArg));\
if(!res._bResult) return BoolResult(false, res._msg);
ProcessingResult< bool > BoolResult
typedef for boolean results associated to a string description
Definition: ProcessingResultTypes.h:29

Macro calling the kernel launcher function. The called function is named AlgoName_knlLauncher and its first parameters must be launcherInfo. The other parameters are listed in SeqArg For image parameters, the parameter must be the image data buffer, accessible thanks to the macro IPSDKCUDA_GENERATE_IMAGE_BUFFER_NAME. The result of the function is tested to notify the calculation success or failure.

◆ IPSDKCUDA_LAUNCH_KERNEL_WITH_FILTERING_INFO

#define IPSDKCUDA_LAUNCH_KERNEL_WITH_FILTERING_INFO (   AlgoName,
  TIn,
  SeqArg 
)
Value:
ipsdk::gpu::CudaResult res = BOOST_PP_CAT(AlgoName, _knlLauncher)(&launcherInfo, &knlInfo, \
_borderPolicyValue, \
static_cast<TIn>(_outOfImageValue), \
BOOST_PP_SEQ_ENUM(SeqArg)); \
if(!res._bResult) return BoolResult(false, res._msg);
ProcessingResult< bool > BoolResult
typedef for boolean results associated to a string description
Definition: ProcessingResultTypes.h:29

Macro calling the kernel launcher function with filtering parameters. The additional parameters, in comparison with the IPSDKCUDA_LAUNCH_KERNEL macro are :

  • the pointer to the kernel info data structure
  • the border policy (a class attribute called _borderPolicyValue)
  • the out of image value, cast to the input image data type TIn (a class attribute called _outOfImageValue)

◆ IPSDKCUDA_LAUNCH_KERNEL_WITH_SE_INFO

#define IPSDKCUDA_LAUNCH_KERNEL_WITH_SE_INFO (   AlgoName,
  T,
  SeqArg 
)
Value:
ipsdk::gpu::CudaResult res = BOOST_PP_CAT(AlgoName, _knlLauncher)(&launcherInfo, &seInfo, \
_borderPolicyValue, \
static_cast<T>(_outOfImageValue), \
BOOST_PP_SEQ_ENUM(SeqArg)); \
if(!res._bResult) return BoolResult(false, res._msg);
ProcessingResult< bool > BoolResult
typedef for boolean results associated to a string description
Definition: ProcessingResultTypes.h:29

Macro calling the kernel launcher function with structuring element parameters. The additional parameters, in comparison with the IPSDKCUDA_LAUNCH_KERNEL macro are :

  • the pointer to the structuring element info data structure
  • the border policy (a class attribute called _borderPolicyValue)
  • the out of image value, cast to the input image data type (a class attribute called _outOfImageValue)

◆ IPSDKCUDA_EXTRACT_FILTERING_INFO_2D

#define IPSDKCUDA_EXTRACT_FILTERING_INFO_2D (   pInKnlXY,
  vOffsetsX,
  vOffsetsY,
  vCoefs 
)
Value:
struct ipsdk::gpu::FilteringKernelInfo<float> knlInfo; \
knlInfo._nbData = static_cast<unsigned int>(vCoefs.size()); \
knlInfo._paddingX = pInKnlXY->getKernel().getSizeX() / 2; \
knlInfo._paddingY = pInKnlXY->getKernel().getSizeY() / 2; \
knlInfo._pOffsetsX = vOffsetsX.data(); \
knlInfo._pOffsetsY = vOffsetsY.data(); \
knlInfo._pCoefs = vCoefs.data();

Macro declaring and filling the FilteringKernelInfo data structure that will be passed to the Cuda Kernel for 2D filtering.

◆ IPSDKCUDA_EXTRACT_FILTERING_INFO_3D

#define IPSDKCUDA_EXTRACT_FILTERING_INFO_3D (   pInKnlXYZ,
  vOffsetsX,
  vOffsetsY,
  vOffsetsZ,
  vCoefs 
)
Value:
struct ipsdk::gpu::FilteringKernelInfo<float> knlInfo; \
knlInfo._nbData = static_cast<unsigned int>(vCoefs.size()); \
knlInfo._paddingX = pInKnlXYZ->getKernel().getSizeX() / 2; \
knlInfo._paddingY = pInKnlXYZ->getKernel().getSizeY() / 2; \
knlInfo._paddingZ = pInKnlXYZ->getKernel().getSizeZ() / 2; \
knlInfo._pOffsetsX = vOffsetsX.data(); \
knlInfo._pOffsetsY = vOffsetsY.data(); \
knlInfo._pOffsetsZ = vOffsetsZ.data(); \
knlInfo._pCoefs = vCoefs.data();

Macro declaring and filling the FilteringKernelInfo data structure that will be passed to the Cuda Kernel for 3D filtering.

◆ IPSDKCUDA_EXTRACT_SE_INFO_2D

#define IPSDKCUDA_EXTRACT_SE_INFO_2D (   pInSEXY,
  vOffsetsX,
  vOffsetsY 
)
Value:
struct ipsdk::gpu::StructuringElementInfo seInfo; \
seInfo._nbData = static_cast<unsigned int>(vOffsetsX.size()); \
seInfo._paddingX = pInSEXY->getStructuringElement().getSizeX() / 2; \
seInfo._paddingY = pInSEXY->getStructuringElement().getSizeY() / 2; \
seInfo._pOffsetsX = vOffsetsX.data(); \
seInfo._pOffsetsY = vOffsetsY.data();

Macro declaring and filling the StructuringElementInfo data structure that will be passed to the Cuda Kernel for 2D filtering.

◆ IPSDKCUDA_EXTRACT_SE_INFO_3D

#define IPSDKCUDA_EXTRACT_SE_INFO_3D (   pInSEXYZ,
  vOffsetsX,
  vOffsetsY,
  vOffsetsZ 
)
Value:
struct ipsdk::gpu::StructuringElementInfo seInfo; \
seInfo._nbData = static_cast<unsigned int>(vOffsetsX.size()); \
seInfo._paddingX = pInSEXYZ->getStructuringElement().getSizeX() / 2; \
seInfo._paddingY = pInSEXYZ->getStructuringElement().getSizeY() / 2; \
seInfo._paddingZ = pInSEXYZ->getStructuringElement().getSizeZ() / 2; \
seInfo._pOffsetsX = vOffsetsX.data(); \
seInfo._pOffsetsY = vOffsetsY.data(); \
seInfo._pOffsetsZ = vOffsetsZ.data();

Macro declaring and filling the StructuringElementInfo data structure that will be passed to the Cuda Kernel for 3D filtering.