Skip to content

Commit

Permalink
Allow to access host USM allocations on the host
Browse files Browse the repository at this point in the history
  • Loading branch information
Rbiessy committed Jul 3, 2024
1 parent 9dbd67b commit c2b89f5
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/sparse_blas/backends/mkl_common/mkl_helper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,8 @@ namespace oneapi::mkl::sparse::detail {
template <typename T>
inline bool is_ptr_accessible_on_host(sycl::queue &queue, const T *host_or_device_ptr) {
auto alloc_type = sycl::get_pointer_type(host_or_device_ptr, queue.get_context());
// Note sycl::usm::alloc::host may not be accessible on the host according to SYCL specification.
// sycl::usm::alloc::unknown is returned if the pointer is not a USM allocation which is assumed to be a normal host pointer.
return alloc_type == sycl::usm::alloc::shared || alloc_type == sycl::usm::alloc::unknown;
return alloc_type == sycl::usm::alloc::host || alloc_type == sycl::usm::alloc::shared ||
alloc_type == sycl::usm::alloc::unknown;
}

/// Throw an exception if the scalar is not accessible in the host
Expand Down

0 comments on commit c2b89f5

Please sign in to comment.