Skip to content

Commit

Permalink
Add content to programmers guide
Browse files Browse the repository at this point in the history
Signed-off-by: Jaime Arteaga <jaime.a.arteaga.molina@intel.com>
  • Loading branch information
Jaime Arteaga committed May 13, 2023
1 parent 703db6e commit 73f5faf
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 7 deletions.
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

0 comments on commit 73f5faf

Please sign in to comment.