cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

zoomzoom
Adept I

Obtaining information about a kernel arguments at runtime

Does the HSA Runtime provide a way to obtain any of these information for a kernel:

- the total number of parameters

- the maximum alignment of any of the kernel arguments?

This information would be needed in order to be able to set the value of a kernel argument at runtime, based only on the argument index.

Thanks.

0 Likes
1 Reply
jedwards
Staff

The runtime only exposes the following information about the kernarg segment:

.

HSA_CODE_SYMBOL_INFO_KERNEL_KERNARG_SEGMENT_SIZE - Size of kernarg segment memory that is required to hold the values of the kernel arguments, in bytes. The value of this attribute is undefined if the symbol is not a kernel. The type of this attribute is uint32_t.

.

HSA_CODE_SYMBOL_INFO_KERNEL_KERNARG_SEGMENT_ALIGNMENT - Alignment (in bytes) of the buffer used to pass arguments to the kernel, which is the maximum of 16 and the maximum alignment of any of the kernel arguments. The value of this attribute is undefined if the symbol is not a kernel. The type of this attribute is uint32_t.

.

Specific information regarding the kernarg segment and the alignment of the kernel argument list are described in section 4.21 of the HSA Programmer's Reference Manual, located here.

0 Likes