summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2020-10-07 11:09:02 +1000
committerDave Airlie <airlied@redhat.com>2020-11-17 05:15:09 +1000
commitbd804c074fd90966a869d00961fce1a5a0d7defc (patch)
tree18b9578efdb732a7a957d33a31acb6330d8e0e08
parent39940ee8d6a18f4b19d98ca7ffcba137d8b33a62 (diff)
clover: add device/platform info for CL 3.0
This just adds all the dummy 2.x/3.0 device and platform info queries that return fixed not supported values. As these are supported they will have to be migrated into the core. Reviewed-by: Karol Herbst <kherbst@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7642>
-rw-r--r--src/gallium/frontends/clover/api/device.cpp66
-rw-r--r--src/gallium/frontends/clover/api/platform.cpp4
2 files changed, 70 insertions, 0 deletions
diff --git a/src/gallium/frontends/clover/api/device.cpp b/src/gallium/frontends/clover/api/device.cpp
index 9ed873d6186..d0b3b9e6d84 100644
--- a/src/gallium/frontends/clover/api/device.cpp
+++ b/src/gallium/frontends/clover/api/device.cpp
@@ -425,6 +425,72 @@ clGetDeviceInfo(cl_device_id d_dev, cl_device_info param,
buf.as_vector<cl_name_version>() = dev.opencl_c_features();
break;
+ case CL_DEVICE_IL_VERSION:
+ buf.as_string() = "";
+ break;
+
+ case CL_DEVICE_ILS_WITH_VERSION:
+ case CL_DEVICE_BUILT_IN_KERNELS_WITH_VERSION:
+ if (r_size)
+ *r_size = 0;
+ break;
+
+ case CL_DEVICE_MAX_READ_WRITE_IMAGE_ARGS:
+ case CL_DEVICE_IMAGE_PITCH_ALIGNMENT:
+ case CL_DEVICE_IMAGE_BASE_ADDRESS_ALIGNMENT:
+ case CL_DEVICE_PREFERRED_PLATFORM_ATOMIC_ALIGNMENT:
+ case CL_DEVICE_PREFERRED_GLOBAL_ATOMIC_ALIGNMENT:
+ case CL_DEVICE_PREFERRED_LOCAL_ATOMIC_ALIGNMENT:
+ case CL_DEVICE_MAX_NUM_SUB_GROUPS:
+ case CL_DEVICE_QUEUE_ON_DEVICE_PREFERRED_SIZE:
+ case CL_DEVICE_QUEUE_ON_DEVICE_MAX_SIZE:
+ case CL_DEVICE_MAX_ON_DEVICE_QUEUES:
+ case CL_DEVICE_MAX_ON_DEVICE_EVENTS:
+ case CL_DEVICE_MAX_PIPE_ARGS:
+ case CL_DEVICE_PIPE_MAX_ACTIVE_RESERVATIONS:
+ case CL_DEVICE_PIPE_MAX_PACKET_SIZE:
+ buf.as_scalar<cl_uint>() = 0;
+ break;
+
+ case CL_DEVICE_MAX_GLOBAL_VARIABLE_SIZE:
+ case CL_DEVICE_GLOBAL_VARIABLE_PREFERRED_TOTAL_SIZE:
+ buf.as_scalar<size_t>() = 0;
+ break;
+
+ case CL_DEVICE_SUB_GROUP_INDEPENDENT_FORWARD_PROGRESS:
+ case CL_DEVICE_NON_UNIFORM_WORK_GROUP_SUPPORT:
+ case CL_DEVICE_WORK_GROUP_COLLECTIVE_FUNCTIONS_SUPPORT:
+ case CL_DEVICE_GENERIC_ADDRESS_SPACE_SUPPORT:
+ case CL_DEVICE_PIPE_SUPPORT:
+ buf.as_scalar<cl_bool>() = CL_FALSE;
+ break;
+
+ case CL_DEVICE_QUEUE_ON_DEVICE_PROPERTIES:
+ buf.as_scalar<cl_command_queue_properties>() = 0;
+ break;
+
+ case CL_DEVICE_ATOMIC_MEMORY_CAPABILITIES:
+ buf.as_scalar<cl_device_atomic_capabilities>() = (CL_DEVICE_ATOMIC_ORDER_RELAXED |
+ CL_DEVICE_ATOMIC_SCOPE_WORK_GROUP);
+ break;
+ case CL_DEVICE_ATOMIC_FENCE_CAPABILITIES:
+ buf.as_scalar<cl_device_atomic_capabilities>() = (CL_DEVICE_ATOMIC_ORDER_RELAXED |
+ CL_DEVICE_ATOMIC_ORDER_ACQ_REL |
+ CL_DEVICE_ATOMIC_SCOPE_WORK_GROUP);
+ break;
+
+ case CL_DEVICE_DEVICE_ENQUEUE_CAPABILITIES:
+ buf.as_scalar<cl_device_device_enqueue_capabilities>() = 0;
+ break;
+
+ case CL_DEVICE_PREFERRED_WORK_GROUP_SIZE_MULTIPLE:
+ buf.as_scalar<size_t>() = 1;
+ break;
+
+ case CL_DEVICE_LATEST_CONFORMANCE_VERSION_PASSED:
+ buf.as_string() = "";
+ break;
+
default:
throw error(CL_INVALID_VALUE);
}
diff --git a/src/gallium/frontends/clover/api/platform.cpp b/src/gallium/frontends/clover/api/platform.cpp
index 24706e8eaa5..fdffa321aca 100644
--- a/src/gallium/frontends/clover/api/platform.cpp
+++ b/src/gallium/frontends/clover/api/platform.cpp
@@ -90,6 +90,10 @@ clover::GetPlatformInfo(cl_platform_id d_platform, cl_platform_info param,
buf.as_vector<cl_name_version>() = platform.supported_extensions();
break;
+ case CL_PLATFORM_HOST_TIMER_RESOLUTION:
+ buf.as_scalar<cl_ulong>() = 0;
+ break;
+
default:
throw error(CL_INVALID_VALUE);
}