diff --git a/scripts/core/EXT_Exp_GroupAlgorithmMemory.rst b/scripts/core/EXT_Exp_GroupAlgorithmMemory.rst index 7f50b6376..93b358695 100644 --- a/scripts/core/EXT_Exp_GroupAlgorithmMemory.rst +++ b/scripts/core/EXT_Exp_GroupAlgorithmMemory.rst @@ -31,4 +31,41 @@ API * Functions - * ${x}DeviceGetGroupAlgorithmMemoryPropertiesExp \ No newline at end of file + * ${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. \ No newline at end of file diff --git a/scripts/core/groupalgorithmmemory.yml b/scripts/core/groupalgorithmmemory.yml index c6ad1d7ea..f1b48a34d 100644 --- a/scripts/core/groupalgorithmmemory.yml +++ b/scripts/core/groupalgorithmmemory.yml @@ -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." --- #--------------------------------------------------------------------------