Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/lapack/backends/cusolver/cusolver_helper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,16 @@ struct CudaEquivalentType<std::complex<double>> {

/* devinfo */

/* Allocates the device memory cuSOLVER writes its `devInfo` output to. A failed
* allocation must not be passed on to cuSOLVER as a null pointer, since that
* silently disables the routine's error reporting. */
inline int* create_devinfo(sycl::queue& queue, const char* func_name, int dev_info_size = 1) {
int* devInfo = sycl::malloc_device<int>(dev_info_size, queue);
if (!devInfo)
throw oneapi::math::device_bad_alloc("lapack", func_name, queue.get_device());
return devInfo;
}

inline void get_cusolver_devinfo(sycl::queue& queue, sycl::buffer<int>& devInfo,
std::vector<int>& dev_info_) {
sycl::host_accessor<int, 1, sycl::access::mode::read> dev_info_acc{ devInfo };
Expand Down
Loading