aboutsummaryrefslogtreecommitdiff
path: root/src/diffraction-gpu.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2011-03-07 16:52:16 +0100
committerThomas White <taw@physics.org>2012-02-22 15:27:18 +0100
commit5f6b1c8e1443a41e0db9379b48d44b19bd24196c (patch)
tree146d010211cc65cad8d295cca1024bb4e118fc5c /src/diffraction-gpu.c
parent3397bab94d8c495ffdaf74ff7de6a47f5a32df1a (diff)
Add tests/gpu_sim_check
Diffstat (limited to 'src/diffraction-gpu.c')
-rw-r--r--src/diffraction-gpu.c35
1 files changed, 22 insertions, 13 deletions
diff --git a/src/diffraction-gpu.c b/src/diffraction-gpu.c
index 59f19809..74eca439 100644
--- a/src/diffraction-gpu.c
+++ b/src/diffraction-gpu.c
@@ -416,20 +416,29 @@ struct gpu_context *setup_gpu(int no_sfac,
}
free(intensities_ptr);
- if ( strcmp(sym, "1") == 0 ) {
- strncat(cflags, "-DPG1 ", 511-strlen(cflags));
- } else if ( strcmp(sym, "-1") == 0 ) {
- strncat(cflags, "-DPG1BAR ", 511-strlen(cflags));
- } else if ( strcmp(sym, "6/mmm") == 0 ) {
- strncat(cflags, "-DPG6MMM ", 511-strlen(cflags));
- } else if ( strcmp(sym, "6") == 0 ) {
- strncat(cflags, "-DPG6 ", 511-strlen(cflags));
- } else if ( strcmp(sym, "6/m") == 0 ) {
- strncat(cflags, "-DPG6M ", 511-strlen(cflags));
+ if ( sym != NULL ) {
+ if ( strcmp(sym, "1") == 0 ) {
+ strncat(cflags, "-DPG1 ", 511-strlen(cflags));
+ } else if ( strcmp(sym, "-1") == 0 ) {
+ strncat(cflags, "-DPG1BAR ", 511-strlen(cflags));
+ } else if ( strcmp(sym, "6/mmm") == 0 ) {
+ strncat(cflags, "-DPG6MMM ", 511-strlen(cflags));
+ } else if ( strcmp(sym, "6") == 0 ) {
+ strncat(cflags, "-DPG6 ", 511-strlen(cflags));
+ } else if ( strcmp(sym, "6/m") == 0 ) {
+ strncat(cflags, "-DPG6M ", 511-strlen(cflags));
+ } else {
+ ERROR("Sorry! Point group '%s' is not currently"
+ " supported on the GPU."
+ " I'm using '1' instead.\n", sym);
+ strncat(cflags, "-DPG1 ", 511-strlen(cflags));
+ }
} else {
- ERROR("Sorry! Point group '%s' is not currently supported"
- " on the GPU. I'm using '1' instead.\n", sym);
- strncat(cflags, "-DPG1 ", 511-strlen(cflags));
+ if ( intensities != NULL ) {
+ ERROR("You gave me an intensities file but no point"
+ " group. I'm assuming '1'.\n");
+ strncat(cflags, "-DPG1 ", 511-strlen(cflags));
+ }
}
/* Create a flag array */