From: Andrew Jeffery Date: Fri, 13 Nov 2015 12:25:19 +0000 (+1030) Subject: strgrp: Fix indexing of per-thread storage for cosine filter X-Git-Url: https://git.ozlabs.org/?p=ccan;a=commitdiff_plain;h=3a6631812fbb49d11d72b8029898d93fc43c9aaa strgrp: Fix indexing of per-thread storage for cosine filter --- diff --git a/ccan/strgrp/strgrp.c b/ccan/strgrp/strgrp.c index ba870632..52d6957b 100644 --- a/ccan/strgrp/strgrp.c +++ b/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 *