#ifndef GPU_AMD_SYCL_HIP_COMPAT_HPP
#define GPU_AMD_SYCL_HIP_COMPAT_HPP
#include <hip/hip_runtime.h>
#include "xpu/sycl/compat.hpp"
#include "gpu/amd/sycl_hip_utils.hpp"
#if __has_include(<sycl/ext/oneapi/backend/hip.hpp>)
#include <sycl/ext/oneapi/backend/hip.hpp>
#endif
namespace dnnl {
namespace impl {
namespace gpu {
namespace amd {
namespace compat {
using interop_handle = ::sycl::interop_handle;
template <typename T, typename U>
T get_native_mem(const interop_handle &ih, U acc) {
return reinterpret_cast<T>(
ih.get_native_mem<::sycl::backend::ext_oneapi_hip>(acc));
}
template <typename T>
void host_task(::sycl::handler &cgh, const T &task) {
cgh.host_task(task);
}
template <typename native_object_t, typename sycl_object_t,
typename
= std::enable_if_t<!std::is_same_v<sycl_object_t, ::sycl::context>>>
native_object_t get_native(const sycl_object_t &sycl_object) {
auto handle
= ::sycl::get_native<::sycl::backend::ext_oneapi_hip>(sycl_object);
return reinterpret_cast<native_object_t>(handle);
}
template <>
HIPcontext get_native(const ::sycl::device &device);
} } } } }
#endif