23 #include <type_traits>
29 #define UR_DEVICE_INFO_EXTENSION_DEVICELIB_ASSERT "cl_intel_devicelib_assert"
36 #ifdef XPTI_ENABLE_INSTRUMENTATION
39 struct trace_event_data_t;
44 inline namespace _V1 {
51 #define _UR_API(api) api,
52 #include <ur_api_funcs.def>
57 #define _UR_API(api) decltype(&::api) pfn_##api = nullptr;
58 #include <ur_api_funcs.def>
66 inline void PopulateUrFuncPtrTable(
UrFuncPtrMapT *funcs,
void *module) {
67 #define _UR_API(api) \
68 funcs->pfn_##api = (decltype(&::api))GetWinProcAddress(module, #api);
69 #include <ur_api_funcs.def>
73 #define _UR_API(api) \
74 template <> struct UrFuncInfo<UrApiKind::api> { \
75 using FuncPtrT = decltype(&::api); \
76 inline const char *getFuncName() { return #api; } \
77 inline FuncPtrT getFuncPtr(const UrFuncPtrMapT *funcs) { \
78 return funcs->pfn_##api; \
80 inline FuncPtrT getFuncPtrFromModule(void *module) { \
81 return (FuncPtrT)GetWinProcAddress(module, #api); \
84 #include <ur_api_funcs.def>
87 #define _UR_API(api) \
88 template <> struct UrFuncInfo<UrApiKind::api> { \
89 using FuncPtrT = decltype(&::api); \
90 inline const char *getFuncName() { return #api; } \
91 constexpr inline FuncPtrT getFuncPtr(const void *) { return &api; } \
92 constexpr inline FuncPtrT getFuncPtrFromModule(void *) { return &api; } \
94 #include <ur_api_funcs.def>
110 template <sycl::backend BE>
129 std::vector<PluginPtr> &
130 initializeUr(ur_loader_config_handle_t LoaderConfig =
nullptr);
143 template <
class To,
class From> To
cast(From value);
147 template <
class To,
class From>
inline To
cast(From value) {
149 static_assert(
sizeof(From) ==
sizeof(To),
"assert: cast failed size check");
150 return reinterpret_cast<To
>(value);
159 template <
class To,
class FromE> To
cast(std::vector<FromE> Values) {
162 ResultVec.reserve(Values.size());
163 for (FromE &Val : Values) {
164 ResultVec.push_back(cast<typename To::value_type>(Val));
The context class represents a SYCL context on which kernel functions may be executed.
The plugin class provides a unified interface to the underlying low-level runtimes for the device-agn...
std::function< void(interop_handle)> func
void contextSetExtendedDeleter(const sycl::context &constext, pi_context_extended_deleter func, void *user_data)
std::vector< PluginPtr > & initializeUr(ur_loader_config_handle_t LoaderConfig=nullptr)
bool trace(TraceLevel level)
void * getOsLibraryFuncAddress(void *Library, const std::string &FunctionName)
To cast(std::vector< cl_event > value)
ur_program_metadata_t mapDeviceBinaryPropertyToProgramMetadata(const sycl_device_binary_property &DeviceBinaryProperty)
void * getURLoaderLibrary()
void * loadOsLibrary(const std::string &Library)
const PluginPtr & getPlugin()
int unloadOsLibrary(void *Library)
void * getPluginOpaqueData(void *opaquedata_arg)
std::shared_ptr< plugin > PluginPtr
void * GetWinProcAddress(void *module, const char *funcName)
void(* pi_context_extended_deleter)(void *user_data)