@@ -75,38 +75,6 @@ KERNEL(
75
75
}\n
76
76
)
77
77
78
- KERNEL (
79
- \n__kernel void pixAND (__global int * dword , __global int * sword , __global int * outword ,
80
- const int wpl , const int h )
81
- {
82
- const unsigned int row = get_global_id (1 );
83
- const unsigned int col = get_global_id (0 );
84
- const unsigned int pos = row * wpl + col ;
85
-
86
- //Ignore the execss
87
- if (row >= h || col >= wpl )
88
- return ;
89
-
90
- * (outword + pos ) = * (dword + pos ) & (* (sword + pos ));
91
- }\n
92
- )
93
-
94
- KERNEL (
95
- \n__kernel void pixOR (__global int * dword , __global int * sword , __global int * outword ,
96
- const int wpl , const int h )
97
- {
98
- const unsigned int row = get_global_id (1 );
99
- const unsigned int col = get_global_id (0 );
100
- const unsigned int pos = row * wpl + col ;
101
-
102
- //Ignore the execss
103
- if (row >= h || col >= wpl )
104
- return ;
105
-
106
- * (outword + pos ) = * (dword + pos ) | (* (sword + pos ));
107
- }\n
108
- )
109
-
110
78
KERNEL (
111
79
\n__kernel void morphoDilateHor_5x5 (__global int * sword ,__global int * dword ,
112
80
const int wpl , const int h )
@@ -885,36 +853,6 @@ void kernel_HistogramRectOneChannel(
885
853
}
886
854
)
887
855
888
-
889
- KERNEL (
890
- // unused
891
- \n __attribute__((reqd_work_group_size (256 , 1 , 1 )))
892
- \n __kernel
893
- \n void kernel_HistogramRectAllChannels_Grey (
894
- \n __global const uchar * data ,
895
- \n uint numPixels ,
896
- \n __global uint * histBuffer ) { // each wg will write HIST_SIZE*NUM_CHANNELS into this result; cpu will accumulate across wg's
897
- \n
898
- \n /* declare variables */
899
- \n
900
- \n // work indices
901
- \n size_t groupId = get_group_id (0 );
902
- \n size_t localId = get_local_id (0 ); // 0 -> 256-1
903
- \n size_t globalId = get_global_id (0 ); // 0 -> 8*10*256-1=20480-1
904
- \n uint numThreads = get_global_size (0 );
905
- \n
906
- \n /* accumulate in global memory */
907
- \n for ( uint pc = get_global_id (0 ); pc < numPixels ; pc += get_global_size (0 ) ) {
908
- \n uchar value = data [ pc ];
909
- \n int idx = value * get_global_size (0 ) + get_global_id (0 );
910
- \n histBuffer [ idx ]++ ;
911
- \n
912
- \n }
913
- \n
914
- \n } // kernel_HistogramRectAllChannels_Grey
915
-
916
- )
917
-
918
856
// HistogramRect Kernel: Reduction
919
857
// only supports 4 channels
920
858
// each work group handles a single channel of a single histogram bin
@@ -1000,55 +938,6 @@ void kernel_HistogramRectOneChannelReduction(
1000
938
} // kernel_HistogramRectOneChannelReduction
1001
939
)
1002
940
1003
-
1004
- KERNEL (
1005
- // unused
1006
- // each work group (x256) handles a histogram bin
1007
- \n __attribute__((reqd_work_group_size (256 , 1 , 1 )))
1008
- \n __kernel
1009
- \n void kernel_HistogramRectAllChannelsReduction_Grey (
1010
- \n int n , // pixel redundancy that needs to be accumulated
1011
- \n __global uint * histBuffer ,
1012
- \n __global uint * histResult ) { // each wg accumulates 1 bin
1013
- \n
1014
- \n /* declare variables */
1015
- \n
1016
- \n // work indices
1017
- \n size_t groupId = get_group_id (0 );
1018
- \n size_t localId = get_local_id (0 ); // 0 -> 256-1
1019
- \n size_t globalId = get_global_id (0 ); // 0 -> 8*10*256-1=20480-1
1020
- \n uint numThreads = get_global_size (0 );
1021
- \n unsigned int hist = 0 ;
1022
- \n
1023
- \n /* accumulate in global memory */
1024
- \n for ( uint p = 0 ; p < n ; p += GROUP_SIZE ) {
1025
- \n hist += histBuffer [ (get_group_id (0 )* n + p )];
1026
- \n }
1027
- \n
1028
- \n /* reduction in local memory */
1029
- \n // populate local memory
1030
- \n __local unsigned int localHist [GROUP_SIZE ];
1031
-
1032
- \n localHist [localId ] = hist ;
1033
- \n barrier (CLK_LOCAL_MEM_FENCE );
1034
- \n
1035
- \n for (int stride = GROUP_SIZE /2 ; stride >= 1 ; stride /= 2 ) {
1036
- \n if (localId < stride ) {
1037
- \n hist = localHist [ (localId + stride )];
1038
- \n }
1039
- \n barrier (CLK_LOCAL_MEM_FENCE );
1040
- \n if (localId < stride ) {
1041
- \n localHist [ localId ] += hist ;
1042
- \n }
1043
- \n barrier (CLK_LOCAL_MEM_FENCE );
1044
- \n }
1045
- \n
1046
- \n if (localId == 0 )
1047
- \n histResult [get_group_id (0 )] = localHist [0 ];
1048
- \n
1049
- \n } // kernel_HistogramRectAllChannelsReduction_Grey
1050
- )
1051
-
1052
941
// ThresholdRectToPix Kernel
1053
942
// only supports 4 channels
1054
943
// imageData is input image (24-bits/pixel)
0 commit comments