Changeset: d636a41be4aa for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=d636a41be4aa
Modified Files:
        monetdb5/extras/bwd/91_bwd.sql
        monetdb5/extras/bwd/bwd.c
        monetdb5/extras/bwd/opt_bwd.mal
Branch: bwd
Log Message:

* okay, turns out builtin-kernels are only supported from opencl version 1.2, 
so there is no real point in displaying them, showing the platform version 
instead


Unterschiede (78 Zeilen):

diff --git a/monetdb5/extras/bwd/91_bwd.sql b/monetdb5/extras/bwd/91_bwd.sql
--- a/monetdb5/extras/bwd/91_bwd.sql
+++ b/monetdb5/extras/bwd/91_bwd.sql
@@ -3,4 +3,4 @@ returns integer external name bwd.decomp
 
 
 create function bwdevices()
-returns table(platform int, device int, description string, builtins string) 
external name bwd.deviceInfo;
+returns table(platform int, device int, deviceDescription string, 
platformDescription string) external name bwd.deviceInfo;
diff --git a/monetdb5/extras/bwd/bwd.c b/monetdb5/extras/bwd/bwd.c
--- a/monetdb5/extras/bwd/bwd.c
+++ b/monetdb5/extras/bwd/bwd.c
@@ -33,15 +33,15 @@ char* clDeviceString(cl_device_type devi
   return "unkown";
 }
 
-str deviceInfo(bat * resPlatform, bat * resDevice, bat * resDesc, bat * 
resKernels){
+str deviceInfo(bat * resPlatform, bat * resDevice, bat * resDesc, bat * 
resPlatformDescription){
        BAT* resultPlatform = BATnew(TYPE_void, TYPE_int, 2);
        BAT* resultDevice = BATnew(TYPE_void, TYPE_int, 2);
        BAT* resultDesc = BATnew(TYPE_void, TYPE_str, 2);
-       BAT* resultKernels = BATnew(TYPE_void, TYPE_str, 2);
+       BAT* resultPlatformDescription = BATnew(TYPE_void, TYPE_str, 2);
        BATseqbase(resultPlatform, 0);
        BATseqbase(resultDevice, 0);
        BATseqbase(resultDesc, 0);
-       BATseqbase(resultKernels, 0);
+       BATseqbase(resultPlatformDescription, 0);
        {
                cl_uint numPlatforms;
                int err;
@@ -66,19 +66,18 @@ str deviceInfo(bat * resPlatform, bat * 
                                        if((err = 
clGetDeviceInfo(devices[j],CL_DEVICE_NAME,sizeof(deviceName),&deviceName,NULL)))
 die ("clGetDeviceInfo error: %s\n",clError(err));
                                        snprintf (deviceNameBuffer, 1024, "%d: 
%s (%s)\n", j, deviceName, clDeviceString(device_type));
                                }
-                               char* kernelListBuffer;
+                               char* platformVersionBuffer;
                                {
-                                       size_t kernelListBufferSize;
-                                       
clGetDeviceInfo(devices[j],CL_DEVICE_BUILT_IN_KERNELS, 0, NULL, 
&kernelListBufferSize);
-                                       kernelListBuffer = 
alloca(kernelListBufferSize);
-
-                                       
clGetDeviceInfo(devices[j],CL_DEVICE_BUILT_IN_KERNELS, kernelListBufferSize, 
kernelListBuffer, NULL);
+                                       size_t platformVersionBufferSize;
+                                       clGetPlatformInfo(platforms[i], 
CL_PLATFORM_VERSION, 0, NULL, &platformVersionBufferSize);
+                                       platformVersionBuffer = 
alloca(platformVersionBufferSize);
+                                       clGetPlatformInfo(platforms[i], 
CL_PLATFORM_VERSION, platformVersionBufferSize, platformVersionBuffer, NULL);
                                }
 
                                BUNappend(resultPlatform, &i, FALSE);
                                BUNappend(resultDevice, &j, FALSE);
                                BUNappend(resultDesc, deviceNameBuffer, 0);
-                               BUNappend(resultKernels, kernelListBuffer, 0);
+                               BUNappend(resultPlatformDescription, 
platformVersionBuffer, 0);
                        }
                }
 
@@ -86,7 +85,7 @@ str deviceInfo(bat * resPlatform, bat * 
        BBPkeepref((*resPlatform = resultPlatform->batCacheid));
        BBPkeepref((*resDevice = resultDevice->batCacheid));
        BBPkeepref((*resDesc = resultDesc->batCacheid));
-       BBPkeepref((*resKernels = resultKernels->batCacheid));
+       BBPkeepref((*resPlatformDescription = 
resultPlatformDescription->batCacheid));
        return MAL_SUCCEED;
 }
 
diff --git a/monetdb5/extras/bwd/opt_bwd.mal b/monetdb5/extras/bwd/opt_bwd.mal
--- a/monetdb5/extras/bwd/opt_bwd.mal
+++ b/monetdb5/extras/bwd/opt_bwd.mal
@@ -25,7 +25,7 @@ address BWDThetauselectRefine
 comment "The refinement of an approximation of a theta (<=,<,=,>,>=) select() 
limited to head values";
 
 
-command deviceinfo()(platformID:bat[:oid,:int], 
deviceID:bat[:oid,:int],description:bat[:oid,:str], 
builtinKernels:bat[:oid,:str])
+command deviceinfo()(platformID:bat[:oid,:int], 
deviceID:bat[:oid,:int],description:bat[:oid,:str], 
platformDescription:bat[:oid,:str])
 address deviceInfo;
 
 
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to