aboutsummaryrefslogtreecommitdiff
path: root/src/pattern_sim.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2010-11-18 11:04:05 +0100
committerThomas White <taw@physics.org>2012-02-22 15:27:06 +0100
commitd6ae8065f7c422300dba3b6256f4ace53b39a092 (patch)
tree25ffd2c30e20d002c9b92c1910f60427471010d6 /src/pattern_sim.c
parent322bcc8d927078b1d672faf94c507c44f8104b1a (diff)
Handle multiple GPUs
Diffstat (limited to 'src/pattern_sim.c')
-rw-r--r--src/pattern_sim.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/pattern_sim.c b/src/pattern_sim.c
index 3c1afe07..3deaa742 100644
--- a/src/pattern_sim.c
+++ b/src/pattern_sim.c
@@ -203,6 +203,7 @@ int main(int argc, char *argv[])
int done = 0;
UnitCell *input_cell;
struct quaternion orientation;
+ int gpu_dev = -1;
/* Long options */
const struct option longopts[] = {
@@ -223,6 +224,7 @@ int main(int argc, char *argv[])
{"geometry", 1, NULL, 'g'},
{"beam", 1, NULL, 'b'},
{"really-random", 0, &config_random, 1},
+ {"gpu-dev", 1, NULL, 2},
{0, 0, NULL, 0}
};
@@ -271,6 +273,10 @@ int main(int argc, char *argv[])
beamfile = strdup(optarg);
break;
+ case 2 :
+ gpu_dev = atoi(optarg);
+ break;
+
case 0 :
break;
@@ -446,7 +452,7 @@ int main(int argc, char *argv[])
if ( config_gpu ) {
if ( gctx == NULL ) {
gctx = setup_gpu(config_nosfac, &image,
- intensities);
+ intensities, gpu_dev);
}
get_diffraction_gpu(gctx, &image, na, nb, nc, cell);
} else {