-
-
Notifications
You must be signed in to change notification settings - Fork 80
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
Change kernel_t construction pattern to fit other wrapper classes #285
Labels
Comments
eyalroz
added a commit
that referenced
this issue
Dec 11, 2021
* For #284: Introduced a grid-and-block-dimensions structure, `grid::complete_dimensions_t`. Using it when returning both grid and block dimensions instead of an `std::pair`; it has equals * For #285: Changed the construction pattern for `kernel_t`: * Dropped the templated, wrapping, direct constructor. * Added `kernel::detail_::wrap()` taking a device ID and an arbitrary (function) pointer, and a `kernel::wrap()` taking a device ID and type-erased `const void*` pointer. * Made the lower-level `wrap()` a friend of the `kernel_t` class. * Now using the default destructor for `kernel_t`'s (has nothing to do with the construction changes). * Spacing tweaks. * Comment typo fixes. * Added not-equal operators for launch configurations * Added some comments to some `#endif`'s, reminding the reader of the condition used in the `#if` of `#ifdef`. * Made some narrowing casts explicit, to clarify their intentionality to static analysis tool. * Added two aliases to the sync/async boolean enum in `cuda::stream` * A bit of comment rephrasing Example program changes: * Adapted examples for the use of `grid::complete_dimensions_t`. * Now creating wrapped kernels using `cuda::kernel::wrap()` rather than by direct construction. * Spacing tweaks. * Changes to the `cudaChooseDevice()` function in `helper_cuda.h`; mainly: * Now returning a `cuda::device_t` * No longer making the returned device current. In particular, that means that `simpleStreams.cu` may now be using a device that's not the current one.
Done for the driver-wrappers branch too. |
eyalroz
added a commit
that referenced
this issue
Dec 13, 2021
* For #284: Introduced a grid-and-block-dimensions structure, `grid::complete_dimensions_t`. Using it when returning both grid and block dimensions instead of an `std::pair`; it has equals * For #285: Changed the construction pattern for `kernel_t`: * Dropped the templated, wrapping, direct constructor. * Added `kernel::detail_::wrap()` taking a device ID and an arbitrary (function) pointer, and a `kernel::wrap()` taking a device ID and type-erased `const void*` pointer. * Made the lower-level `wrap()` a friend of the `kernel_t` class. * Now using the default destructor for `kernel_t`'s (has nothing to do with the construction changes). * Spacing tweaks. * Comment typo fixes. * Added not-equal operators for launch configurations * Added some comments to some `#endif`'s, reminding the reader of the condition used in the `#if` of `#ifdef`. * Made some narrowing casts explicit, to clarify their intentionality to static analysis tool. * Added two aliases to the sync/async boolean enum in `cuda::stream` * A bit of comment rephrasing Example program changes: * Adapted examples for the use of `grid::complete_dimensions_t`. * Now creating wrapped kernels using `cuda::kernel::wrap()` rather than by direct construction. * Spacing tweaks. * Changes to the `cudaChooseDevice()` function in `helper_cuda.h`; mainly: * Now returning a `cuda::device_t` * No longer making the returned device current. In particular, that means that `simpleStreams.cu` may now be using a device that's not the current one.
eyalroz
added a commit
that referenced
this issue
Jan 14, 2022
* For #284: Introduced a grid-and-block-dimensions structure, `grid::complete_dimensions_t`. Using it when returning both grid and block dimensions instead of an `std::pair`; it has equals * For #285: Changed the construction pattern for `kernel_t`: * Dropped the templated, wrapping, direct constructor. * Added `kernel::detail_::wrap()` taking a device ID and an arbitrary (function) pointer, and a `kernel::wrap()` taking a device ID and type-erased `const void*` pointer. * Made the lower-level `wrap()` a friend of the `kernel_t` class. * Now using the default destructor for `kernel_t`'s (has nothing to do with the construction changes). * Spacing tweaks. * Comment typo fixes. * Added not-equal operators for launch configurations * Added some comments to some `#endif`'s, reminding the reader of the condition used in the `#if` of `#ifdef`. * Made some narrowing casts explicit, to clarify their intentionality to static analysis tool. * Added two aliases to the sync/async boolean enum in `cuda::stream` * A bit of comment rephrasing Example program changes: * Adapted examples for the use of `grid::complete_dimensions_t`. * Now creating wrapped kernels using `cuda::kernel::wrap()` rather than by direct construction. * Spacing tweaks. * Changes to the `cudaChooseDevice()` function in `helper_cuda.h`; mainly: * Now returning a `cuda::device_t` * No longer making the returned device current. In particular, that means that `simpleStreams.cu` may now be using a device that's not the current one.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Most of our wrappers aren't directly constructible, and use a
wrap()
function for construction from simpler/lower-level values. We should do this forkernel_t
's as well. This will, in particular, clarify that such construction does not involve any API calls or other work.The text was updated successfully, but these errors were encountered: