/tomo/pyhst

To get this branch, use:
bzr branch http://darksoft.org/webbzr/tomo/pyhst

« back to all changes in this revision

Viewing changes to hst_opencl/alu.cl

  • Committer: Suren A. Chilingaryan
  • Date: 2017-12-20 15:28:19 UTC
  • Revision ID: csa@suren.me-20171220152819-byiryz4mmovcg8u2
New remmaping, small adjustment of configuration

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 // For use with AMD CodeXL
 
3
#define SLICE_BLOCK 1
 
4
#define PPT 4
 
5
#define BP_BLOCK 16
 
6
#define GPU 
 
7
#define GPU_AMD 
 
8
#define GPU_VLIW5 
 
9
#define REMAP 
 
10
#define BLOCK_SIZE 16 
 
11
#define BP_BLOCK 16 
 
12
#define ASSYMETRY 1
 
13
//#define OVERSAMPLE 4 
 
14
#define MAXNPROJECTIONS 4096 
 
15
*/
 
16
 
 
17
 
1
18
#define HST_LINEAR_PPT PPT
2
19
#define HST_OVERS_PPT PPT
3
20
#define HST_NN_PPT PPT
30
47
#  define PROJ_BLOCK 16
31
48
#elif defined(GPU_VLIW5)
32
49
# if SLICE_BLOCK > 2
33
 
#  define PROJ_BLOCK 8
 
50
#  if OVERSAMPLE > 1
 
51
#   define PROJ_BLOCK 4
 
52
#  else
 
53
#   define PROJ_BLOCK 8
 
54
#  endif
34
55
# elif (SLICE_BLOCK > 1)&&(OVERSAMPLE > 1)
35
56
#  define PROJ_BLOCK 4
36
57
# else 
37
 
#  define PROJ_BLOCK 16
 
58
#  define PROJ_BLOCK 8//16
38
59
# endif
39
60
#else
40
61
# if SLICE_BLOCK > 2
46
67
# elif (OVERSAMPLE > 1)||((SLICE_BLOCK > 1)&&(OVERSAMPLE == 1))
47
68
#  define PROJ_BLOCK 8
48
69
# else
49
 
#  define PROJ_BLOCK 16
 
70
#  define PROJ_BLOCK 8//16
50
71
# endif
51
72
#endif
52
73
 
53
 
//#undef PROJ_BLOCK
54
 
//#define PROJ_BLOCK 16
55
74
 
56
75
 
57
76
 
92
111
#define HST_XCACHE_LD128 2                      //!< Store SUBH_X cache as groups of float2/float4 numbers to reduce number of memory instructions
93
112
//#define HST_SQUARE_PPT                                //!< NO. Little effect on performance (slighly reduces register usage, but doesn't affect computations as the loops are unrolled anyway)
94
113
 
 
114
//#undef PROJ_BLOCK
 
115
//#define PROJ_BLOCK 8
 
116
 
 
117
 
95
118
#define HST_NEWCACHE                            //!< YES! New way of caching reducing number of shmem reads/writes
96
 
//# define HST_WARPLINE                         //!< Seems better without on Fermi
97
 
#if defined(GPU_GCN)&&((OVERSAMPLE > 1)||(SLICE_BLOCK > 1))
98
 
# define HST_SHMEM64                            //!< Optimize caching in shared memory (avoid bank conflicts) in case of oversampling
99
 
#endif
 
119
#define HST_WARPLINE                            //!< Seems better without on Fermi
 
120
#define HST_SHMEM64                             //!< Optimize caching in shared memory (avoid bank conflicts) in case of oversampling
 
121
//#if defined(GPU_GCN)&&((OVERSAMPLE > 1)||(SLICE_BLOCK > 1))
 
122
//# define HST_SHMEM64                          //!< Optimize caching in shared memory (avoid bank conflicts) in case of oversampling
 
123
//#endif
100
124
 
101
125
 
102
126
//#define HST_NEWCACHE_UNPAD                    //!< Add if and remove padding in the shmem cache (low efficiency)
338
362
# define SHMEM_LOADS (3 * SHMEM_SAMPLING * (PPT / 2))
339
363
 
340
364
# if defined(HST_WARPLINE)&&!defined(HST_HALF_MODE)&&((SHMEM_SAMPLING * PPT) >= 4)/*&&(PROJ_BLOCK <= 8)*/
341
 
#  if defined(HST_SHMEM64)&&((SHMEM_SAMPLING * PPT) >= 8)&&(SLICE_BLOCK == 1)&&defined(SIMPLE_SHMEM)
 
365
#  if defined(HST_SHMEM64)&&((SHMEM_SAMPLING * PPT) >= 4)&&(SLICE_BLOCK == 1)&&defined(SIMPLE_SHMEM)
342
366
#    define SHMEM_LOAD2                                         /* Combine two texture fetches to 1 64-bit shmem store */
343
367
#    define SHMEM_LOAD_FULLWARP ((SHMEM_SAMPLING * PPT) / 4)    /* Counts number of rows we can load simultaneously */
344
368
#    define SHMEM_LOAD_ITERATIONS (SHMEM_LOADS  / SHMEM_LOAD_FULLWARP / 2)  /* Use 32-threads (or more) for loading data, this limits projections to 8 */
1007
1031
//              const int pidx = CACHE_IDX(p);
1008
1032
//              const float subh = cache_subh[pidx/4][sidx][pidx%4];
1009
1033
//              float subh = cache_subh[CACHE_IDX(pblock * P_BLOCK + p)];
1010
 
                const float *subh = (float*)&cache_subhx[CACHE_IDX(p)][sidx];
 
1034
                __local const float *subh = (__local float*)(&cache_subhx[CACHE_IDX(p)][sidx]);
1011
1035
#  else
1012
1036
                float subh = cache_subh[CACHE_IDX(p)];
1013
1037
#  endif // ! CACHE_SUBH_X