Skip to content

Commit

Permalink
[SYCL][COMPAT] Fix using address of a temporary queue_ptr in util.hpp (
Browse files Browse the repository at this point in the history
…#14440)

Fixes the path for `x <= 2` in `int_as_queue_ptr`, which was returning
an address to a temporary pointer.

Signed-off-by: Alberto Cabrera <alberto.cabrera@codeplay.com>
  • Loading branch information
Alcpz committed Jul 5, 2024
1 parent 4cb0518 commit 29230c8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sycl/include/syclcompat/util.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -922,7 +922,8 @@ class group : public group_base<dimensions> {
/// If x <= 2, then return a pointer to the default queue;
/// otherwise, return x reinterpreted as a queue_ptr.
inline queue_ptr int_as_queue_ptr(uintptr_t x) {
return x <= 2 ? &get_default_queue() : reinterpret_cast<queue_ptr>(x);
return x <= 2 ? detail::dev_mgr::instance().current_device().default_queue()
: reinterpret_cast<queue_ptr>(x);
}

template <int n_nondefault_params, int n_default_params, typename T>
Expand Down

0 comments on commit 29230c8

Please sign in to comment.