Home || Architecture || Video Search || Visual Search || Scripts || Applications || Important Messages || OGL || Src

PatQueueBased.h

Go to the documentation of this file.
00001 #ifndef Impala_Core_Array_Pattern_PatQueueBased_h
00002 #define Impala_Core_Array_Pattern_PatQueueBased_h
00003 
00004 #include "Core/Array/Pattern/FuncQueueBased.h"
00005 
00006 #ifdef PX_HORUS_USED
00007 #include "Core/Array/Pattern/PxArrayFunc.h"
00008 #include "Core/Array/Pattern/PxStateTrans.h"
00009 #endif
00010 
00011 namespace Impala
00012 {
00013 namespace Core
00014 {
00015 namespace Array
00016 {
00017 namespace Pattern
00018 {
00019 
00020 
00021 template<class DstArrayT, class SrcArrayT, class MaskArrayT, class QbT>
00022 inline void
00023 PatQueueBased(DstArrayT*& dst, SrcArrayT* src, MaskArrayT* mask,
00024               QbT& qb, int connectivity = 8, int radiusSqr = -1)
00025 {
00026     if (dst == 0)
00027         dst = ArrayClone<DstArrayT>(src);
00028 
00029 #ifdef PX_HORUS_USED
00030     if (!PxRunParallel()) {                         // run sequential
00031 #endif
00032         FuncQueueBasedDispatch(dst, src,
00033                                mask, qb, connectivity, radiusSqr);
00034 
00035 #ifdef PX_HORUS_USED
00036     } else {                                        // run parallel
00037         PX_COUT << "NOTE: PatQueueBased NOT PARALLELIZED YET!"
00038                 << PX_ENDL;
00039         PxArrayForceNonDistributed(src);
00040         PxArrayForceNonDistributed(dst);
00041         FuncQueueBasedDispatch(dst, src,
00042                                mask, qb, connectivity, radiusSqr);
00043     }
00044 #endif
00045 }
00046 
00047 
00048 template<class DstArrayT, class SrcArrayT, class QbT>
00049 inline void
00050 PatQueueBased(DstArrayT*& dst, SrcArrayT* src, QbT& qb,
00051               int connectivity = 8, int radiusSqr = -1)
00052 {
00053     if (dst == 0)
00054         dst = ArrayClone<DstArrayT>(src);
00055 
00056 #ifdef PX_HORUS_USED
00057     if (!PxRunParallel()) {                         // run sequential
00058 #endif
00059         FuncQueueBasedDispatch(dst, src,
00060                                qb, connectivity, radiusSqr);
00061 
00062 #ifdef PX_HORUS_USED
00063     } else {                                        // run parallel
00064         PX_COUT << "NOTE: PatQueueBased NOT PARALLELIZED YET!"
00065                 << PX_ENDL;
00066         PxArrayForceNonDistributed(src);
00067         PxArrayForceNonDistributed(dst);
00068         FuncQueueBasedDispatch(dst, src,
00069                                qb, connectivity, radiusSqr);
00070     }
00071 #endif
00072 }
00073 
00074 } // namespace Pattern
00075 } // namespace Array
00076 } // namespace Core
00077 } // namespace Impala
00078 
00079 #endif

Generated on Fri Mar 19 09:30:51 2010 for ImpalaSrc by  doxygen 1.5.1