We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 54712f9 commit 48021a1Copy full SHA for 48021a1
1 file changed
src/wrap_cl.hpp
@@ -3646,10 +3646,19 @@ namespace pyopencl
3646
"supplying an out-of-order queue to SVMAllocation is invalid");
3647
}
3648
3649
- PYOPENCL_PRINT_CALL_TRACE("clSVMalloc");
3650
- m_allocation = clSVMAlloc(
3651
- ctx->data(),
3652
- flags, size, alignment);
+ int try_count = 0;
+ while (try_count < 2)
+ {
+ PYOPENCL_PRINT_CALL_TRACE("clSVMalloc");
3653
+ m_allocation = clSVMAlloc(
3654
+ ctx->data(),
3655
+ flags, size, alignment);
3656
+ if (m_allocation)
3657
+ return;
3658
+
3659
+ ++try_count;
3660
+ run_python_gc();
3661
+ }
3662
3663
if (!m_allocation)
3664
throw pyopencl::error("clSVMAlloc", CL_OUT_OF_RESOURCES);
0 commit comments