Add experimental extension to query mem properties of sorting kernels#127
Add experimental extension to query mem properties of sorting kernels#127jandres742 wants to merge 2 commits into
Conversation
|
@wdamon-intel please review |
| desc: "[in] number of elements to process" | ||
| - type: "$x_device_group_algorithm_memory_exp_properties_t*" | ||
| name: pGroupAlgorithmMemoryProperties | ||
| desc: "[in,out] query result for group algorithm memory properties" No newline at end of file |
There was a problem hiding this comment.
Minor: seems, empty line at the end is missed.
wdamon-intel
left a comment
There was a problem hiding this comment.
Overall, looks good; just a few minor questions/comments.
| * Functions | ||
|
|
||
|
|
||
| * ${x}DeviceGetGroupAlgorithmMemoryPropertiesExp No newline at end of file |
There was a problem hiding this comment.
Would it beneficial to have an explanation of this API with an example usage after the API overview section?
There was a problem hiding this comment.
@andreyfe1 : Please let me know if the following text is correct:
This extension allows applications to query for memory requirements of
the underlying compiler when selecting a particular group algorithm in
their kernels. 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 is needed to run use algorithms,
application would call this extension as follows:
$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 = $xDeviceGetGroupAlgorithmMemoryPropertiesExp(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.
There was a problem hiding this comment.
@jandres742 Is the double underscore intentional? i.e. should $X__ be $X_ ?
There was a problem hiding this comment.
@wdamon-intel thanks. that's just an error. Once I write it in the scripts, I will correct it. Text in comment above is just a draft to confirm it is good.
There was a problem hiding this comment.
This extension allows applications to query for memory requirements of the underlying compiler when selecting a particular group algorithm in their kernels
@jandres742, the goal for this extension is to let users know how much temporary memory they need to allocate. When they know the value, they can allocate a memory and put it as a parameter to a group algorithm that requires additional memory. So, regarding wording. Maybe we can say something like this
This extension allows applications to query for memory requirements of
the underlying compiler when selecting a particular group algorithm in
their kernels. It gives applications the memory size that is required for
memory allocations needed for group algorithms.
| - type: $x_group_algorithm_memory_scope_exp_t | ||
| name: "memoryScope" | ||
| desc: "[in] Memory scope of group algorithm" | ||
| - type: size_t* |
There was a problem hiding this comment.
i just realized, this needs to be scalar values, as the struct is already pointer.
| .. _ZE_experimental_device_group_algorithm_memory_properties: | ||
|
|
||
| ======================================================== | ||
| Group Algorithm Memory Properties Experimental Extension |
There was a problem hiding this comment.
are we adding some algorithms to Level Zero ?
Is there somewhere more data on the request ?
Signed-off-by: Jaime Arteaga <jaime.a.arteaga.molina@intel.com>
Signed-off-by: Jaime Arteaga <jaime.a.arteaga.molina@intel.com>
fedcc08 to
73f5faf
Compare
|
@wdamon-intel , @andreyfe1 : Added content for programmers guide. |
Looks good to me. Thanks |
|
Closing as duplicate of another issue pending discussion internally. |
No description provided.