CLRX  1
An unofficial OpenCL extensions designed for Radeon GPUs
Commons.h
Go to the documentation of this file.
1 /*
2  * CLRadeonExtender - Unofficial OpenCL Radeon Extensions Library
3  * Copyright (C) 2014-2017 Mateusz Szpakowski
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18  */
23 #ifndef __CLRX_COMMONS_H__
24 #define __CLRX_COMMONS_H__
25 
26 #include <CLRX/Config.h>
27 
29 namespace CLRX
30 {
32 typedef cxuint RelocType;
33 
34 enum
35 {
39 };
40 
41 enum {
43  AMDHSAFLAG_USE_DISPATCH_PTR = 2,
46  AMDHSAFLAG_USE_DISPATCH_ID = 16,
47  AMDHSAFLAG_USE_FLAT_SCRATCH_INIT = 32,
49  AMDHSAFLAG_USE_GRID_WORKGROUP_COUNT_BIT = 7,
53 
54  AMDHSAFLAG_USE_ORDERED_APPEND_GDS = 1,
57  AMDHSAFLAG_USE_DYNAMIC_CALL_STACK = 16,
60 };
61 
64 {
67  uint16_t amdMachineKind;
68  uint16_t amdMachineMajor;
69  uint16_t amdMachineMinor;
70  uint16_t amdMachineStepping;
73  uint64_t kernelCodePrefetchSize;
74  uint64_t maxScrachBackingMemorySize;
75  uint32_t computePgmRsrc1;
76  uint32_t computePgmRsrc2;
78  uint16_t enableFeatureFlags;
81  uint32_t gdsSegmentSize;
82  uint64_t kernargSegmentSize;
83  uint32_t workgroupFbarrierCount;
84  uint16_t wavefrontSgprCount;
85  uint16_t workitemVgprCount;
86  uint16_t reservedVgprFirst;
87  uint16_t reservedVgprCount;
88  uint16_t reservedSgprFirst;
89  uint16_t reservedSgprCount;
90  uint16_t debugWavefrontPrivateSegmentOffsetSgpr;
91  uint16_t debugPrivateSegmentBufferSgpr;
95  cxbyte wavefrontSize;
96  uint32_t callConvention;
97  uint32_t reserved1[3];
98  uint64_t runtimeLoaderKernelSymbol;
99  cxbyte controlDirective[128];
100 };
101 
102 };
103 
104 #endif
use private segment size
Definition: Commons.h:48
uint16_t amdMachineStepping
arch stepping number
Definition: Commons.h:70
uint32_t workitemPrivateSegmentSize
workitem private (scratchbuffer) segment size
Definition: Commons.h:79
use workgroup count for Y dim
Definition: Commons.h:51
uint16_t amdMachineMinor
arch minor number
Definition: Commons.h:69
use 64-bit pointers
Definition: Commons.h:56
uint64_t kernelCodePrefetchOffset
kernel code prefetch offset
Definition: Commons.h:72
uint32_t workgroupGroupSegmentSize
workgroup group segment (local memory) size
Definition: Commons.h:80
cxbyte privateSegmentAlignment
private segment alignment
Definition: Commons.h:94
AMD HSA kernel configuration structure.
Definition: Commons.h:63
cxbyte kernargSegmentAlignment
kernel segment alignment
Definition: Commons.h:92
uint32_t gdsSegmentSize
GDS segment size.
Definition: Commons.h:81
uint16_t reservedSgprCount
reserved scalar register count
Definition: Commons.h:89
use kernel argument segment pointer
Definition: Commons.h:45
relocation that get low 32-bit of value
Definition: Commons.h:37
cxuint RelocType
relocation type
Definition: Commons.h:32
use privae segment buffer
Definition: Commons.h:42
cxbyte groupSegmentAlignment
group segment alignment
Definition: Commons.h:93
uint16_t enableFeatureFlags
bitfield of feature flags
Definition: Commons.h:78
relocation that get high 32-bit of value
Definition: Commons.h:38
znack enabled
Definition: Commons.h:59
uint32_t computePgmRsrc1
PGMRSRC1 register value.
Definition: Commons.h:75
uint32_t computePgmRsrc2
PGMRSRC2 register value.
Definition: Commons.h:76
main namespace
Definition: AsmDefs.h:38
debug enabled
Definition: Commons.h:58
use ordered append gds
Definition: Commons.h:55
uint32_t callConvention
call convention
Definition: Commons.h:96
uint16_t reservedSgprFirst
reserved first scalar register
Definition: Commons.h:88
uint16_t wavefrontSgprCount
scalar register count per wavefront
Definition: Commons.h:84
cxbyte controlDirective[128]
control directives area
Definition: Commons.h:99
uint16_t enableSgprRegisterFlags
bitfield of sg
Definition: Commons.h:77
uint16_t workitemVgprCount
vector register count per workitem
Definition: Commons.h:85
uint16_t amdMachineKind
architecture kind
Definition: Commons.h:67
use queue pointer
Definition: Commons.h:44
uint32_t amdCodeVersionMinor
AMD code version minor number.
Definition: Commons.h:66
use workgroup count for X dim
Definition: Commons.h:50
uint32_t reserved1[3]
reserved
Definition: Commons.h:97
relocation that get value
Definition: Commons.h:36
uint16_t amdMachineMajor
arch major number
Definition: Commons.h:68
use workgroup count for Z dim
Definition: Commons.h:52
uint16_t reservedVgprFirst
reserved first vector register
Definition: Commons.h:86
cxbyte wavefrontSize
wavefront size
Definition: Commons.h:95
uint64_t kernargSegmentSize
kernel argument segment size
Definition: Commons.h:82
uint64_t kernelCodeEntryOffset
kernel relative to this config to kernel code
Definition: Commons.h:71
uint16_t reservedVgprCount
reserved vector register count
Definition: Commons.h:87
uint32_t amdCodeVersionMajor
AMD code version major number.
Definition: Commons.h:65