Skip to content

Commit

Permalink
++
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeDvorskiy committed Dec 27, 2024
1 parent 38c7e2e commit ed22ca5
Showing 1 changed file with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -519,15 +519,15 @@ struct __usm_or_buffer_accessor
// a `__future` for keeping alive temporary data, while allowing run-time branches to lead to
// differently typed temporary storage for kernels. Virtual destructor is required to call
// derived class destructor when leaving scope.
template <typename _T>
struct __result_and_scratch_storage_base
{
virtual ~__result_and_scratch_storage_base() = default;
template <typename _T, typename _Event>
virtual _T __wait_and_get_value(_Event&&, size_t) const = 0;
virtual _T __wait_and_get_value(sycl::event&&, std::size_t) const = 0;
};

template <typename _ExecutionPolicy, typename _T>
struct __result_and_scratch_storage : __result_and_scratch_storage_base
struct __result_and_scratch_storage : __result_and_scratch_storage_base<_T>
{
private:
using __sycl_buffer_t = sycl::buffer<_T, 1>;
Expand Down Expand Up @@ -684,9 +684,7 @@ struct __result_and_scratch_storage : __result_and_scratch_storage_base
}
}

template <typename _Val, typename _Event>
virtual _Val
__wait_and_get_value(_Event&& __event, size_t idx = 0) const
virtual _T __wait_and_get_value(sycl::event&& __event, std::size_t idx = 0) const
{
if (is_USM())
__event.wait_and_throw();
Expand Down Expand Up @@ -728,14 +726,14 @@ class __future : private std::tuple<_Args...>
constexpr auto
__wait_and_get_value(const __result_and_scratch_storage<_ExecutionPolicy, _T>& __storage)
{
return __storage.__wait_and_get_value<_T>(__my_event);
return __storage.__wait_and_get_value(__my_event);
}

template <typename _ExecutionPolicy, typename _T>
constexpr auto
__wait_and_get_value(const std::shared_ptr<__result_and_scratch_storage_base>& __storage)
{
return __storage.__wait_and_get_value<_T>(__my_event);
return __storage.__wait_and_get_value(__my_event);
}

template <typename _T>
Expand Down

0 comments on commit ed22ca5

Please sign in to comment.