aboutsummaryrefslogtreecommitdiff
path: root/tests/gpu_sim_check.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2019-05-17 17:03:48 +0200
committerThomas White <taw@physics.org>2019-05-29 10:42:04 +0200
commit94b0050cc7735c3e1635cbc89c13c6b2c49c69c8 (patch)
tree009039e182541db4544683632c9153ff46fa27ef /tests/gpu_sim_check.c
parent36e3370feddeb8dd18f97dc5db4da8e96c9f5c79 (diff)
Use Spectrum API for simulation
Diffstat (limited to 'tests/gpu_sim_check.c')
-rw-r--r--tests/gpu_sim_check.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/tests/gpu_sim_check.c b/tests/gpu_sim_check.c
index f1d7866f..c9508a7c 100644
--- a/tests/gpu_sim_check.c
+++ b/tests/gpu_sim_check.c
@@ -163,21 +163,19 @@ int main(int argc, char *argv[])
gpu_image.det = det;
cpu_image.beam = NULL;
gpu_image.beam = NULL;
- cpu_image.spectrum0 = NULL;
- gpu_image.spectrum0 = NULL;
cpu_image.lambda = ph_en_to_lambda(eV_to_J(6000));
gpu_image.lambda = ph_en_to_lambda(eV_to_J(6000));
cpu_image.bw = 1.0 / 100.0;
gpu_image.bw = 1.0 / 100.0;
- cpu_image.nsamples = 10;
- gpu_image.nsamples = 10;
- cpu_image.spectrum0 = generate_tophat(&cpu_image);
- gpu_image.spectrum0 = generate_tophat(&gpu_image);
+ cpu_image.spectrum = spectrum_generate_tophat(cpu_image.lambda,
+ cpu_image.bw);
+ gpu_image.spectrum = spectrum_generate_tophat(gpu_image.lambda,
+ gpu_image.bw);
start = get_hires_seconds();
- if ( get_diffraction_gpu(gctx, &gpu_image, 8, 8, 8, cell, 0, 0) ) {
+ if ( get_diffraction_gpu(gctx, &gpu_image, 8, 8, 8, cell, 0, 0, 10) ) {
return 1;
}
end = get_hires_seconds();
@@ -201,7 +199,7 @@ int main(int argc, char *argv[])
start = get_hires_seconds();
get_diffraction(&cpu_image, 8, 8, 8, NULL, NULL, NULL, cell,
- GRADIENT_MOSAIC, sym, 0, 0);
+ GRADIENT_MOSAIC, sym, 0, 0, 10);
end = get_hires_seconds();
cpu_time = end - start;