aboutsummaryrefslogtreecommitdiff
path: root/src/diffraction-gpu.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2010-02-22 17:44:46 +0100
committerThomas White <taw@physics.org>2010-02-22 17:44:46 +0100
commitf92a84e3929ad775da64cab7ae1ca224b7d80358 (patch)
tree86659cc29312afbd27107dc2644ba72051f17b5e /src/diffraction-gpu.c
parent32f52f0821802aecb1d00dd1054acf25325b8599 (diff)
Don't try to calculate with a null GPU context
Diffstat (limited to 'src/diffraction-gpu.c')
-rw-r--r--src/diffraction-gpu.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/diffraction-gpu.c b/src/diffraction-gpu.c
index bd9f7baa..dc3bfcad 100644
--- a/src/diffraction-gpu.c
+++ b/src/diffraction-gpu.c
@@ -65,6 +65,11 @@ void get_diffraction_gpu(struct gpu_context *gctx, struct image *image,
const int sampling = SAMPLING;
cl_float bwstep;
+ if ( gctx == NULL ) {
+ ERROR("GPU setup failed.\n");
+ return;
+ }
+
cell_get_cartesian(image->molecule->cell, &ax, &ay, &az,
&bx, &by, &bz,
&cx, &cy, &cz);