clover: Move platform extensions definitions to clover/platform.cpp
authorPierre Moreau <pierre.morrow@free.fr>
Thu, 18 Jan 2018 22:42:51 +0000 (23:42 +0100)
committerKarol Herbst <kherbst@redhat.com>
Tue, 26 Feb 2019 20:02:07 +0000 (21:02 +0100)
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Aaron Watry <awatry@gmail.com>
src/gallium/state_trackers/clover/api/platform.cpp
src/gallium/state_trackers/clover/core/platform.cpp
src/gallium/state_trackers/clover/core/platform.hpp

index fddbbecaa5927db6300a8851b81d67a63ffbc3e6..a684d34ba44211758e17d65d9e37f8a1e7990f72 100644 (file)
@@ -51,7 +51,7 @@ clover::GetPlatformInfo(cl_platform_id d_platform, cl_platform_info param,
                         size_t size, void *r_buf, size_t *r_size) try {
    property_buffer buf { r_buf, size, r_size };
 
-   obj(d_platform);
+   auto &platform = obj(d_platform);
 
    switch (param) {
    case CL_PLATFORM_PROFILE:
@@ -74,7 +74,7 @@ clover::GetPlatformInfo(cl_platform_id d_platform, cl_platform_info param,
       break;
 
    case CL_PLATFORM_EXTENSIONS:
-      buf.as_string() = "cl_khr_icd";
+      buf.as_string() = platform.supported_extensions();
       break;
 
    case CL_PLATFORM_ICD_SUFFIX_KHR:
index 489e8dc5a831c482c5d62fd4db4d48ff7381bac7..ddd63fc5a0d1881cdac3825728a4274d9363d68a 100644 (file)
@@ -39,3 +39,8 @@ platform::platform() : adaptor_range(evals(), devs) {
       }
    }
 }
+
+std::string
+platform::supported_extensions() const {
+   return "cl_khr_icd";
+}
index e849645bbed3ba30625ff6c8194f891dca6bdd17..b94434c983cfbdaf4db93bb7b4f9d3f6bcae9cc5 100644 (file)
@@ -40,6 +40,8 @@ namespace clover {
       platform &
       operator=(const platform &platform) = delete;
 
+      std::string supported_extensions() const;
+
    protected:
       std::vector<intrusive_ref<device>> devs;
    };