]> git.ozlabs.org Git - ccan/commitdiff
strgrp: Fix indexing of per-thread storage for cosine filter
authorAndrew Jeffery <andrew@aj.id.au>
Fri, 13 Nov 2015 12:25:19 +0000 (22:55 +1030)
committerAndrew Jeffery <andrew@aj.id.au>
Fri, 13 Nov 2015 12:25:19 +0000 (22:55 +1030)
ccan/strgrp/strgrp.c

index ba87063206c9d76d7f51eb106111b101f3c19a2c..52d6957b30d04046b1298d135214faaf8fe1882d 100644 (file)
@@ -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 *