21 inline namespace _V1 {
44 const std::shared_ptr<plugin> &APlugin)
45 : MPlatform(APlatform), MPlugin(APlugin) {
84 template <
typename Param>
typename Param::return_type
get_info()
const;
89 template <
typename Param>
93 bool is_host()
const {
return MHostPlatform; };
100 const char **backend_option)
const {
104 MPlatform, frontend_option, backend_option);
105 Plugin->checkPiResult(Err);
109 cl_platform_id
get()
const {
111 throw invalid_object_error(
112 "This instance of platform doesn't support OpenCL interoperability.",
113 PI_ERROR_INVALID_PLATFORM);
115 return pi::cast<cl_platform_id>(MPlatform);
127 throw invalid_object_error(
"This instance of platform is a host instance",
128 PI_ERROR_INVALID_PLATFORM);
144 assert(!MHostPlatform &&
"Plugin is not available for Host.");
153 assert(!MHostPlatform &&
"Plugin is not available for Host");
171 bool has(aspect Aspect)
const;
179 std::shared_ptr<device_impl>
191 std::shared_ptr<device_impl>
193 const std::shared_ptr<platform_impl> &PlatformImpl);
210 static std::shared_ptr<platform_impl>
223 static std::shared_ptr<platform_impl>
232 std::shared_ptr<device_impl>
236 template <
typename ListT,
typename FilterT>
238 filterDeviceFilter(std::vector<sycl::detail::pi::PiDevice> &PiDevices,
239 ListT *FilterList)
const;
241 bool MHostPlatform =
false;
246 std::vector<std::weak_ptr<device_impl>> MDeviceCache;
247 std::mutex MDeviceMapMutex;
::pi_platform_backend PiPlatformBackend
backend convertBackend(pi_platform_backend PiBackend)
std::shared_ptr< plugin > PluginPtr
uintptr_t pi_native_handle
@ PI_EXT_PLATFORM_INFO_BACKEND
pi_result piPluginGetBackendOption(pi_platform platform, const char *frontend_option, const char **backend_option)
API to get backend specific option.
pi_result piPlatformGetInfo(pi_platform platform, pi_platform_info param_name, size_t param_value_size, void *param_value, size_t *param_value_size_ret)
C++ wrapper of extern "C" PI interfaces.