22 class device_selector;
42 : MPlatform(APlatform), MPlugin(
std::make_shared<
plugin>(APlugin)) {}
45 std::shared_ptr<plugin> APlugin)
46 : MPlatform(APlatform), MPlugin(APlugin) {}
54 bool has_extension(
const std::string &ExtensionName)
const;
71 template <info::platform param>
76 bool is_host()
const {
return MHostPlatform; };
79 cl_platform_id
get()
const {
81 throw invalid_object_error(
82 "This instance of platform doesn't support OpenCL interoperability.",
85 return pi::cast<cl_platform_id>(MPlatform);
97 throw invalid_object_error(
"This instance of platform is a host instance",
110 static std::vector<platform> get_platforms();
114 assert(!MHostPlatform &&
"Plugin is not available for Host.");
122 assert(!MHostPlatform &&
"Plugin is not available for Host");
123 MPlugin = std::move(PluginPtr);
139 bool has(
aspect Aspect)
const;
150 std::shared_ptr<device_impl>
152 const std::shared_ptr<platform_impl> &PlatformImpl);
160 static std::shared_ptr<platform_impl> getHostPlatformImpl();
169 static std::shared_ptr<platform_impl>
181 static std::shared_ptr<platform_impl>
185 bool MHostPlatform =
false;
187 std::shared_ptr<plugin> MPlugin;
188 std::vector<std::weak_ptr<device_impl>> MDeviceCache;
189 std::mutex MDeviceMapMutex;