star-mc

Parallel estimation of Monte Carlo integrators
git clone git://git.meso-star.fr/star-mc.git
Log | Files | Refs | README | LICENSE

commit 3e7fc40be8c1e9ac27a305cc02abb97dffb579c4
parent dcca0f80d0ec28980e7dba56affea716bffe7db8
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Tue, 12 May 2015 17:03:05 +0200

Fix GCC warnings

Diffstat:
Msrc/smc_integrator.c | 16++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/smc_integrator.c b/src/smc_integrator.c @@ -148,7 +148,7 @@ smc_solve { struct smc_estimator* estimator = NULL; int64_t i; - int64_t nthreads = 0; + size_t nthreads = 0; char* raw = NULL; void** vals = NULL; void** accums = NULL; @@ -180,7 +180,7 @@ smc_solve } \ integrator->type->zero((Dst)); \ } (void)0 - FOR_EACH(i, 0, nthreads) { + FOR_EACH(i, 0, (int64_t)nthreads) { TYPE_CREATE(vals[i]); TYPE_CREATE(accums[i]); TYPE_CREATE(accums_sqr[i]); @@ -204,7 +204,7 @@ smc_solve } /* Merge the parallel estimation into the final estimator */ - FOR_EACH(i, 0, nthreads) { + FOR_EACH(i, 0, (int64_t)nthreads) { estimator->nsamples += nsamples[i]; integrator->type->add(estimator->value, estimator->value, accums[i]); integrator->type->add @@ -213,7 +213,7 @@ smc_solve exit: if(raw) { /* Release temporary variables */ - FOR_EACH(i, 0, nthreads) { + FOR_EACH(i, 0, (int64_t)nthreads) { if(vals[i]) integrator->type->destroy(dev->allocator, vals[i]); if(accums[i]) integrator->type->destroy(dev->allocator, accums[i]); if(accums_sqr[i]) integrator->type->destroy(dev->allocator, accums_sqr[i]); @@ -241,7 +241,7 @@ smc_solve_N { res_T res = RES_OK; int64_t i; - int64_t nthreads = 0; + size_t nthreads = 0; void** vals = NULL; if(!estimators) { @@ -264,7 +264,7 @@ smc_solve_N /* Create the per thread temporary variables */ nthreads = device_get_threads_count(dev); vals = MEM_CALLOC(dev->allocator, nthreads, sizeof(void*)); - FOR_EACH(i, 0, nthreads) { + FOR_EACH(i, 0, (int64_t)nthreads) { vals[i] = integrator->type->create(dev->allocator); if(!vals[i]) { res = RES_MEM_ERR; @@ -279,7 +279,7 @@ smc_solve_N const int ithread = omp_get_thread_num(); FOR_EACH(istep, 0, integrator->max_steps) { integrator->integrand - (vals[ithread], dev->rngs[ithread], (char*)ctx + i*sizeof_ctx); + (vals[ithread], dev->rngs[ithread], (char*)ctx + (size_t)i*sizeof_ctx); integrator->type->add (estimators[i]->value, estimators[i]->value, vals[ithread]); integrator->type->mul(vals[ithread], vals[ithread], vals[ithread]); @@ -291,7 +291,7 @@ smc_solve_N exit: if(vals) { - FOR_EACH(i, 0, nthreads) { + FOR_EACH(i, 0, (int64_t)nthreads) { if(vals[i]) integrator->type->destroy(dev->allocator, vals[i]); } MEM_RM(dev->allocator, vals);