stardis-solver

Solve coupled heat transfers
git clone git://git.meso-star.fr/stardis-solver.git
Log | Files | Refs | README | LICENSE

commit c36e88eecef2099aebc21223803eccc3dc770361
parent 8090854dea918a6929371dd7600a2b03e7366ec7
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Thu,  3 Mar 2022 16:37:43 +0100

Add the rng_state input variable to sdis_solve_camera

Diffstat:
Msrc/sdis.h | 2++
Msrc/sdis_solve_camera.c | 4++--
2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/sdis.h b/src/sdis.h @@ -612,6 +612,7 @@ struct sdis_solve_camera_args { size_t spp; /* #samples per pixel */ int register_paths; /* Combination of enum sdis_heat_path_flag */ + struct ssp_rng* rng_state; /* Initial RNG state. May be NULL */ enum ssp_rng_type rng_type; /* RNG type to use */ }; #define SDIS_SOLVE_CAMERA_ARGS_DEFAULT__ { \ @@ -621,6 +622,7 @@ struct sdis_solve_camera_args { {512,512}, /* Image resolution */ \ 256, /* #realisations per pixel */ \ SDIS_HEAT_PATH_NONE, \ + NULL, /* RNG state */ \ SSP_RNG_THREEFRY /* RNG type */ \ } static const struct sdis_solve_camera_args SDIS_SOLVE_CAMERA_ARGS_DEFAULT = diff --git a/src/sdis_solve_camera.c b/src/sdis_solve_camera.c @@ -68,7 +68,7 @@ check_solve_camera_args(const struct sdis_solve_camera_args* args) } /* Check RNG type */ - if(args->rng_type >= SSP_RNG_TYPES_COUNT__) { + if(!args->rng_state && args->rng_type >= SSP_RNG_TYPES_COUNT__) { return RES_BAD_ARG; } @@ -534,7 +534,7 @@ sdis_solve_camera /* Create the per thread RNGs */ res = create_per_thread_rng - (scn->dev, NULL, args->rng_type, &rng_proxy, &per_thread_rng); + (scn->dev, args->rng_state, args->rng_type, &rng_proxy, &per_thread_rng); if(res != RES_OK) goto error; /* Allocate the per process progress status */