Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] Diff of /branches/pure-cfg/src/lib/cl-target/clinfo.c
ViewVC logotype

Diff of /branches/pure-cfg/src/lib/cl-target/clinfo.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1435, Tue Jul 5 23:59:08 2011 UTC revision 1436, Wed Jul 6 18:55:51 2011 UTC
# Line 81  Line 81 
81    
82  }  }
83    
84    static char *GetStringInfo (cl_device_id dev, cl_device_info param)
85    {
86        char                buf[1024];
87        CHECK(clGetDeviceInfo (dev, param, sizeof(buf), buf, 0));
88        return NEWSTR(buf);
89    }
90    
91  static bool GetDevices (PlatformInfo_t *plat)  static bool GetDevices (PlatformInfo_t *plat)
92  {  {
93      cl_uint             numDevs;      cl_uint             numDevs;
# Line 103  Line 110 
110    
111      for (int i = 0;  i < numDevs;  i++) {      for (int i = 0;  i < numDevs;  i++) {
112          DeviceInfo_t *dev = &(plat->devices[i]);          DeviceInfo_t *dev = &(plat->devices[i]);
113          CHECK(clGetDeviceInfo (          dev->name = GetStringInfo(devices[i], CL_DEVICE_NAME);
114              devices[i], CL_DEVICE_NAME, sizeof(buf), buf, 0));          dev->vendor = GetStringInfo(devices[i], CL_DEVICE_VENDOR);
         dev->name = NEWSTR(buf);  
115          dev->id = devices[i];          dev->id = devices[i];
116          CHECK(clGetDeviceInfo (          CHECK(clGetDeviceInfo (
117              devices[i], CL_DEVICE_VERSION, sizeof(buf), buf, 0));              devices[i], CL_DEVICE_VERSION, sizeof(buf), buf, 0));
# Line 161  Line 167 
167              dev->maxImg2D[0] = dev->maxImg2D[1] = 0;              dev->maxImg2D[0] = dev->maxImg2D[1] = 0;
168              dev->maxImg3D[0] = dev->maxImg3D[1] = dev->maxImg3D[2] = 0;              dev->maxImg3D[0] = dev->maxImg3D[1] = dev->maxImg3D[2] = 0;
169          }          }
170            CHECK(clGetDeviceInfo (
171                devices[i], CL_DEVICE_PREFERRED_VECTOR_WIDTH_CHAR, sizeof(cl_uint), &(dev->charWid), 0));
172            CHECK(clGetDeviceInfo (
173                devices[i], CL_DEVICE_PREFERRED_VECTOR_WIDTH_CHAR, sizeof(cl_uint), &(dev->shortWid), 0));
174            CHECK(clGetDeviceInfo (
175                devices[i], CL_DEVICE_PREFERRED_VECTOR_WIDTH_CHAR, sizeof(cl_uint), &(dev->intWid), 0));
176            CHECK(clGetDeviceInfo (
177                devices[i], CL_DEVICE_PREFERRED_VECTOR_WIDTH_CHAR, sizeof(cl_uint), &(dev->longWid), 0));
178            CHECK(clGetDeviceInfo (
179                devices[i], CL_DEVICE_PREFERRED_VECTOR_WIDTH_CHAR, sizeof(cl_uint), &(dev->floatWid), 0));
180            CHECK(clGetDeviceInfo (
181                devices[i], CL_DEVICE_PREFERRED_VECTOR_WIDTH_CHAR, sizeof(cl_uint), &(dev->doubleWid), 0));
182      }      }
183    
184      free(devices);      free(devices);
# Line 185  Line 203 
203                  fprintf (outS, "    Device %d.%d (%s):\n", i, j, dev->name);                  fprintf (outS, "    Device %d.%d (%s):\n", i, j, dev->name);
204              else              else
205                  fprintf (outS, "    Device %d.%d (%s): **UNAVAILABLE**\n", i, j, dev->name);                  fprintf (outS, "    Device %d.%d (%s): **UNAVAILABLE**\n", i, j, dev->name);
206                fprintf (outS, "      Vendor:                  %s\n", dev->vendor);
207              fprintf (outS, "      OpenCL version:          %d.%d\n",              fprintf (outS, "      OpenCL version:          %d.%d\n",
208                  dev->majorVersion, dev->minorVersion);                  dev->majorVersion, dev->minorVersion);
209              fprintf (outS, "      Type:                   ");              fprintf (outS, "      Type:                   ");
# Line 212  Line 231 
231                  (long)(dev->maxImg2D[0]), (long)(dev->maxImg2D[1]));                  (long)(dev->maxImg2D[0]), (long)(dev->maxImg2D[1]));
232              fprintf (outS, "      Max. 3D image size:      %ld x %ld x %ld\n",              fprintf (outS, "      Max. 3D image size:      %ld x %ld x %ld\n",
233                  (long)(dev->maxImg3D[0]), (long)(dev->maxImg3D[1]), (long)(dev->maxImg3D[2]));                  (long)(dev->maxImg3D[0]), (long)(dev->maxImg3D[1]), (long)(dev->maxImg3D[2]));
234                fprintf (outS, "      Prefered vector width:   char%d, short%d, int%d, long%d\n",
235                    dev->charWid, dev->shortWid, dev->intWid, dev->longWid);
236                fprintf (outS, "                               float%d", dev->floatWid);
237                if (dev->doubleWid > 0)
238                    fprintf (outS, ", double%d\n", dev->doubleWid);
239                else
240                    fprintf (outS, "\n");
241          }          }
242      }      }
243    

Legend:
Removed from v.1435  
changed lines
  Added in v.1436

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0