File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
dpctl/tensor/libtensor/include/kernels/sorting Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -475,9 +475,16 @@ sycl::event topk_radix_impl(sycl::queue &exec_q,
475
475
IndexTy *workspace = sycl::malloc_device<IndexTy>(
476
476
padded_total_nelems + total_nelems, exec_q);
477
477
478
+ if (nullptr == workspace) {
479
+ throw std::runtime_error (
480
+ " Not enough device memory for radix sort topk" );
481
+ }
482
+
478
483
IndexTy *tmp_tp = sycl::malloc_device<IndexTy>(total_nelems, exec_q);
479
484
480
- if (nullptr == workspace || nullptr == tmp_tp) {
485
+ if (nullptr == tmp_tp) {
486
+ using dpctl::tensor::alloc_utils::sycl_free_noexcept;
487
+ sycl_free_noexcept (workspace, exec_q);
481
488
throw std::runtime_error (
482
489
" Not enough device memory for radix sort topk" );
483
490
}
You can’t perform that action at this time.
0 commit comments