@@ -69,14 +69,14 @@ namespace SUCMP_NM {
69
69
#ifdef _OPENACC
70
70
const uint64_t bufels = n_samples_r * (stop_idx-start_idx);
71
71
#endif
72
- for (unsigned int stripe=start_idx; stripe < stop_idx; stripe++) {
72
+ for (uint64_t stripe=start_idx; stripe < stop_idx; stripe++) {
73
73
double * dm_stripe = dm_stripes[stripe];
74
- TFloat * buf_stripe = this -> operator [] (stripe);
75
- for (unsigned int j=0 ; j<n_samples; j++) {
74
+ TFloat * buf_stripe = ibuf+ buf_idx (stripe);
75
+ for (uint64_t j=0 ; j<n_samples; j++) {
76
76
// Note: We could probably just initialize to zero
77
77
buf_stripe[j] = dm_stripe[j];
78
78
}
79
- for (unsigned int j=n_samples; j<n_samples_r; j++) {
79
+ for (uint64_t j=n_samples; j<n_samples_r; j++) {
80
80
// Avoid NaNs
81
81
buf_stripe[j] = 0.0 ;
82
82
}
@@ -90,8 +90,8 @@ namespace SUCMP_NM {
90
90
UnifracTaskVector<TFloat>(const UnifracTaskVector<TFloat>& ) = delete ;
91
91
UnifracTaskVector<TFloat>& operator = (const UnifracTaskVector<TFloat>&) = delete ;
92
92
93
- TFloat * operator [](unsigned int idx) { return buf+(( idx-start_idx)*n_samples_r );}
94
- const TFloat * operator [](unsigned int idx) const { return buf+(( idx-start_idx)*n_samples_r );}
93
+ TFloat * operator [](unsigned int idx) { return buf+buf_idx ( idx);}
94
+ const TFloat * operator [](unsigned int idx) const { return buf+buf_idx ( idx);}
95
95
96
96
97
97
~UnifracTaskVector ()
@@ -102,10 +102,10 @@ namespace SUCMP_NM {
102
102
const uint64_t bufels = n_samples_r * (stop_idx-start_idx);
103
103
#pragma acc exit data copyout(ibuf[:bufels])
104
104
#endif
105
- for (unsigned int stripe=start_idx; stripe < stop_idx; stripe++) {
105
+ for (uint64_t stripe=start_idx; stripe < stop_idx; stripe++) {
106
106
double * dm_stripe = dm_stripes[stripe];
107
- TFloat * buf_stripe = this -> operator [] (stripe);
108
- for (unsigned int j=0 ; j<n_samples; j++) {
107
+ TFloat * buf_stripe = ibuf+ buf_idx (stripe);
108
+ for (uint64_t j=0 ; j<n_samples; j++) {
109
109
dm_stripe[j] = buf_stripe[j];
110
110
}
111
111
}
@@ -116,6 +116,8 @@ namespace SUCMP_NM {
116
116
private:
117
117
UnifracTaskVector () = delete ;
118
118
UnifracTaskVector operator =(const UnifracTaskVector&other) const = delete ;
119
+
120
+ uint64_t buf_idx (uint64_t idx) const { return ((idx-start_idx)*n_samples_r);}
119
121
};
120
122
121
123
// Base task class to be shared by all tasks
0 commit comments