aboutsummaryrefslogtreecommitdiff
path: root/src/diffraction-gpu.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/diffraction-gpu.c
parent322bcc8d927078b1d672faf94c507c44f8104b1a (diff)
Handle multiple GPUs
Diffstat (limited to 'src/diffraction-gpu.c')
-rw-r--r--src/diffraction-gpu.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/diffraction-gpu.c b/src/diffraction-gpu.c
index c210cab9..324cc4cd 100644
--- a/src/diffraction-gpu.c
+++ b/src/diffraction-gpu.c
@@ -330,7 +330,7 @@ void get_diffraction_gpu(struct gpu_context *gctx, struct image *image,
/* Setup the OpenCL stuff, create buffers, load the structure factor table */
struct gpu_context *setup_gpu(int no_sfac, struct image *image,
- const double *intensities)
+ const double *intensities, int dev_num)
{
struct gpu_context *gctx;
cl_uint nplat;
@@ -343,7 +343,7 @@ struct gpu_context *setup_gpu(int no_sfac, struct image *image,
size_t maxwgsize;
int i;
- STATUS("Setting up GPU..."); fflush(stderr);
+ STATUS("Setting up GPU...\n");
err = clGetPlatformIDs(8, platforms, &nplat);
if ( err != CL_SUCCESS ) {
@@ -367,7 +367,7 @@ struct gpu_context *setup_gpu(int no_sfac, struct image *image,
return NULL;
}
- dev = get_first_dev(gctx->ctx);
+ dev = get_cl_dev(gctx->ctx, dev_num);
gctx->cq = clCreateCommandQueue(gctx->ctx, dev, 0, &err);
if ( err != CL_SUCCESS ) {
@@ -431,8 +431,6 @@ struct gpu_context *setup_gpu(int no_sfac, struct image *image,
return NULL;
}
- STATUS("done\n");
-
gctx->max_sinc_lut = 0;
gctx->sinc_lut_ptrs = NULL;
gctx->sinc_luts = NULL;