-
-
Notifications
You must be signed in to change notification settings - Fork 79
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
Make launch config construction more convenient with a builder class #311
Comments
I think the function name is pretty good. It does exactly what it says and keeps naming conventions from the STL like
Didn't happen to me, but what would be a solution for this? Different types for grid and block dimensions, such that they cannot be cast into each other implicitly?
This is a good point. Very often some kind of --> Especially because of the last point this abstraction seems to be a good idea. I am looking forward to your design. |
Those were introduced because we didn't have template deduction guides... we can now write
Maybe
which would work both for dims3 and for integral types, and
or
or
|
Also, a builder would be a place to apply all those occupancy functions, e.g. if we're linear, and have specified the overall size, then telling the builder "use the max-occupancy block size" rather than obtaining it with a separate function call and applying it to the launch config. |
Why do we need Integrating the max-occupancy or max-active-blocks calculation into the launch config seems to be a convenient design. I guess
|
Well, we might not, I'm not sure. You see, we could theoretically constrain the total size without constraining the distribution of this size among the dimensions.
Well, I'd say yes, but that would only work for kernels which are associated with a device to begin with (i.e. not apriori-compiled ones). Actually, the more important question is when to throw - immediately, or when the configuration is finalized?
I'd say the builder could through an exception. If the builder can know about the kernel it might as well. |
…_config_builder_t` (which you can create using `cuda::launch_config_builder()`). It make building lauch configurations easier... * Easy to build linear launch configurations. * Can specify the overall dimensions and the block or grid dims instead of always having to compute block and grid dims yourself. * Checks compatibility of dimensions and shared memory size with the kernel or device associated with the builder. Remains to be implemented: * More/stricter validity checks. * Integration of optimal block size / launch grid functions from the API with this builder.
…_config_builder_t` (which you can create using `cuda::launch_config_builder()`). It make building lauch configurations easier... * Easy to build linear launch configurations. * Can specify the overall dimensions and the block or grid dims instead of always having to compute block and grid dims yourself. * Checks compatibility of dimensions and shared memory size with the kernel or device associated with the builder. Remains to be implemented: * More/stricter validity checks. * Integration of optimal block size / launch grid functions from the API with this builder.
@codecircuit : Have a look at the effects of the new launch config build in the |
I'm still mulling over whether to run all those checks though. Perhaps I should only run them when building in debug mode? |
…_config_builder_t` (which you can create using `cuda::launch_config_builder()`). It make building lauch configurations easier... * Easy to build linear launch configurations. * Can specify the overall dimensions and the block or grid dims instead of always having to compute block and grid dims yourself. * Checks compatibility of dimensions and shared memory size with the kernel or device associated with the builder. Remains to be implemented: * More/stricter validity checks. * Integration of optimal block size / launch grid functions from the API with this builder.
…_config_builder_t` (which you can create using `cuda::launch_config_builder()`). It make building lauch configurations easier... * Easy to build linear launch configurations. * Can specify the overall dimensions and the block or grid dims instead of always having to compute block and grid dims yourself. * When compiling in Debug mode (i.e. with `NDEBUG` undefined), checks compatibility of dimensions and shared memory size with the kernel or device associated with the builder. Remains to be implemented: * Integration of optimal block size / launch grid functions from the API with this builder.
…_config_builder_t` (which you can create using `cuda::launch_config_builder()`). It make building lauch configurations easier... * Easy to build linear launch configurations. * Can specify the overall dimensions and the block or grid dims instead of always having to compute block and grid dims yourself. * When compiling in Debug mode (i.e. with `NDEBUG` undefined), checks compatibility of dimensions and shared memory size with the kernel or device associated with the builder. Remains to be implemented: * Integration of optimal block size / launch grid functions from the API with this builder.
…_config_builder_t` (which you can create using `cuda::launch_config_builder()`). It make building lauch configurations easier... * Easy to build linear launch configurations. * Can specify the overall dimensions and the block or grid dims instead of always having to compute block and grid dims yourself. * When compiling in Debug mode (i.e. with `NDEBUG` undefined), checks compatibility of dimensions and shared memory size with the kernel or device associated with the builder. Remains to be implemented: * Integration of optimal block size / launch grid functions from the API with this builder.
…der generate a linear grid, given the block dimensions, kernel and device, which will saturate the device with active blocks.
…der generate a linear grid, given the block dimensions, kernel and device, which will saturate the device with active blocks.
…der generate a linear grid, given the block dimensions, kernel and device, which will saturate the device with active blocks.
…_config_builder_t` (which you can create using `cuda::launch_config_builder()`). It make building lauch configurations easier... * Easy to build linear launch configurations. * Can specify the overall dimensions and the block or grid dims instead of always having to compute block and grid dims yourself. * When compiling in Debug mode (i.e. with `NDEBUG` undefined), checks compatibility of dimensions and shared memory size with the kernel or device associated with the builder. Remains to be implemented: * Integration of optimal block size / launch grid functions from the API with this builder.
…der generate a linear grid, given the block dimensions, kernel and device, which will saturate the device with active blocks.
…fying no dynamic shared memory is used
…fying no dynamic shared memory is used
I'm not satisfied with how we can construct launch configurations right now.
make_launch_config
is a bit of a lame name.I'm giving serious though to adding a launch config builder class, to solve all of the above.
The text was updated successfully, but these errors were encountered: