aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2010-02-24 18:43:22 +0100
committerThomas White <taw@physics.org>2010-02-24 18:43:22 +0100
commitb8872a44c8a6dc60d98d992dca992573a28d059b (patch)
treee1acc45325df145e734662d429870ed8183f44e7
parent70caa3bf32cf3c04c32442f7127d6c7df0c10c39 (diff)
Report maximum work group size and if it has been exceeded
-rw-r--r--src/cl-utils.c1
-rw-r--r--src/diffraction-gpu.c5
2 files changed, 6 insertions, 0 deletions
diff --git a/src/cl-utils.c b/src/cl-utils.c
index be3e3551..de65db31 100644
--- a/src/cl-utils.c
+++ b/src/cl-utils.c
@@ -39,6 +39,7 @@ const char *clError(cl_int err)
case CL_OUT_OF_RESOURCES : return "out of resources";
case CL_INVALID_KERNEL_NAME : return "invalid kernel name";
case CL_INVALID_KERNEL_ARGS : return "invalid kernel arguments";
+ case CL_INVALID_WORK_GROUP_SIZE : return "invalid work group size";
default :
ERROR("Error code: %i\n", err);
return "unknown error";
diff --git a/src/diffraction-gpu.c b/src/diffraction-gpu.c
index b1f0860a..33410701 100644
--- a/src/diffraction-gpu.c
+++ b/src/diffraction-gpu.c
@@ -266,6 +266,7 @@ struct gpu_context *setup_gpu(int no_sfac, struct image *image,
cl_device_id dev;
size_t sfac_size;
float *sfac_ptr;
+ size_t maxwgsize;
if ( molecule == NULL ) return NULL;
@@ -371,6 +372,10 @@ struct gpu_context *setup_gpu(int no_sfac, struct image *image,
STATUS("done\n");
+ clGetDeviceInfo(dev, CL_DEVICE_MAX_WORK_GROUP_SIZE,
+ sizeof(size_t), &maxwgsize, NULL);
+ STATUS("Maximum work group size = %lli\n", (long long int)maxwgsize);
+
return gctx;
}