#ifndef XPU_SYCL_COMPAT_HPP
#define XPU_SYCL_COMPAT_HPP
#include "xpu/sycl/utils.hpp"
namespace dnnl {
namespace impl {
namespace xpu {
namespace sycl {
namespace compat {
void *get_native(const ::sycl::device &dev);
void *get_native(const ::sycl::context &ctx);
template <typename native_object_t, typename sycl_object_t>
native_object_t get_native(const sycl_object_t &sycl_object) {
return reinterpret_cast<native_object_t>(get_native(sycl_object));
}
template <typename H, typename F>
inline auto host_task_impl(H &cgh, F &&f, int) -> decltype(cgh.host_task(f)) {
cgh.host_task(f);
}
template <typename H, typename F>
inline auto host_task_impl(
H &cgh, F &&f, long) -> decltype(cgh.codeplay_host_task(f)) {
cgh.codeplay_host_task(f);
}
template <typename H, typename F>
inline void host_task(H &cgh, F &&f) {
host_task_impl(cgh, f, 0);
}
constexpr auto target_device = ::sycl::target::device;
template <typename T, int dims>
using local_accessor = ::sycl::accessor<T, dims,
::sycl::access::mode::read_write, ::sycl::access::target::local>;
inline const auto &cpu_selector_v = ::sycl::cpu_selector_v;
inline const auto &gpu_selector_v = ::sycl::gpu_selector_v;
} } } } }
#endif