Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make SVM practical #452

Merged
merged 25 commits into from
Sep 8, 2022
Merged
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
246e521
__init__: import warn once at the top
inducer Jul 1, 2022
5fc2fb7
Add is_queue_in_order
inducer Jul 1, 2022
ce7a76c
Add fold markers in wrap_mempool
inducer Jun 27, 2022
05e0380
Jostle some section headers in wrap_cl.hpp
inducer Jul 1, 2022
84de917
Add command_queue_ref
inducer Aug 18, 2022
3e05c06
Rework SVM for efficient use in arrays, implement SVM mempool
inducer Aug 18, 2022
af06c2f
Add, use enqueue_fill
inducer Aug 18, 2022
15e3ab9
set_arg: Try cl_mem/svm based on what was used last
inducer Aug 5, 2022
ec92241
Add an example for arrays with SVM
inducer Aug 18, 2022
b8348bc
Mark some destructors virtual, partially based on clang warnings
matthiasdiener Aug 9, 2022
10bfaad
Add missing result initialization in buffer_allocator_call
matthiasdiener Aug 18, 2022
04b6372
Move tools higher in the docs TOC
inducer Aug 28, 2022
00d2987
Acknowledge DOE funding
inducer Aug 28, 2022
d08b313
Bump version to 2022.2
inducer Aug 30, 2022
ef1c00b
Use pocl dev label for Conda CI
inducer Aug 31, 2022
34951a4
Add section headers in test_wrapper
inducer Sep 5, 2022
0bc7264
Fix rendering in doc/runtime_const
inducer Sep 6, 2022
5eafd63
array: Import warn once at the top
inducer Sep 6, 2022
d6a2f9a
Expose {SVMAllocation,PooledSVM}._queue
inducer Sep 6, 2022
02daca5
Array constructor: warn about SVM queue inconsistencies
inducer Sep 6, 2022
2a25c49
Make enqueue_copy offsets interface more uniform
inducer Sep 6, 2022
a2c2f21
Add test_svm_mem_pool_with_arrays
matthiasdiener Aug 18, 2022
6d46d62
Generalize test_coarse_grain_svm to test opqaue-style SVM
inducer Sep 6, 2022
2c2eaa7
Add changelog entry for 2022.2
inducer Sep 7, 2022
e2cb9d7
Retry clSVMAlloc in SVMAllocation after running GC
inducer Sep 8, 2022
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
Prev Previous commit
Retry clSVMAlloc in SVMAllocation after running GC
inducer committed Sep 8, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit e2cb9d785d88077f250baa9f2f2a720782a1bbf3
17 changes: 13 additions & 4 deletions src/wrap_cl.hpp
Original file line number Diff line number Diff line change
@@ -3646,10 +3646,19 @@ namespace pyopencl
"supplying an out-of-order queue to SVMAllocation is invalid");
}

PYOPENCL_PRINT_CALL_TRACE("clSVMalloc");
m_allocation = clSVMAlloc(
ctx->data(),
flags, size, alignment);
int try_count = 0;
while (try_count < 2)
{
PYOPENCL_PRINT_CALL_TRACE("clSVMalloc");
m_allocation = clSVMAlloc(
ctx->data(),
flags, size, alignment);
if (m_allocation)
return;

++try_count;
run_python_gc();
}

if (!m_allocation)
throw pyopencl::error("clSVMAlloc", CL_OUT_OF_RESOURCES);