Skip to content

Commit 8bf884c

Browse files
authored
Update documentation on zeKernelSuggestMaxCooperativeGroupCount (#412)
* Update documentation on zeKernelSuggestMaxCooperativeGroupCount * Add set group size to example Signed-off-by: Aravind Gopalakrishnan <aravind.gopalakrishnan@intel.com>
1 parent d56ace5 commit 8bf884c

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

scripts/core/PROG.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1971,6 +1971,12 @@ cooperative kernel launch may be determined by calling ${x}KernelSuggestMaxCoope
19711971

19721972
.. parsed-literal::
19731973
1974+
// query and set kernel work-group size
1975+
uint32_t groupSizeX;
1976+
uint32_t groupSizeY;
1977+
${x}KernelSuggestGroupSize(hKernel, imageWidth, imageHeight, 1, &groupSizeX, &groupSizeY, nullptr);
1978+
${x}KernelSetGroupSize(hKernel, groupSizeX, groupSizeY, 1);
1979+
19741980
// query the maximum cooperative kernel launch for the kernel
19751981
uint32_t maxGroupCount;
19761982
${x}KernelSuggestMaxCooperativeGroupCount(hKernel, &maxGroupCount);

scripts/core/module.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,7 @@ name: SuggestMaxCooperativeGroupCount
479479
details:
480480
- "The application may call this function from simultaneous threads."
481481
- "The implementation of this function should be lock-free."
482+
- "Applications are recommended to use $xKernelSuggestGroupSize and $xKernelSetGroupSize first before calling this function and launching cooperative kernels. Otherwise, implementation may return $X_RESULT_ERROR_INVALID_GROUP_SIZE_DIMENSION."
482483
params:
483484
- type: "$x_kernel_handle_t"
484485
name: hKernel

0 commit comments

Comments
 (0)