Skip to content
This repository has been archived by the owner on Mar 21, 2024. It is now read-only.

unified memory allocator and pointer classes? #569

Closed
rnburn opened this issue Oct 18, 2014 · 5 comments · Fixed by #1334
Closed

unified memory allocator and pointer classes? #569

rnburn opened this issue Oct 18, 2014 · 5 comments · Fixed by #1334
Assignees
Labels
type: enhancement New feature or request.

Comments

@rnburn
Copy link

rnburn commented Oct 18, 2014

Could you add an allocator class that uses cudaMallocManaged? This would be very useful for those implementing custom container classes.

I would image it as having a distinct pointer object (e.g. ManagedPtr) that doesn't default to either host or device execution policy but is implicitly convertible to either a built-in pointer for host execution, some sort of ManagedDevicePtr object that indicates device execution, or could be used by explicitly supplying an execution policy to the thrust algorithm functions.

Also, MangedPtr could be made to fulfill all of the requirements for a RandomAccessIterator (including having an iterator_category that's convertible to random_access_iterator_tag) so that it could be used with STL algorithm functions as well.

@brycelelbach
Copy link
Collaborator

Doesn't device_allocator do this?

@brycelelbach brycelelbach self-assigned this Sep 17, 2017
@brycelelbach brycelelbach added the type: enhancement New feature or request. label Sep 17, 2017
@jaredhoberock
Copy link
Contributor

device_allocator uses cudaMalloc and allocates fancy device_ptrs.

A hypothetical managed_allocator [1,2] which used cudaMallocManaged might work differently.

[1] https://github.com/jaredhoberock/managed_allocator

[2] https://github.com/agency-library/agency/blob/master/agency/cuda/memory/allocator/managed_allocator.hpp

@brycelelbach
Copy link
Collaborator

Ah, yes, I misunderstood.

Yes, this is on my todo list :).

@jrhemstad jrhemstad added this to CCCL Aug 11, 2022
@sbudenkov
Copy link

Hi,
Is it still in the backlog?

@gevtushenko
Copy link
Collaborator

Hello @sbudenkov! The following PR seems to have added universal_allocator.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: enhancement New feature or request.
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

5 participants