Browse Source

strgrp: Fix indexing of per-thread storage for cosine filter

Andrew Jeffery 10 years ago
parent
commit
3a6631812f
1 changed files with 2 additions and 2 deletions
  1. 2 2
      ccan/strgrp/strgrp.c

+ 2 - 2
ccan/strgrp/strgrp.c

@@ -283,12 +283,12 @@ cache(struct strgrp *const ctx, struct strgrp_grp *const grp,
 
 static inline struct cosvec *
 tl_avec(struct strgrp *ctx) {
-    return &ctx->cosvecs[omp_get_thread_num()];
+    return &ctx->cosvecs[2 * omp_get_thread_num()];
 }
 
 static inline struct cosvec *
 tl_bvec(struct strgrp *ctx) {
-    return &ctx->cosvecs[omp_get_thread_num() + 1];
+    return &ctx->cosvecs[2 * omp_get_thread_num() + 1];
 }
 
 static struct strgrp_grp *