aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreschnett <eschnett@4054007a-4839-4648-a056-eb81e030d849>2012-05-05 20:33:59 +0000
committereschnett <eschnett@4054007a-4839-4648-a056-eb81e030d849>2012-05-05 20:33:59 +0000
commitbf7b3abf06358fb2269a9504b802e0e9f2fd46ee (patch)
tree8283dc76f10b902796d6adc7a41efb3edb9df98d
parenta8df43d43b3a929dced4015331d460de7b30cf9a (diff)
Improve white space in device information output
git-svn-id: http://svn.cactuscode.org/projects/ExternalLibraries/OpenCL/trunk@9 4054007a-4839-4648-a056-eb81e030d849
-rw-r--r--src/device_info.c19
-rw-r--r--src/info.c2
2 files changed, 9 insertions, 12 deletions
diff --git a/src/device_info.c b/src/device_info.c
index ed87bee..d80accc 100644
--- a/src/device_info.c
+++ b/src/device_info.c
@@ -55,7 +55,7 @@ int output_device_info(cl_device_id device_id)
OpenCL_VWarn("Error: Failed to access device name!");
return EXIT_FAILURE;
}
- OpenCL_VInfo(" Device: %s", device_name);
+ OpenCL_VInfo(" Device: %s", device_name);
err = clGetDeviceInfo(device_id, CL_DEVICE_TYPE, sizeof(device_type), &device_type, NULL);
if (err != CL_SUCCESS)
@@ -63,14 +63,6 @@ int output_device_info(cl_device_id device_id)
OpenCL_VWarn("Error: Failed to access device type information!");
return EXIT_FAILURE;
}
- if(device_type == CL_DEVICE_TYPE_GPU)
- OpenCL_VInfo(" GPU from ");
-
- else if (device_type == CL_DEVICE_TYPE_CPU)
- OpenCL_VInfo(" CPU from ");
-
- else
- OpenCL_VInfo(" non CPU or GPU processor from ");
err = clGetDeviceInfo(device_id, CL_DEVICE_VENDOR, sizeof(vendor_name), &vendor_name, NULL);
if (err != CL_SUCCESS)
@@ -78,7 +70,12 @@ int output_device_info(cl_device_id device_id)
OpenCL_VWarn("Error: Failed to access device vendor name!");
return EXIT_FAILURE;
}
- OpenCL_VInfo(" %s", vendor_name);
+ if(device_type == CL_DEVICE_TYPE_GPU)
+ OpenCL_VInfo(" GPU from %s", vendor_name);
+ else if (device_type == CL_DEVICE_TYPE_CPU)
+ OpenCL_VInfo(" CPU from %s", vendor_name);
+ else
+ OpenCL_VInfo(" non CPU or GPU processor from %s", vendor_name);
err = clGetDeviceInfo(device_id, CL_DEVICE_MAX_COMPUTE_UNITS, sizeof(cl_uint), &comp_units, NULL);
if (err != CL_SUCCESS)
@@ -86,7 +83,7 @@ int output_device_info(cl_device_id device_id)
OpenCL_VWarn("Error: Failed to access device number of compute units !");
return EXIT_FAILURE;
}
- OpenCL_VInfo(" with a max of %d compute units",comp_units);
+ OpenCL_VInfo(" with a max of %d compute units",comp_units);
#ifdef VERBOSE
//
diff --git a/src/info.c b/src/info.c
index db98192..1eac988 100644
--- a/src/info.c
+++ b/src/info.c
@@ -58,7 +58,7 @@ void OpenCL_PrintInfo(CCTK_ARGUMENTS)
OpenCL_VWarn("Error: Failed to access platform name!");
return;
}
- OpenCL_VInfo("Platform %d is %s ", i+1, platform_name);
+ OpenCL_VInfo("Platform %d is %s", i+1, platform_name);
err = clGetPlatformInfo(*(platformId+i), CL_PLATFORM_VENDOR, sizeof(vendor_name), &vendor_name, NULL);
if (err != CL_SUCCESS)