NVIDIA / NVIDIA/cuda-python

`from_handle` constructors need to allow managing ownership

Open
#1,187 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

cuda.core enhancement
Dominant language
Cython
Stars
3.4k
Forks
329
Avg merge
1d 23h
Merged PRs (30d)
116

Description

Currently all objects in cuda.core have a from_handle constructor (#192), allowing constructing the object from an underlying C handle allocated elsewhere. However, currently this gives a view-only semantics, and could not help manage the handle lifetime. It'd be nice to have a kw(-only) argument added that allows optionally handling the lifetime, or even acquiring the ownership.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the from_handle constructors across cuda.core and review issue #192 for their current view-only semantics. Define the expected behavior for an optional keyword-only lifetime or ownership argument, then verify that all affected object constructors handle borrowed and owned handles consistently.

Written by the indexing model from the issue text.

Assessment

Domain
api
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.