Skip to content
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

Add experimental extension to query mem properties of sorting kernels #127

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Add content to programmers guide
Signed-off-by: Jaime Arteaga <jaime.a.arteaga.molina@intel.com>
  • Loading branch information
Jaime Arteaga committed May 13, 2023
commit 73f5faf3a90ae40f36cd22d2c0110681df522e41
39 changes: 38 additions & 1 deletion scripts/core/EXT_Exp_GroupAlgorithmMemory.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,41 @@ API
* Functions


* ${x}DeviceGetGroupAlgorithmMemoryPropertiesExp
* ${x}DeviceGetGroupAlgorithmMemoryPropertiesExp


Group Algorithm Memory Properties
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This extension allows applications to query for memory requirements of
the underlying compiler when selecting a particular group algorithm in
their kernels. Specifically, this extension returns the global memory
size and shared local memory size that applications need to allocate
and pass as a parameter to a group algorithm that requires additional
memory.

Three types of algorithms are available:

${X}_GROUP_ALGORITHM_TYPE_EXP_SORT: sorting algorithm

${X}_GROUP_ALGORITHM_TYPE_EXP_SCAN: scan algorithm

${X}_GROUP_ALGORITHM_TYPE_EXP_REDUCE: reduce algorithm

To know what amount of memory, application would call this extension as
follows:

.. parsed-literal::

${x}_device_group_algorithm_memory_exp_properties_t groupAlgorithmMemoryProperties {};
groupAlgorithmMemoryProperties.stype = ${X}_STRUCTURE_TYPE_DEVICE_GROUP_ALGORITHM_MEMORY_EXP_PROPERTIES;
groupAlgorithmMemoryProperties.algorithm = ${X}_GROUP_ALGORITHM_TYPE_EXP_SORT;
groupAlgorithmMemoryProperties.memoryScope = ${X}_GROUP_ALGORITHM_MEMORY_SCOPE_EXP_SUBGROUP;

${x}_result_t res = ${x}DeviceGetGroupAlgorithmMemoryPropertiesExp(hDevice, numOfElements, &groupAlgorithmMemoryProperties);


Upon return, groupAlgorithmMemoryProperties will contain in
globalMemorySize and sharedLocalMemorySize the global and
shared local memory needed, respectively, for executing the selected
algorithm in the target device.
12 changes: 6 additions & 6 deletions scripts/core/groupalgorithmmemory.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,12 @@ members:
- type: $x_group_algorithm_memory_scope_exp_t
name: "memoryScope"
desc: "[in] Memory scope of group algorithm"
- type: size_t*
name: "pGlobalMemorySize"
desc: "[out][optional] pointer to global memory size"
- type: size_t*
name: "pSharedLocalMemorySize"
desc: "[out][optional] pointer to shared local memory size"
- type: size_t
name: "globalMemorySize"
desc: "[out] global memory size"
- type: size_t
name: "sharedLocalMemorySize"
desc: "[out] shared local memory size"
details:
- "This structure must be passed to $xDeviceGetGroupAlgorithmMemoryPropertiesExp to obtain the memory properties of a group algorithm."
--- #--------------------------------------------------------------------------
Expand Down