Skip to content

Add section Preparing kernel arguments#541

Merged
leofang merged 17 commits into
NVIDIA:mainfrom
vzhurba01:127-doc-preparing-arguments
Apr 4, 2025
Merged

Add section Preparing kernel arguments#541
leofang merged 17 commits into
NVIDIA:mainfrom
vzhurba01:127-doc-preparing-arguments

Conversation

@vzhurba01

Copy link
Copy Markdown
Contributor

Close #127

@vzhurba01 vzhurba01 added documentation Improvements or additions to documentation P1 Medium priority - Should do cuda.bindings Everything related to the cuda.bindings module labels Mar 31, 2025
@vzhurba01 vzhurba01 added this to the cuda-python 12.9.0 & 11.8.7 milestone Mar 31, 2025
@vzhurba01 vzhurba01 self-assigned this Mar 31, 2025
@copy-pr-bot

copy-pr-bot Bot commented Mar 31, 2025

Copy link
Copy Markdown
Contributor

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@vzhurba01

Copy link
Copy Markdown
Contributor Author

/ok to test

@github-actions

This comment has been minimized.

Comment thread cuda_bindings/docs/source/overview.md Outdated
))
```

### Using ctypes

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be good to have an example of using Python buffer protocol (https://docs.python.org/3/c-api/buffer.html) compatible objects as well, though I'm not sure how we'd specify the struct type in that situation.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The launch API supports Buffer Protocol objects, therefore we can pass the array object directly.

I tried to give this example by leveraging Numpy's array objects since they already have the protocol. Were you thinking about having an example of a custom user object that supports a Python buffer protocol as an example?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need to address this in this PR to be clear. Just mindful that we may want to make numpy an optional dependency in the future and if that's the case it would be nice to have an example of using buffer protocol without numpy (i.e. using the standard array library or something like that).

Comment thread cuda_bindings/docs/source/overview.md Outdated
@vzhurba01

Copy link
Copy Markdown
Contributor Author

/ok to test

Comment thread cuda_bindings/docs/source/overview.md
Comment thread cuda_bindings/docs/source/overview.md
@vzhurba01

Copy link
Copy Markdown
Contributor Author

/ok to test

@vzhurba01 vzhurba01 requested a review from leofang April 2, 2025 19:47
kkraus14
kkraus14 previously approved these changes Apr 2, 2025

@kkraus14 kkraus14 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving because only remaining comment is related to the linking to the example which we can handle in a follow up if desired

Comment thread cuda_bindings/docs/source/overview.md Outdated
@vzhurba01

Copy link
Copy Markdown
Contributor Author

/ok to test

@leofang leofang left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Half way done, sorry for my slowness

Comment thread cuda_bindings/docs/source/overview.md
Comment thread cuda_bindings/docs/source/overview.md Outdated
Comment thread cuda_bindings/docs/source/overview.md Outdated
Comment thread cuda_bindings/docs/source/overview.md Outdated
Comment thread cuda_bindings/docs/source/overview.md Outdated
Comment thread cuda_bindings/docs/source/overview.md Outdated
Comment thread cuda_bindings/docs/source/overview.md Outdated
Comment thread cuda_bindings/docs/source/overview.md Outdated
Comment thread cuda_bindings/docs/source/overview.md Outdated
Comment thread cuda_bindings/docs/source/overview.md Outdated
vzhurba01 and others added 8 commits April 3, 2025 11:49
Co-authored-by: Leo Fang <leo80042@gmail.com>
Co-authored-by: Leo Fang <leo80042@gmail.com>
Co-authored-by: Leo Fang <leo80042@gmail.com>
Co-authored-by: Leo Fang <leo80042@gmail.com>
Co-authored-by: Leo Fang <leo80042@gmail.com>
Co-authored-by: Leo Fang <leo80042@gmail.com>
Co-authored-by: Leo Fang <leo80042@gmail.com>
Co-authored-by: Leo Fang <leo80042@gmail.com>
@vzhurba01

Copy link
Copy Markdown
Contributor Author

/ok to test

@leofang leofang left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great improvement, thanks Vlad! I've completed my review.

Comment thread cuda_bindings/docs/source/overview.md Outdated
Comment thread cuda_bindings/docs/source/overview.md Outdated
Comment thread cuda_bindings/docs/source/overview.md Outdated
Comment thread cuda_bindings/docs/source/overview.md Outdated
Comment thread cuda_bindings/docs/source/overview.md Outdated
Comment thread cuda_bindings/docs/source/overview.md Outdated

@rwgk rwgk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I spotted some nits.

Comment thread cuda_bindings/docs/source/overview.md Outdated
Comment thread cuda_bindings/docs/source/overview.md Outdated
Comment thread cuda_bindings/docs/source/overview.md Outdated
Comment thread cuda_bindings/docs/source/overview.md Outdated
Comment thread cuda_bindings/docs/source/overview.md Outdated
@vzhurba01

Copy link
Copy Markdown
Contributor Author

/ok to test

@leofang

leofang commented Apr 4, 2025

Copy link
Copy Markdown
Member

Thanks, Vlad and Keith/Ralf!

@leofang leofang merged commit e7d067f into NVIDIA:main Apr 4, 2025
@github-actions

github-actions Bot commented Apr 4, 2025

Copy link
Copy Markdown
Doc Preview CI
Preview removed because the pull request was closed or merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cuda.bindings Everything related to the cuda.bindings module documentation Improvements or additions to documentation P1 Medium priority - Should do

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Document best practices in preparing arguments for cuLaunchKernel

4 participants