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

PatM9N4PixOp.h

Go to the documentation of this file.
00001 #ifndef Impala_Core_Array_Pattern_PatM4N9PixOp_h
00002 #define Impala_Core_Array_Pattern_PatM4N9PixOp_h
00003 
00004 #include "Core/Array/Pattern/FuncMNpo.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 MNpoT>
00022 inline void
00023 PatM9N4PixOp(DstArrayT*& d1, DstArrayT*& d2, DstArrayT*& d3,
00024              DstArrayT*& d4, SrcArrayT* s1, SrcArrayT* s2,
00025              SrcArrayT* s3, SrcArrayT* s4, SrcArrayT* s5,
00026              SrcArrayT* s6, SrcArrayT* s7, SrcArrayT* s8,
00027              SrcArrayT* s9, MNpoT& mnpo)
00028 {
00029     if (d1 == 0)
00030         d1 = ArrayClone<DstArrayT>(s1);
00031     if (d2 == 0)
00032         d2 = ArrayClone<DstArrayT>(s1);
00033     if (d3 == 0)
00034         d3 = ArrayClone<DstArrayT>(s1);
00035     if (d4 == 0)
00036         d4 = ArrayClone<DstArrayT>(s1);
00037 
00038 #ifdef PX_HORUS_USED
00039     if (!PxRunParallel()) {                         // run sequential
00040 #endif
00041         FuncM9N4po(d1, d2, d3, d4,
00042                    s1, s2, s3, s4, s5, s6, s7, s8, s9, mnpo);
00043 
00044 #ifdef PX_HORUS_USED
00045     } else {                                        // run parallel
00046         PxArrayPreStateTrans(s1, PAR_PART, STRONG);
00047         PxArrayPreStateTrans(s2, PAR_PART, STRONG);
00048         PxArrayPreStateTrans(s3, PAR_PART, STRONG);
00049         PxArrayPreStateTrans(s4, PAR_PART, STRONG);
00050         PxArrayPreStateTrans(s5, PAR_PART, STRONG);
00051         PxArrayPreStateTrans(s6, PAR_PART, STRONG);
00052         PxArrayPreStateTrans(s7, PAR_PART, STRONG);
00053         PxArrayPreStateTrans(s8, PAR_PART, STRONG);
00054         PxArrayPreStateTrans(s9, PAR_PART, STRONG);
00055         PxArrayPreStateTrans(d1, PAR_PART, WEAK);
00056         PxArrayPreStateTrans(d2, PAR_PART, WEAK);
00057         PxArrayPreStateTrans(d3, PAR_PART, WEAK);
00058         PxArrayPreStateTrans(d4, PAR_PART, WEAK);
00059         FuncM9N4po(PxArrayPD(d1), PxArrayPD(d2),
00060                    PxArrayPD(d3), PxArrayPD(d4),
00061                    PxArrayPD(s1), PxArrayPD(s2), PxArrayPD(s3),
00062                    PxArrayPD(s4), PxArrayPD(s5), PxArrayPD(s6),
00063                    PxArrayPD(s7), PxArrayPD(s8), PxArrayPD(s9), mnpo);
00064         PxArrayPostStateTrans(d1);
00065         PxArrayPostStateTrans(d2);
00066         PxArrayPostStateTrans(d3);
00067         PxArrayPostStateTrans(d4);
00068 
00069         if (!PxRunLazyParallel()) {
00070             PxArrayForceNonDistributed(s1);
00071             PxArrayForceNonDistributed(s2);
00072             PxArrayForceNonDistributed(s3);
00073             PxArrayForceNonDistributed(s4);
00074             PxArrayForceNonDistributed(s5);
00075             PxArrayForceNonDistributed(s6);
00076             PxArrayForceNonDistributed(s7);
00077             PxArrayForceNonDistributed(s8);
00078             PxArrayForceNonDistributed(s9);
00079             PxArrayForceNonDistributed(d1);
00080             PxArrayForceNonDistributed(d2);
00081             PxArrayForceNonDistributed(d3);
00082             PxArrayForceNonDistributed(d4);
00083         }
00084     }
00085 #endif
00086 }
00087 
00088 
00089 template<class DstArrayT, class SrcArrayT, class MNpoT>
00090 inline std::vector<DstArrayT*>
00091 PatM9N4PixOp(SrcArrayT* s1, SrcArrayT* s2, SrcArrayT* s3,
00092              SrcArrayT* s4, SrcArrayT* s5, SrcArrayT* s6,
00093              SrcArrayT* s7, SrcArrayT* s8, SrcArrayT* s9, MNpoT& mnpo)
00094 {
00095     DstArrayT* d1 = ArrayClone<DstArrayT>(s1);
00096     DstArrayT* d2 = ArrayClone<DstArrayT>(s1);
00097     DstArrayT* d3 = ArrayClone<DstArrayT>(s1);
00098     DstArrayT* d4 = ArrayClone<DstArrayT>(s1);
00099 
00100     PatM9N4PixOp(d1, d2, d3, d4,
00101                  s1, s2, s3, s4, s5, s6, s7, s8, s9, mnpo);
00102 
00103     std::vector<DstArrayT*> res;
00104     res.push_back(d1);
00105     res.push_back(d2);
00106     res.push_back(d3);
00107     res.push_back(d4);
00108     return res;
00109 }
00110 
00111 } // namespace Pattern
00112 } // namespace Array
00113 } // namespace Core
00114 } // namespace Impala
00115 
00116 #endif

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