return e.get();
}
+CLOVER_API cl_int
+clCreateSubDevices(cl_device_id d_dev,
+ const cl_device_partition_property *props,
+ cl_uint num_devs, cl_device_id *rd_devs,
+ cl_uint *rnum_devs) {
+ // There are no currently supported partitioning schemes.
+ return CL_INVALID_VALUE;
+}
+
+CLOVER_API cl_int
+clRetainDevice(cl_device_id d_dev) try {
+ obj(d_dev);
+
+ // The reference count doesn't change for root devices.
+ return CL_SUCCESS;
+
+} catch (error &e) {
+ return e.get();
+}
+
+CLOVER_API cl_int
+clReleaseDevice(cl_device_id d_dev) try {
+ obj(d_dev);
+
+ // The reference count doesn't change for root devices.
+ return CL_SUCCESS;
+
+} catch (error &e) {
+ return e.get();
+}
+
CLOVER_API cl_int
clGetDeviceInfo(cl_device_id d_dev, cl_device_info param,
size_t size, void *r_buf, size_t *r_size) try {
buf.as_string() = "OpenCL C 1.1";
break;
+ case CL_DEVICE_PARENT_DEVICE:
+ buf.as_scalar<cl_device_id>() = NULL;
+ break;
+
+ case CL_DEVICE_PARTITION_MAX_SUB_DEVICES:
+ buf.as_scalar<cl_uint>() = 0;
+ break;
+
+ case CL_DEVICE_PARTITION_PROPERTIES:
+ buf.as_vector<cl_device_partition_property>() =
+ desc(property_list<cl_device_partition_property>());
+ break;
+
+ case CL_DEVICE_PARTITION_AFFINITY_DOMAIN:
+ buf.as_scalar<cl_device_affinity_domain>() = 0;
+ break;
+
+ case CL_DEVICE_PARTITION_TYPE:
+ buf.as_vector<cl_device_partition_property>() =
+ desc(property_list<cl_device_partition_property>());
+ break;
+
+ case CL_DEVICE_REFERENCE_COUNT:
+ buf.as_scalar<cl_uint>() = 1;
+ break;
+
default:
throw error(CL_INVALID_VALUE);
}
NULL, // clRetainDeviceEXT
NULL, // clReleaseDeviceEXT
NULL, // clCreateEventFromGLsyncKHR
- NULL, // clCreateSubDevices
- NULL, // clRetainDevice
- NULL, // clReleaseDevice
+ clCreateSubDevices,
+ clRetainDevice,
+ clReleaseDevice,
NULL, // clCreateImage
NULL, // clCreateProgramWithBuiltInKernels
NULL, // clCompileProgram
cl_GLsync sync,
cl_int *errcode_ret);
- void *clCreateSubDevices;
+ CL_API_ENTRY cl_int (CL_API_CALL *clCreateSubDevices)(
+ cl_device_id in_device,
+ const cl_device_partition_property *partition_properties,
+ cl_uint num_entries,
+ cl_device_id *out_devices,
+ cl_uint *num_devices);
CL_API_ENTRY cl_int (CL_API_CALL *clRetainDevice)(
cl_device_id device);