[wiki:ClrxToc Back to Table of content] {{{ #!html

AMD Catalyst OpenCL ABI description

This chapter describes how kernel gets its argument, how access to constant data.

In this chapter, size is given in dwords. Dword is 4-byte value.

User data classes

User data is stored in first scalar registers. Data class indicates what data are stored. Following data classes:

About resource passing

All global pointers resource descriptors stored in the UAV table begin from UAVID+1 id. By default UAVID=11 (or for driver older than 1384.xx UAVID=9). By default10th entry is reserved for global data constant buffer. 9th entry is reserved for printf buffer. First eight entries is write only image descriptors if defined.

Read only image descriptors stored in resource table. Constant buffer descriptors (0 and 1) stored in const buffer tables

Argument passing and kernel setup

First const buffer (id=0) holds:

Second const buffer (id=1) holds arguments aligned to 4 dwords.

Global pointers holds vector offset (64-bit for 64-bit binary) to memory. Local pointers holds its offset in bytes (1 dword).

Other data and resources

Scalar register after userdata holds (n - userdatanum):

First three vector registers holds local ids for each dimensions.

Image arguments

Image arguments needs 8 dwords.

Sampler arguments

Sampler argument holds sampler value:

Scratch buffer access

Second entry in the internal global table holds scratch buffer descriptor. s[n+3] register holds wavefront offset to scratch buffer. where n is userdatanum.

}}}