CLRX  1
An unofficial OpenCL extensions designed for Radeon GPUs
AmdCL2Binaries.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_AMDCL2BINARIES_H__
24 #define __CLRX_AMDCL2BINARIES_H__
25 
26 #include <CLRX/Config.h>
27 #include <cstddef>
28 #include <cstdint>
29 #include <memory>
30 #include <string>
31 #include <CLRX/amdbin/Elf.h>
32 #include <CLRX/utils/MemAccess.h>
34 #include <CLRX/utils/Containers.h>
35 #include <CLRX/utils/Utilities.h>
36 #include <CLRX/utils/GPUId.h>
37 
39 namespace CLRX
40 {
41 
42 enum : Flags {
46 
50 };
51 
54 {
56  size_t setupSize;
57  cxbyte* setup;
58  size_t codeSize;
59  cxbyte* code;
60 };
61 
64 {
65  size_t size;
66  cxbyte* data;
67 };
68 
70 
73 {
74 public:
77 protected:
79  KernelDataMap kernelDataMap;
80 public:
81  virtual ~AmdCL2InnerGPUBinaryBase();
83  size_t getKernelsNum() const
84  { return kernels.size(); }
85 
87  const AmdCL2GPUKernel& getKernelData(size_t index) const
88  { return kernels[index]; }
89 
92  { return kernels[index]; }
93 
95  const AmdCL2GPUKernel& getKernelData(const char* name) const;
96 };
97 
101 {
102 private:
103  Flags creationFlags;
104  size_t binarySize;
105  cxbyte* binary;
106  std::unique_ptr<AmdCL2GPUKernelStub[]> kernelStubs;
107 public:
109  AmdCL2OldInnerGPUBinary() = default;
111 
117  template<typename Types>
118  AmdCL2OldInnerGPUBinary(ElfBinaryTemplate<Types>* mainBinary, size_t binaryCodeSize,
119  cxbyte* binaryCode, Flags creationFlags = AMDBIN_CREATE_ALL);
121  ~AmdCL2OldInnerGPUBinary() = default;
122 
124  size_t getSize() const
125  { return binarySize; }
127  const cxbyte* getBinaryCode() const
128  { return binary; }
130  cxbyte* getBinaryCode()
131  { return binary; }
132 
134  bool hasKernelData() const
135  { return creationFlags & AMDCL2BIN_CREATE_KERNELDATA; }
137  bool hasKernelDataMap() const
138  { return creationFlags & AMDCL2BIN_CREATE_KERNELDATAMAP; }
140  bool hasKernelStubs() const
141  { return creationFlags & AMDCL2BIN_CREATE_KERNELSTUBS; }
142 
144  const AmdCL2GPUKernelStub& getKernelStub(size_t index) const
145  { return kernelStubs[index]; }
146 
148  const AmdCL2GPUKernelStub& getKernelStub(const char* name) const;
149 };
150 
152 
156 {
157 private:
158  size_t globalDataSize;
159  cxbyte* globalData;
160  size_t rwDataSize;
161  cxbyte* rwData;
162  size_t bssAlignment;
163  size_t bssSize;
164  size_t samplerInitSize;
165  cxbyte* samplerInit;
166  size_t textRelsNum;
167  size_t textRelEntrySize;
168  cxbyte* textRela;
169  size_t globalDataRelsNum;
170  size_t globalDataRelEntrySize;
171  cxbyte* globalDataRela;
172 public:
174  AmdCL2InnerGPUBinary() = default;
176 
181  AmdCL2InnerGPUBinary(size_t binaryCodeSize, cxbyte* binaryCode,
182  Flags creationFlags = AMDBIN_CREATE_ALL);
184  ~AmdCL2InnerGPUBinary() = default;
185 
187  bool hasKernelData() const
188  { return creationFlags & AMDCL2BIN_CREATE_KERNELDATA; }
190  bool hasKernelDataMap() const
191  { return creationFlags & AMDCL2BIN_CREATE_KERNELDATAMAP; }
192 
194  size_t getGlobalDataSize() const
195  { return globalDataSize; }
196 
198  const cxbyte* getGlobalData() const
199  { return globalData; }
201  cxbyte* getGlobalData()
202  { return globalData; }
203 
205  size_t getRwDataSize() const
206  { return rwDataSize; }
207 
209  const cxbyte* getRwData() const
210  { return rwData; }
212  cxbyte* getRwData()
213  { return rwData; }
215  size_t getBssAlignment() const
216  { return bssAlignment; }
218  size_t getBssSize() const
219  { return bssSize; }
220 
222  size_t getSamplerInitSize() const
223  { return samplerInitSize; }
224 
226  const cxbyte* getSamplerInit() const
227  { return samplerInit; }
229  cxbyte* getSamplerInit()
230  { return samplerInit; }
231 
233  size_t getTextRelaEntriesNum() const
234  { return textRelsNum; }
236  const Elf64_Rela& getTextRelaEntry(size_t index) const
237  { return *reinterpret_cast<const Elf64_Rela*>(textRela + textRelEntrySize*index); }
240  { return *reinterpret_cast<Elf64_Rela*>(textRela + textRelEntrySize*index); }
241 
244  { return globalDataRelsNum; }
246  const Elf64_Rela& getGlobalDataRelaEntry(size_t index) const
247  { return *reinterpret_cast<const Elf64_Rela*>(globalDataRela +
248  globalDataRelEntrySize*index); }
251  { return *reinterpret_cast<Elf64_Rela*>(globalDataRela +
252  globalDataRelEntrySize*index); }
253 };
254 
257 {
259  size_t size;
260  cxbyte* data;
261 };
262 
265 {
266  uint32_t size;
267  uint32_t metadataSize;
268  uint32_t unknown1[3];
269  uint32_t options;
270  uint16_t kernelId;
271  uint16_t unknownx;
272  uint32_t unknowny;
273  uint64_t unknown2[2];
274  uint32_t reqdWorkGroupSize[3];
275  uint32_t unknown3[3];
276  uint32_t firstNameLength;
277  uint32_t secondNameLength;
278  uint32_t unknown4[3];
279  uint32_t pipesUsage;
280  uint32_t unknown5[2];
281  uint64_t argsNum;
282 };
283 
286 {
287  uint64_t size;
288  uint64_t metadataSize;
289  uint32_t unknown1[3];
290  uint32_t options;
291  uint16_t kernelId;
292  uint16_t unknownx;
293  uint32_t unknowny;
294  uint64_t unknown2[2];
295  uint64_t reqdWorkGroupSize[3];
296  uint64_t unknown3[2];
297  uint64_t firstNameLength;
298  uint64_t secondNameLength;
299  uint64_t unknown4[3];
300  uint64_t pipesUsage;
301  uint64_t unknown5[2];
302  uint64_t argsNum;
303 };
304 
307 {
308  uint32_t size;
309  uint32_t argNameSize;
310  uint32_t typeNameSize;
311  uint32_t unknown1, unknown2;
312  union {
313  uint32_t vectorLength;
314  uint32_t resId;
315  uint32_t structSize;
316  };
317  uint32_t unknown3;
318  uint32_t argOffset;
319  uint32_t argType;
320  uint32_t ptrAlignment;
321  uint32_t ptrType;
322  uint32_t ptrSpace;
323  uint32_t isPointerOrPipe;
324  cxbyte isVolatile;
325  cxbyte isRestrict;
326  cxbyte isPipe;
327  cxbyte unknown4;
328  uint32_t kindOfType;
329  uint32_t isConst;
330 };
331 
334 {
335  uint64_t size;
336  uint64_t argNameSize;
337  uint64_t typeNameSize;
338  uint64_t unknown1, unknown2;
339  union {
340  uint32_t vectorLength;
341  uint32_t resId;
342  uint32_t structSize;
343  };
344  uint32_t unknown3;
345  uint32_t argOffset;
346  uint32_t argType;
347  uint32_t ptrAlignment;
348  uint32_t ptrType;
349  uint32_t ptrSpace;
350  uint32_t isPointerOrPipe;
351  cxbyte isVolatile;
352  cxbyte isRestrict;
353  cxbyte isPipe;
354  cxbyte unknown4;
355  uint32_t kindOfType;
356  uint64_t isConst;
357 };
358 
361 {
362 public:
365 protected:
366  cxuint driverVersion;
367  size_t kernelsNum;
368  std::unique_ptr<AmdCL2GPUKernelMetadata[]> metadatas;
370  std::unique_ptr<AmdGPUKernelHeader[]> kernelHeaders;
371  MetadataMap isaMetadataMap;
372 
374  std::unique_ptr<AmdCL2InnerGPUBinaryBase> innerBinary;
375 
377  template<typename Types>
378  void initMainGPUBinary(typename Types::ElfBinary& elfBin);
379 
381  template<typename Types>
382  GPUDeviceType determineGPUDeviceTypeInt(const typename Types::ElfBinary& elfBin,
383  uint32_t& archMinor, uint32_t& archStepping, cxuint driverVersion) const;
384 
385 public:
387  explicit AmdCL2MainGPUBinaryBase(AmdMainType amdMainType);
389  ~AmdCL2MainGPUBinaryBase() = default;
390 
392  bool hasInnerBinary() const
393  { return innerBinary.get()!=nullptr; }
394 
396  cxuint getDriverVersion() const
397  { return driverVersion; }
398 
401  { return *innerBinary; }
402 
405  { return *innerBinary; }
406 
409  { return *static_cast<const AmdCL2InnerGPUBinary*>(innerBinary.get()); }
410 
413  { return *static_cast<AmdCL2InnerGPUBinary*>(innerBinary.get()); }
414 
417  { return *static_cast<const AmdCL2OldInnerGPUBinary*>(innerBinary.get()); }
418 
421  { return *static_cast<AmdCL2OldInnerGPUBinary*>(innerBinary.get()); }
422 
424  const AmdGPUKernelHeader& getKernelHeaderEntry(size_t index) const
425  { return kernelHeaders[index]; }
427  const AmdGPUKernelHeader& getKernelHeaderEntry(const char* name) const;
428 
430  size_t getISAMetadatasNum() const
431  { return isaMetadatas.size(); }
432 
434  const AmdCL2GPUKernelMetadata& getISAMetadataEntry(size_t index) const
435  { return isaMetadatas[index]; }
437  const AmdCL2GPUKernelMetadata& getISAMetadataEntry(const char* name) const;
438 
440  size_t getISAMetadataSize(size_t index) const
441  { return isaMetadatas[index].size; }
442 
444  const cxbyte* getISAMetadata(size_t index) const
445  { return isaMetadatas[index].data; }
446 
448  cxbyte* getISAMetadata(size_t index)
449  { return isaMetadatas[index].data; }
450 
452  const AmdCL2GPUKernelMetadata& getMetadataEntry(size_t index) const
453  { return metadatas[index]; }
455  const AmdCL2GPUKernelMetadata& getMetadataEntry(const char* name) const;
456 
458  size_t getMetadataSize(size_t index) const
459  { return metadatas[index].size; }
460 
462  const cxbyte* getMetadata(size_t index) const
463  { return metadatas[index].data; }
464 
466  cxbyte* getMetadata(size_t index)
467  { return metadatas[index].data; }
468 
471  { return aclVersionString; }
472 };
473 
475 
479 {
480 public:
482  AmdCL2MainGPUBinary32(size_t binaryCodeSize, cxbyte* binaryCode,
483  Flags creationFlags = AMDBIN_CREATE_ALL);
485  ~AmdCL2MainGPUBinary32() = default;
486 
488 
494  GPUDeviceType determineGPUDeviceType(uint32_t& archMinor, uint32_t& archStepping,
495  cxuint driverVersion = 0) const;
496 
498  bool hasKernelInfo() const
499  { return (creationFlags & AMDBIN_CREATE_KERNELINFO) != 0; }
500 
502  bool hasKernelInfoMap() const
503  { return (creationFlags & AMDBIN_CREATE_KERNELINFOMAP) != 0; }
504 
506  bool hasInfoStrings() const
507  { return (creationFlags & AMDBIN_CREATE_INFOSTRINGS) != 0; }
508 };
509 
511 
515 {
516 public:
518  AmdCL2MainGPUBinary64(size_t binaryCodeSize, cxbyte* binaryCode,
519  Flags creationFlags = AMDBIN_CREATE_ALL);
521  ~AmdCL2MainGPUBinary64() = default;
522 
524 
530  GPUDeviceType determineGPUDeviceType(uint32_t& archMinor, uint32_t& archStepping,
531  cxuint driverVersion = 0) const;
532 
534  bool hasKernelInfo() const
535  { return (creationFlags & AMDBIN_CREATE_KERNELINFO) != 0; }
536 
538  bool hasKernelInfoMap() const
539  { return (creationFlags & AMDBIN_CREATE_KERNELINFOMAP) != 0; }
540 
542  bool hasInfoStrings() const
543  { return (creationFlags & AMDBIN_CREATE_INFOSTRINGS) != 0; }
544 };
545 
547 
554  size_t binaryCodeSize, cxbyte* binaryCode,
555  Flags creationFlags = AMDBIN_CREATE_ALL);
556 
558 extern bool isAmdCL2Binary(size_t binarySize, const cxbyte* binary);
559 
560 };
561 
562 #endif
size_t codeSize
size
Definition: AmdCL2Binaries.h:58
const AmdCL2OldInnerGPUBinary & getOldInnerBinary() const
get old inner binary
Definition: AmdCL2Binaries.h:416
bool hasKernelData() const
return if binary has kernel datas
Definition: AmdCL2Binaries.h:134
uint64_t firstNameLength
first name length
Definition: AmdCL2Binaries.h:297
uint32_t kindOfType
kind of type
Definition: AmdCL2Binaries.h:355
cxbyte isPipe
if pipe
Definition: AmdCL2Binaries.h:326
non copyable and non movable base structure (class)
Definition: Utilities.h:43
const cxbyte * getRwData() const
get readwrite atomic data
Definition: AmdCL2Binaries.h:209
ELF binary class.
Definition: ElfBinaries.h:121
AmdCL2MainGPUBinaryBase * createAmdCL2BinaryFromCode(size_t binaryCodeSize, cxbyte *binaryCode, Flags creationFlags=AMDBIN_CREATE_ALL)
create AMD binary object from binary code
uint32_t Flags
type for declaring various flags
Definition: Utilities.h:97
std::unique_ptr< AmdCL2GPUKernelMetadata[]> metadatas
AMD metadatas.
Definition: AmdCL2Binaries.h:368
size_t getTextRelaEntriesNum() const
get text rel entries number
Definition: AmdCL2Binaries.h:233
AMD GPU header for kernel.
Definition: AmdBinaries.h:462
uint32_t ptrType
pointer type
Definition: AmdCL2Binaries.h:348
cxbyte * code
data
Definition: AmdCL2Binaries.h:59
create kernel stub
Definition: AmdCL2Binaries.h:45
Array< std::pair< CString, size_t > > KernelDataMap
inner binary map type
Definition: AmdCL2Binaries.h:76
uint32_t ptrAlignment
pointer alignment
Definition: AmdCL2Binaries.h:347
uint32_t argNameSize
argument name size
Definition: AmdCL2Binaries.h:309
size_t getSize() const
return binary size
Definition: AmdCL2Binaries.h:124
cxbyte isPipe
if pipe
Definition: AmdCL2Binaries.h:353
const AmdCL2InnerGPUBinaryBase & getInnerBinaryBase() const
get inner binary base
Definition: AmdCL2Binaries.h:400
cxuint getDriverVersion() const
get driver version
Definition: AmdCL2Binaries.h:396
AMD OpenCL 2.0 main binary for GPU for 32-bit mode.
Definition: AmdCL2Binaries.h:478
cxbyte isRestrict
if pointer is restrict
Definition: AmdCL2Binaries.h:352
uint32_t secondNameLength
second name length
Definition: AmdCL2Binaries.h:277
uint16_t kernelId
kernel id
Definition: AmdCL2Binaries.h:291
GPU kernel argument entry.
Definition: AmdCL2Binaries.h:333
uint64_t isConst
is const pointer
Definition: AmdCL2Binaries.h:356
cxbyte * getBinaryCode()
return binary code
Definition: AmdCL2Binaries.h:130
uint32_t ptrSpace
pointer space
Definition: AmdCL2Binaries.h:349
uint64_t secondNameLength
second name length
Definition: AmdCL2Binaries.h:298
size_t getGlobalDataRelaEntriesNum() const
get global data rel entries number
Definition: AmdCL2Binaries.h:243
class ElfBinaryTemplate< Elf64Types > ElfBinary64
type for 64-bit ELF binary
Definition: ElfBinaries.h:437
Array< AmdCL2GPUKernel > kernels
kernel headers
Definition: AmdCL2Binaries.h:78
GPU kernel argument entry.
Definition: AmdCL2Binaries.h:306
cxbyte * getGlobalData()
get global data
Definition: AmdCL2Binaries.h:201
CString kernelName
kernel name
Definition: AmdCL2Binaries.h:258
Elf64_Rela & getTextRelaEntry(size_t index)
get text rela entry
Definition: AmdCL2Binaries.h:239
header for metadata
Definition: AmdCL2Binaries.h:285
const Elf64_Rela & getTextRelaEntry(size_t index) const
get text rela entry
Definition: AmdCL2Binaries.h:236
size_t getISAMetadataSize(size_t index) const
get ISA metadata size for specified inner binary
Definition: AmdCL2Binaries.h:440
an array class
Definition: Containers.h:38
const AmdCL2GPUKernelStub & getKernelStub(size_t index) const
get kernel stub for specified index
Definition: AmdCL2Binaries.h:144
AmdMainType
AMD main binary type.
Definition: AmdBinaries.h:397
uint64_t typeNameSize
type name size
Definition: AmdCL2Binaries.h:337
uint32_t size
entry size
Definition: AmdCL2Binaries.h:308
size_t getBssSize() const
get bss section&#39;s size
Definition: AmdCL2Binaries.h:218
size_t getBssAlignment() const
get bss alignment
Definition: AmdCL2Binaries.h:215
cxbyte isVolatile
nonzero if pointer or pipe
Definition: AmdCL2Binaries.h:351
AMD OpenCL 2.0 GPU kernel stub.
Definition: AmdCL2Binaries.h:63
Definition: Elf.h:458
const cxbyte * getBinaryCode() const
return binary code
Definition: AmdCL2Binaries.h:127
const cxbyte * getISAMetadata(size_t index) const
get ISA metadata for specified inner binary
Definition: AmdCL2Binaries.h:444
size_t getKernelsNum() const
get kernels number
Definition: AmdCL2Binaries.h:83
bool isAmdCL2Binary(size_t binarySize, const cxbyte *binary)
check whether is Amd OpenCL 2.0 binary
bool hasKernelInfoMap() const
returns true if binary has kernel informations map
Definition: AmdCL2Binaries.h:538
uint32_t resId
resource id
Definition: AmdCL2Binaries.h:341
cxbyte * getISAMetadata(size_t index)
get ISA metadata for specified inner binary
Definition: AmdCL2Binaries.h:448
size_t getISAMetadatasNum() const
get number of ISA metadatas
Definition: AmdCL2Binaries.h:430
Array< AmdCL2GPUKernelMetadata > isaMetadatas
AMD metadatas.
Definition: AmdCL2Binaries.h:369
create kernel setup
Definition: AmdCL2Binaries.h:47
all AMD binaries creation flags
Definition: AmdBinaries.h:59
AmdCL2GPUKernel & getKernelData(size_t index)
get kernel data for specified index
Definition: AmdCL2Binaries.h:91
uint64_t size
size
Definition: AmdCL2Binaries.h:287
const CString & getAclVersionString() const
get acl version string
Definition: AmdCL2Binaries.h:470
uint32_t argOffset
virtual argument offset
Definition: AmdCL2Binaries.h:345
AMD binaries handling.
uint32_t kindOfType
kind of type
Definition: AmdCL2Binaries.h:328
size_t getMetadataSize(size_t index) const
get metadata size for specified inner binary
Definition: AmdCL2Binaries.h:458
cxbyte isVolatile
nonzero if pointer or pipe
Definition: AmdCL2Binaries.h:324
main namespace
Definition: AsmDefs.h:38
cxbyte * data
setup data
Definition: AmdCL2Binaries.h:66
create kernel informations
Definition: AmdBinaries.h:47
create kernel setups map
Definition: AmdCL2Binaries.h:48
create compile options and driver info
Definition: AmdBinaries.h:50
const cxbyte * getGlobalData() const
get global data
Definition: AmdCL2Binaries.h:198
const AmdCL2InnerGPUBinary & getInnerBinary() const
get inner binary
Definition: AmdCL2Binaries.h:408
create kernel stub
Definition: AmdCL2Binaries.h:49
uint32_t ptrSpace
pointer space
Definition: AmdCL2Binaries.h:322
uint64_t argNameSize
argument name size
Definition: AmdCL2Binaries.h:336
create kernel setup
Definition: AmdCL2Binaries.h:43
uint32_t size
size
Definition: AmdCL2Binaries.h:266
bool hasInnerBinary() const
returns true if inner binary exists
Definition: AmdCL2Binaries.h:392
uint32_t argType
argument type
Definition: AmdCL2Binaries.h:346
std::unique_ptr< AmdGPUKernelHeader[]> kernelHeaders
kernel headers
Definition: AmdCL2Binaries.h:370
const AmdCL2GPUKernelMetadata & getISAMetadataEntry(size_t index) const
get kernel ISA metadata by kernel index
Definition: AmdCL2Binaries.h:434
main AMD binary base class
Definition: AmdBinaries.h:408
AMD OpenCL 2.0 GPU metadata for kernel.
Definition: AmdCL2Binaries.h:53
inlines for accessing memory words in LittleEndian and unaligned
uint32_t resId
resource id
Definition: AmdCL2Binaries.h:314
cxuint driverVersion
driver version
Definition: AmdCL2Binaries.h:366
uint32_t firstNameLength
first name length
Definition: AmdCL2Binaries.h:276
uint32_t typeNameSize
type name size
Definition: AmdCL2Binaries.h:310
MetadataMap isaMetadataMap
ISA metadata map.
Definition: AmdCL2Binaries.h:371
uint32_t argType
argument type
Definition: AmdCL2Binaries.h:319
GPUDeviceType
type of GPU device
Definition: GPUId.h:38
size_t getGlobalDataSize() const
get global data size
Definition: AmdCL2Binaries.h:194
bool hasKernelDataMap() const
return if binary has kernel datas map
Definition: AmdCL2Binaries.h:137
AmdCL2OldInnerGPUBinary & getOldInnerBinary()
get old inner binary
Definition: AmdCL2Binaries.h:420
const AmdCL2GPUKernelMetadata & getMetadataEntry(size_t index) const
get kernel metadata by index
Definition: AmdCL2Binaries.h:452
AmdCL2InnerGPUBinary & getInnerBinary()
get inner binary
Definition: AmdCL2Binaries.h:412
cxbyte * data
data
Definition: AmdCL2Binaries.h:260
uint32_t vectorLength
vector length (for old drivers not aligned)
Definition: AmdCL2Binaries.h:340
const AmdGPUKernelHeader & getKernelHeaderEntry(size_t index) const
get kernel header for specified index
Definition: AmdCL2Binaries.h:424
size_t size
size
Definition: AmdCL2Binaries.h:259
AmdCL2InnerGPUBinaryBase & getInnerBinaryBase()
get inner binary base
Definition: AmdCL2Binaries.h:404
bool hasKernelInfo() const
returns true if binary has kernel informations
Definition: AmdCL2Binaries.h:534
bool hasKernelDataMap() const
return if binary has kernel datas map
Definition: AmdCL2Binaries.h:190
AMD OpenCL 2.0 inner binary for GPU binaries that represent a single kernel.
Definition: AmdCL2Binaries.h:155
cxbyte isRestrict
if pointer is restrict
Definition: AmdCL2Binaries.h:325
KernelDataMap kernelDataMap
kernel data map
Definition: AmdCL2Binaries.h:79
utilities for other libraries and programs
CString aclVersionString
acl version string
Definition: AmdCL2Binaries.h:373
const AmdCL2GPUKernel & getKernelData(size_t index) const
get kernel data for specified index
Definition: AmdCL2Binaries.h:87
size_t size
setup size
Definition: AmdCL2Binaries.h:65
size_t getSamplerInitSize() const
get global data size
Definition: AmdCL2Binaries.h:222
uint32_t ptrType
pointer type
Definition: AmdCL2Binaries.h:321
uint64_t argsNum
number of arguments
Definition: AmdCL2Binaries.h:281
AMD OpenCL 2.0 old inner binary for GPU binaries that represent a single kernel.
Definition: AmdCL2Binaries.h:99
GPU identification utilities.
bool hasKernelStubs() const
return if binary has kernel stubs
Definition: AmdCL2Binaries.h:140
const cxbyte * getMetadata(size_t index) const
get metadata for specified inner binary
Definition: AmdCL2Binaries.h:462
Elf64_Rela & getGlobalDataRelaEntry(size_t index)
get global data rela entry
Definition: AmdCL2Binaries.h:250
cxbyte * getMetadata(size_t index)
get metadata for specified inner binary
Definition: AmdCL2Binaries.h:466
size_t size() const
returns number of elements
Definition: Containers.h:169
uint16_t kernelId
kernel id
Definition: AmdCL2Binaries.h:270
uint32_t ptrAlignment
pointer alignment
Definition: AmdCL2Binaries.h:320
size_t kernelsNum
kernels number
Definition: AmdCL2Binaries.h:367
const T * data() const
get data
Definition: Containers.h:242
bool hasInfoStrings() const
returns true if binary has info strings
Definition: AmdCL2Binaries.h:506
uint32_t isConst
is const pointer
Definition: AmdCL2Binaries.h:329
bool hasInfoStrings() const
returns true if binary has info strings
Definition: AmdCL2Binaries.h:542
size_t setupSize
setup size
Definition: AmdCL2Binaries.h:56
class ElfBinaryTemplate< Elf32Types > ElfBinary32
type for 32-bit ELF binary
Definition: ElfBinaries.h:435
const Elf64_Rela & getGlobalDataRelaEntry(size_t index) const
get global data rela entry
Definition: AmdCL2Binaries.h:246
bool hasKernelInfo() const
returns true if binary has kernel informations
Definition: AmdCL2Binaries.h:498
CString kernelName
kernel name
Definition: AmdCL2Binaries.h:55
uint64_t size
entry size
Definition: AmdCL2Binaries.h:335
const cxbyte * getSamplerInit() const
get global data
Definition: AmdCL2Binaries.h:226
bool hasKernelInfoMap() const
returns true if binary has kernel informations map
Definition: AmdCL2Binaries.h:502
cxbyte * setup
setup data
Definition: AmdCL2Binaries.h:57
header for metadata
Definition: AmdCL2Binaries.h:264
size_t getRwDataSize() const
get readwrite global data size
Definition: AmdCL2Binaries.h:205
cxbyte * getRwData()
get readwrite atomic data
Definition: AmdCL2Binaries.h:212
Array< std::pair< CString, size_t > > MetadataMap
type definition of metadata map
Definition: AmdCL2Binaries.h:364
AMD OpenCL 2.0 main binary for GPU for 64-bit mode.
Definition: AmdCL2Binaries.h:514
uint64_t argsNum
number of arguments
Definition: AmdCL2Binaries.h:302
create map of kernel informations
Definition: AmdBinaries.h:48
create kernel setups map
Definition: AmdCL2Binaries.h:44
base class of AMD OpenCL 2.0 binaries
Definition: AmdCL2Binaries.h:360
uint32_t vectorLength
vector length (for old drivers not aligned)
Definition: AmdCL2Binaries.h:313
simple C-string container
Definition: CString.h:38
containers and other utils for other libraries and programs
AMD OpenCL 2.0 inner binary base class.
Definition: AmdCL2Binaries.h:72
std::unique_ptr< AmdCL2InnerGPUBinaryBase > innerBinary
inner binary pointer
Definition: AmdCL2Binaries.h:374
uint32_t argOffset
virtual argument offset
Definition: AmdCL2Binaries.h:318
cxbyte * getSamplerInit()
get global data
Definition: AmdCL2Binaries.h:229
AMD OpenCL 2.0 GPU metadata for kernel.
Definition: AmdCL2Binaries.h:256
bool hasKernelData() const
return if binary has kernel datas
Definition: AmdCL2Binaries.h:187