Skip to content
This repository has been archived by the owner on May 27, 2021. It is now read-only.

WIP: Support custom allocators, implement a bump allocator #422

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

jonathanvdc
Copy link

This PR allows @cuda callers to pick a custom allocation function and implements a bump allocator, as per your request, @maleadt, in #419. I also threw in an example program that doubles as a test.

Add a pass that rewrites calls to 'managed_malloc'
The 'init' kwarg to '@cuda' allows users to define custom kernel
initialization logic, which is run just prior to the kernel.
The main use case for this kwarg right now is setting up globals.
Change how bump allocators are initialized

Define 'cuda_global_ptr' in runtime library
@maleadt
Copy link
Member

maleadt commented Jun 17, 2019

Great, thanks!
bors try

This will be a good starting point to get a more complex GC merged.

bors bot added a commit that referenced this pull request Jun 17, 2019
@bors
Copy link
Contributor

bors bot commented Jun 17, 2019

try

Build failed

@maleadt
Copy link
Member

maleadt commented Jun 17, 2019

bors try

bors bot added a commit that referenced this pull request Jun 17, 2019
@jonathanvdc
Copy link
Author

Yikes. I see what happened there. The call to replace_malloc! in optim.jl was dependent on the Julia version. This should fix it.

@bors
Copy link
Contributor

bors bot commented Jun 17, 2019

try

Build failed

@jonathanvdc
Copy link
Author

jonathanvdc commented Jun 17, 2019

Hmmm. Julia v1.0 and v1.1 don't seem to like bump_alloc. Not sure why.

EDIT: I made some tweaks. Let's see if this works.

@maleadt
Copy link
Member

maleadt commented Jun 17, 2019

bors try

bors bot added a commit that referenced this pull request Jun 17, 2019
@bors
Copy link
Contributor

bors bot commented Jun 17, 2019

try

Build failed

@maleadt
Copy link
Member

maleadt commented Jun 17, 2019

The pairwise test has been flaky before, so this looks like it is working. I'm going to leave this open until I have some time to give it a proper look, which might be a while.

@jonathanvdc
Copy link
Author

Alright, thanks! I can't reproduce the pairwise test failure either.

@maleadt maleadt changed the title Support custom allocators, implement a bump allocator WIP: Support custom allocators, implement a bump allocator Jul 12, 2019
@maleadt maleadt force-pushed the master branch 4 times, most recently from 17dfd92 to 3c9b279 Compare January 22, 2020 15:17
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants