@@ -1152,14 +1152,6 @@ static int cl_property(gpucontext *c, gpudata *buf, gpukernel *k, int prop_id,
11521152 size_t * psz ;
11531153 cl_device_id id ;
11541154 cl_uint ui ;
1155- /* For GA_CTX_PROP_PCIBUSID (currently desactivated).
1156- * According to http://www.makelinux.net/ldd3/chp-12-sect-1
1157- * (accessed on 2016/11/09:15h41 EST):
1158- * domain: 16 bits, bus: 8 bits, device: 5 bits, function: 3 bits. */
1159- /*
1160- uint32_t* busid;
1161- uint32_t domain = 0, bus = 0, device = 0, function = 0;
1162- */
11631155
11641156 case GA_CTX_PROP_DEVNAME :
11651157 ctx -> err = clGetContextInfo (ctx -> ctx , CL_CONTEXT_DEVICES , sizeof (id ),
@@ -1181,42 +1173,7 @@ static int cl_property(gpucontext *c, gpudata *buf, gpukernel *k, int prop_id,
11811173 return GA_NO_ERROR ;
11821174
11831175 case GA_CTX_PROP_PCIBUSID :
1184- /* PS: Currently desactivated. This does not print the same
1185- * Bus ID as cuda and nvidia-smi. For the moment, I don't find
1186- * which info will display the correct PCI Bus ID with OpenCL. */
1187- /*
1188- ctx->err = clGetContextInfo(ctx->ctx, CL_CONTEXT_DEVICES, sizeof(id),
1189- &id, NULL);
1190- if (ctx->err != CL_SUCCESS)
1191- return GA_IMPL_ERROR;
1192- ctx->err = clGetDeviceInfo(id, CL_DEVICE_VENDOR_ID, 0, NULL, &sz);
1193- if (ctx->err != CL_SUCCESS)
1194- return GA_IMPL_ERROR;
1195- if(sz != 4)
1196- return GA_IMPL_ERROR;
1197- busid = malloc(sz);
1198- if (busid == NULL)
1199- return GA_MEMORY_ERROR;
1200- ctx->err = clGetDeviceInfo(id, CL_DEVICE_VENDOR_ID, sz, busid, NULL);
1201- if (ctx->err != CL_SUCCESS) {
1202- free(busid);
1203- return GA_IMPL_ERROR;
1204- }
1205- domain = *busid >> (32-16);
1206- bus = *busid << 16 >> (32-8);
1207- device = *busid << 24 >> (32-5);
1208- function = *busid << 29 >> (32-3);
1209- free(busid);
1210- s = malloc(13);
1211- sprintf(s, "%04x", domain);
1212- sprintf(s + 5, "%02x", bus);
1213- sprintf(s + 8, "%02x", device);
1214- sprintf(s + 11, "%01x", function);
1215- s[4] = s[7] = ':';
1216- s[10] = '.';
1217- *((char **)res) = s;
1218- return GA_NO_ERROR;
1219- */
1176+ /* For the moment, PCI Bus ID is not supported for OpenCL. */
12201177 * ((void * * )res ) = NULL ;
12211178 return GA_DEVSUP_ERROR ;
12221179
0 commit comments