source: CLRX/CLRadeonExtender/trunk/utils/GPUId.cpp @ 3733

Last change on this file since 3733 was 3733, checked in by matszpk, 3 years ago

CLRadeonExtender: Small formatting. replace '.cws' by '.reqd_work_group_size' in dumping ROCm metadata.

File size: 17.1 KB
Line 
1/*
2 *  CLRadeonExtender - Unofficial OpenCL Radeon Extensions Library
3 *  Copyright (C) 2014-2018 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 */
19
20#include <CLRX/Config.h>
21#include <cstring>
22#include <utility>
23#include <cstdint>
24#include <climits>
25#include <CLRX/utils/Utilities.h>
26#include <CLRX/utils/GPUId.h>
27
28using namespace CLRX;
29
30GPUIdException::GPUIdException(const std::string& message) : Exception(message)
31{ }
32
33// length of GPU device table (number of recognized GPU devices)
34static const size_t gpuDeviceTableSize = 28;
35
36static const char* gpuDeviceNameTable[gpuDeviceTableSize] =
37{
38    "CapeVerde",
39    "Pitcairn",
40    "Tahiti",
41    "Oland",
42    "Bonaire",
43    "Spectre",
44    "Spooky",
45    "Kalindi",
46    "Hainan",
47    "Hawaii",
48    "Iceland",
49    "Tonga",
50    "Mullins",
51    "Fiji",
52    "Carrizo",
53    "Dummy",
54    "Goose",
55    "Horse",
56    "Stoney",
57    "Ellesmere",
58    "Baffin",
59    "GFX804",
60    "GFX900",
61    "GFX901",
62    "GFX902",
63    "GFX903",
64    "GFX904",
65    "GFX905"
66};
67
68// sorted GPU device names with device types
69static const std::pair<const char*, GPUDeviceType>
70lowerCaseGpuDeviceEntryTable[] =
71{
72    { "baffin", GPUDeviceType::BAFFIN },
73    { "bonaire", GPUDeviceType::BONAIRE },
74    { "capeverde", GPUDeviceType::CAPE_VERDE },
75    { "carrizo", GPUDeviceType::CARRIZO },
76    { "dummy", GPUDeviceType::DUMMY },
77    { "ellesmere", GPUDeviceType::ELLESMERE },
78    { "fiji", GPUDeviceType::FIJI },
79    { "gfx700", GPUDeviceType::SPECTRE },
80    { "gfx701", GPUDeviceType::HAWAII },
81    { "gfx801", GPUDeviceType::CARRIZO },
82    { "gfx802", GPUDeviceType::TONGA },
83    { "gfx803", GPUDeviceType::FIJI },
84    { "gfx804", GPUDeviceType::GFX804 },
85    { "gfx900", GPUDeviceType::GFX900 },
86    { "gfx901", GPUDeviceType::GFX901 },
87    { "gfx902", GPUDeviceType::GFX902 },
88    { "gfx903", GPUDeviceType::GFX903 },
89    { "gfx904", GPUDeviceType::GFX904 },
90    { "gfx905", GPUDeviceType::GFX905 },
91    { "goose", GPUDeviceType::GOOSE },
92    { "hainan", GPUDeviceType::HAINAN },
93    { "hawaii", GPUDeviceType::HAWAII },
94    { "horse", GPUDeviceType::HORSE },
95    { "iceland", GPUDeviceType::ICELAND },
96    { "kalindi", GPUDeviceType::KALINDI },
97    { "mullins", GPUDeviceType::MULLINS },
98    { "oland", GPUDeviceType::OLAND },
99    { "pitcairn", GPUDeviceType::PITCAIRN },
100    { "polaris10", GPUDeviceType::ELLESMERE },
101    { "polaris11", GPUDeviceType::BAFFIN },
102    { "polaris12", GPUDeviceType::GFX804 },
103    { "polaris20", GPUDeviceType::ELLESMERE },
104    { "polaris21", GPUDeviceType::BAFFIN },
105    { "polaris22", GPUDeviceType::GFX804 },
106    { "raven", GPUDeviceType::GFX903 },
107    { "spectre", GPUDeviceType::SPECTRE },
108    { "spooky", GPUDeviceType::SPOOKY },
109    { "stoney", GPUDeviceType::STONEY },
110    { "tahiti", GPUDeviceType::TAHITI },
111    { "tonga", GPUDeviceType::TONGA },
112    { "topaz", GPUDeviceType::ICELAND },
113    { "vega10", GPUDeviceType::GFX900 },
114    { "vega11", GPUDeviceType::GFX901 }
115};
116
117static const size_t lowerCaseGpuDeviceEntryTableSize =
118    sizeof(lowerCaseGpuDeviceEntryTable) / sizeof(std::pair<const char*, GPUDeviceType>);
119
120// table of architectures for specific GPU devices
121static const GPUArchitecture gpuDeviceArchTable[gpuDeviceTableSize] =
122{
123    GPUArchitecture::GCN1_0, // CapeVerde
124    GPUArchitecture::GCN1_0, // Pitcairn
125    GPUArchitecture::GCN1_0, // Tahiti
126    GPUArchitecture::GCN1_0, // Oland
127    GPUArchitecture::GCN1_1, // Bonaire
128    GPUArchitecture::GCN1_1, // Spectre
129    GPUArchitecture::GCN1_1, // Spooky
130    GPUArchitecture::GCN1_1, // Kalindi
131    GPUArchitecture::GCN1_0, // Hainan
132    GPUArchitecture::GCN1_1, // Hawaii
133    GPUArchitecture::GCN1_2, // Iceland
134    GPUArchitecture::GCN1_2, // Tonga
135    GPUArchitecture::GCN1_1, // Mullins
136    GPUArchitecture::GCN1_2, // Fiji
137    GPUArchitecture::GCN1_2, // Carrizo
138    GPUArchitecture::GCN1_2, // Dummy
139    GPUArchitecture::GCN1_2, // Goose
140    GPUArchitecture::GCN1_2, // Horse
141    GPUArchitecture::GCN1_2, // Stoney
142    GPUArchitecture::GCN1_2, // Ellesmere
143    GPUArchitecture::GCN1_2, // Baffin
144    GPUArchitecture::GCN1_2, // GFX804
145    GPUArchitecture::GCN1_4, // GFX900
146    GPUArchitecture::GCN1_4, // GFX901
147    GPUArchitecture::GCN1_4, // GFX902
148    GPUArchitecture::GCN1_4, // GFX903
149    GPUArchitecture::GCN1_4, // GFX904
150    GPUArchitecture::GCN1_4  // GFX905
151};
152
153static const char* gpuArchitectureNameTable[4] =
154{
155    "GCN1.0",
156    "GCN1.1",
157    "GCN1.2",
158    "GCN1.4"
159};
160
161/* three names for every architecture (GCN, GFX?, Shortcut) used by recognizing
162 * architecture by name */
163static const char* gpuArchitectureNameTable2[12] =
164{
165    "GCN1.0", "GFX6", "SI",
166    "GCN1.1", "GFX7", "CI",
167    "GCN1.2", "GFX8", "VI",
168    "GCN1.4", "GFX9", "Vega"
169};
170
171/// lowest device for architecture
172static const GPUDeviceType gpuLowestDeviceFromArchTable[4] =
173{
174    GPUDeviceType::CAPE_VERDE,
175    GPUDeviceType::BONAIRE,
176    GPUDeviceType::ICELAND,
177    GPUDeviceType::GFX900
178};
179
180GPUDeviceType CLRX::getGPUDeviceTypeFromName(const char* name)
181{
182    auto it = binaryMapFind(lowerCaseGpuDeviceEntryTable,
183                 lowerCaseGpuDeviceEntryTable+lowerCaseGpuDeviceEntryTableSize,
184                 name, CStringCaseLess());
185    if (it == lowerCaseGpuDeviceEntryTable+lowerCaseGpuDeviceEntryTableSize)
186        throw GPUIdException("Unknown GPU device type");
187    return it->second;
188}
189
190GPUArchitecture CLRX::getGPUArchitectureFromName(const char* name)
191{
192    cxuint found = 0;
193    for (; found < sizeof gpuArchitectureNameTable2 /
194                sizeof(const char*); found++)
195        if (::strcasecmp(name, gpuArchitectureNameTable2[found]) == 0)
196            break;
197    if (found == sizeof(gpuArchitectureNameTable2) / sizeof(const char*))
198        throw GPUIdException("Unknown GPU architecture");
199    return GPUArchitecture(found/3);
200}
201
202GPUArchitecture CLRX::getGPUArchitectureFromDeviceType(GPUDeviceType deviceType)
203{
204    if (deviceType > GPUDeviceType::GPUDEVICE_MAX)
205        throw GPUIdException("Unknown GPU device type");
206    return gpuDeviceArchTable[cxuint(deviceType)];
207}
208
209GPUDeviceType CLRX::getLowestGPUDeviceTypeFromArchitecture(GPUArchitecture architecture)
210{
211    if (architecture > GPUArchitecture::GPUARCH_MAX)
212        throw GPUIdException("Unknown GPU architecture");
213    return gpuLowestDeviceFromArchTable[cxuint(architecture)];
214}
215
216const char* CLRX::getGPUDeviceTypeName(GPUDeviceType deviceType)
217{
218    if (deviceType > GPUDeviceType::GPUDEVICE_MAX)
219        throw GPUIdException("Unknown GPU device type");
220    return gpuDeviceNameTable[cxuint(deviceType)];
221}
222
223const char* CLRX::getGPUArchitectureName(GPUArchitecture architecture)
224{
225    if (architecture > GPUArchitecture::GPUARCH_MAX)
226        throw GPUIdException("Unknown GPU architecture");
227    return gpuArchitectureNameTable[cxuint(architecture)];
228}
229
230cxuint CLRX::getGPUMaxRegistersNum(GPUArchitecture architecture, cxuint regType,
231                         Flags flags)
232{
233    if (architecture > GPUArchitecture::GPUARCH_MAX)
234        throw GPUIdException("Unknown GPU architecture");
235    if (regType == REGTYPE_VGPR)
236        return 256; // VGPRS
237    cxuint maxSgprs = (architecture>=GPUArchitecture::GCN1_2) ? 102 : 104;
238    // subtract from max SGPRs num number of special registers (VCC, ...)
239    if ((flags & REGCOUNT_NO_FLAT)!=0 && (architecture>GPUArchitecture::GCN1_0))
240        maxSgprs -= (architecture>=GPUArchitecture::GCN1_2) ? 6 : 4;
241    else if ((flags & REGCOUNT_NO_XNACK)!=0 && (architecture>GPUArchitecture::GCN1_1))
242        maxSgprs -= 4;
243    else if ((flags & REGCOUNT_NO_VCC)!=0)
244        maxSgprs -= 2;
245    return maxSgprs;
246}
247
248cxuint CLRX::getGPUMaxRegsNumByArchMask(uint16_t archMask, cxuint regType)
249{
250    if (regType == REGTYPE_VGPR)
251        return 256;
252    else
253        return (archMask&(7U<<int(GPUArchitecture::GCN1_2))) ? 102 : 104;
254}
255
256void CLRX::getGPUSetupMinRegistersNum(GPUArchitecture architecture, cxuint dimMask,
257              cxuint userDataNum, Flags flags, cxuint* gprsOut)
258{
259    /// SGPRs
260    gprsOut[0] = ((dimMask&1)!=0) + ((dimMask&2)!=0) + ((dimMask&4)!=0);
261    /// VGPRS
262    gprsOut[1] = ((dimMask&4) ? 3 : ((dimMask&2) ? 2: (dimMask&1) ? 1 : 0));
263    gprsOut[0] += userDataNum + ((flags & GPUSETUP_TGSIZE_EN)!=0) +
264            ((flags & GPUSETUP_SCRATCH_EN)!=0);
265}
266
267size_t CLRX::getGPUMaxLocalSize(GPUArchitecture architecture)
268{
269    return 32768;
270}
271
272size_t CLRX::getGPUMaxGDSSize(GPUArchitecture architecture)
273{
274    return 65536;
275}
276
277// get extra (special) registers depends on architectures and flags
278cxuint CLRX::getGPUExtraRegsNum(GPUArchitecture architecture, cxuint regType, Flags flags)
279{
280    if (regType == REGTYPE_VGPR)
281        return 0;
282    if ((flags & GCN_FLAT)!=0 && (architecture>GPUArchitecture::GCN1_0))
283        return (architecture>=GPUArchitecture::GCN1_2) ? 6 : 4;
284    else if ((flags & GCN_XNACK)!=0 && (architecture>GPUArchitecture::GCN1_1))
285        return 4;
286    else if ((flags & GCN_VCC)!=0)
287        return 2;
288    return 0;
289}
290
291uint32_t CLRX::calculatePgmRSrc1(GPUArchitecture arch, cxuint vgprsNum, cxuint sgprsNum,
292            cxuint priority, cxuint floatMode, bool privMode, bool dx10Clamp,
293            bool debugMode, bool ieeeMode)
294{
295    return ((vgprsNum-1)>>2) | (((sgprsNum-1)>>3)<<6) |
296            ((uint32_t(floatMode)&0xff)<<12) |
297            (ieeeMode?1U<<23:0) | (uint32_t(priority&3)<<10) |
298            (privMode?1U<<20:0) | (dx10Clamp?1U<<21:0) |
299            (debugMode?1U<<22:0);
300}
301
302uint32_t CLRX::calculatePgmRSrc2(GPUArchitecture arch, bool scratchEn, cxuint userDataNum,
303            bool trapPresent, cxuint dimMask, cxuint defDimValues, bool tgSizeEn,
304            cxuint ldsSize, cxuint exceptions)
305{
306    // GCN1.1 and later have 512 byte banks instead 256
307    const cxuint ldsShift = arch<GPUArchitecture::GCN1_1 ? 8 : 9;
308    const uint32_t ldsMask = (1U<<ldsShift)-1U;
309    uint32_t dimValues = 0;
310    // calculate dimMask (TGID_X_EN, ..., TIDIG_COMP_CNT fields)
311    if (dimMask != UINT_MAX)
312        dimValues = ((dimMask&7)<<7) | (((dimMask&4) ? 2 : (dimMask&2) ? 1 : 0)<<11);
313    else // use default value for dimensions
314        dimValues = defDimValues;
315    return uint32_t(scratchEn ? 1U : 0U) | (uint32_t(userDataNum)<<1) |
316            dimValues | (tgSizeEn ? 0x400U : 0U) | (trapPresent ? 0x40U : 0U) |
317            (((uint32_t(ldsSize+ldsMask)>>ldsShift)&0x1ff)<<15) |
318            ((uint32_t(exceptions)&0x7f)<<24);
319}
320
321// AMD GPU architecture for Gallium
322static const AMDGPUArchVersion galliumGpuArchVersionTbl[] =
323{
324    { 0, 0, 0 }, // GPUDeviceType::CAPE_VERDE
325    { 0, 0, 0 }, // GPUDeviceType::PITCAIRN
326    { 0, 0, 0 }, // GPUDeviceType::TAHITI
327    { 0, 0, 0 }, // GPUDeviceType::OLAND
328    { 7, 0, 0 }, // GPUDeviceType::BONAIRE
329    { 7, 0, 0 }, // GPUDeviceType::SPECTRE
330    { 7, 0, 0 }, // GPUDeviceType::SPOOKY
331    { 7, 0, 0 }, // GPUDeviceType::KALINDI
332    { 0, 0, 0 }, // GPUDeviceType::HAINAN
333    { 7, 0, 1 }, // GPUDeviceType::HAWAII
334    { 8, 0, 0 }, // GPUDeviceType::ICELAND
335    { 8, 0, 0 }, // GPUDeviceType::TONGA
336    { 7, 0, 0 }, // GPUDeviceType::MULLINS
337    { 8, 0, 3 }, // GPUDeviceType::FIJI
338    { 8, 0, 1 }, // GPUDeviceType::CARRIZO
339    { 8, 0, 1 }, // GPUDeviceType::DUMMY
340    { 8, 0, 4 }, // GPUDeviceType::GOOSE
341    { 8, 0, 4 }, // GPUDeviceType::HORSE
342    { 8, 0, 1 }, // GPUDeviceType::STONEY
343    { 8, 0, 4 }, // GPUDeviceType::ELLESMERE
344    { 8, 0, 4 }, // GPUDeviceType::BAFFIN
345    { 8, 0, 4 }, // GPUDeviceType::GFX804
346    { 9, 0, 0 }, // GPUDeviceType::GFX900
347    { 9, 0, 1 }, // GPUDeviceType::GFX901
348    { 9, 0, 2 }, // GPUDeviceType::GFX902
349    { 9, 0, 3 }, // GPUDeviceType::GFX903
350    { 9, 0, 4 }, // GPUDeviceType::GFX904
351    { 9, 0, 5 }  // GPUDeviceType::GFX905
352};
353
354// AMD GPU architecture for ROCm
355static const AMDGPUArchVersion rocmGpuArchVersionTbl[] =
356{
357    { 0, 0, 0 }, // GPUDeviceType::CAPE_VERDE
358    { 0, 0, 0 }, // GPUDeviceType::PITCAIRN
359    { 0, 0, 0 }, // GPUDeviceType::TAHITI
360    { 0, 0, 0 }, // GPUDeviceType::OLAND
361    { 7, 0, 0 }, // GPUDeviceType::BONAIRE
362    { 7, 0, 0 }, // GPUDeviceType::SPECTRE
363    { 7, 0, 0 }, // GPUDeviceType::SPOOKY
364    { 7, 0, 0 }, // GPUDeviceType::KALINDI
365    { 0, 0, 0 }, // GPUDeviceType::HAINAN
366    { 7, 0, 1 }, // GPUDeviceType::HAWAII
367    { 8, 0, 0 }, // GPUDeviceType::ICELAND
368    { 8, 0, 2 }, // GPUDeviceType::TONGA
369    { 7, 0, 0 }, // GPUDeviceType::MULLINS
370    { 8, 0, 3 }, // GPUDeviceType::FIJI
371    { 8, 0, 1 }, // GPUDeviceType::CARRIZO
372    { 8, 0, 1 }, // GPUDeviceType::DUMMY
373    { 8, 0, 3 }, // GPUDeviceType::GOOSE
374    { 8, 0, 3 }, // GPUDeviceType::HORSE
375    { 8, 1, 0 }, // GPUDeviceType::STONEY
376    { 8, 0, 3 }, // GPUDeviceType::ELLESMERE
377    { 8, 0, 3 }, // GPUDeviceType::BAFFIN
378    { 8, 0, 4 }, // GPUDeviceType::GFX804
379    { 9, 0, 0 }, // GPUDeviceType::GFX900
380    { 9, 0, 1 }, // GPUDeviceType::GFX901
381    { 9, 0, 2 }, // GPUDeviceType::GFX902
382    { 9, 0, 3 }, // GPUDeviceType::GFX903
383    { 9, 0, 4 }, // GPUDeviceType::GFX904
384    { 9, 0, 5 }  // GPUDeviceType::GFX905
385};
386
387// AMDGPU architecture values for specific GPU device type for AMDOCL 2.0
388static const AMDGPUArchVersion amdCL2GpuArchVersionTbl[] =
389{
390    { 0, 0, 0 }, // GPUDeviceType::CAPE_VERDE
391    { 0, 0, 0 }, // GPUDeviceType::PITCAIRN
392    { 0, 0, 0 }, // GPUDeviceType::TAHITI
393    { 0, 0, 0 }, // GPUDeviceType::OLAND
394    { 7, 0, 0 }, // GPUDeviceType::BONAIRE
395    { 7, 0, 0 }, // GPUDeviceType::SPECTRE
396    { 7, 0, 0 }, // GPUDeviceType::SPOOKY
397    { 7, 0, 0 }, // GPUDeviceType::KALINDI
398    { 0, 0, 0 }, // GPUDeviceType::HAINAN
399    { 7, 0, 1 }, // GPUDeviceType::HAWAII
400    { 8, 0, 0 }, // GPUDeviceType::ICELAND
401    { 8, 0, 0 }, // GPUDeviceType::TONGA
402    { 7, 0, 0 }, // GPUDeviceType::MULLINS
403    { 8, 0, 4 }, // GPUDeviceType::FIJI
404    { 8, 0, 1 }, // GPUDeviceType::CARRIZO
405    { 8, 0, 1 }, // GPUDeviceType::DUMMY
406    { 8, 0, 4 }, // GPUDeviceType::GOOSE
407    { 8, 0, 4 }, // GPUDeviceType::HORSE
408    { 8, 1, 0 }, // GPUDeviceType::STONEY
409    { 8, 0, 4 }, // GPUDeviceType::ELLESMERE
410    { 8, 0, 4 }, // GPUDeviceType::BAFFIN
411    { 8, 0, 4 }, // GPUDeviceType::GFX804
412    { 9, 0, 0 }, // GPUDeviceType::GFX900
413    { 9, 0, 1 }, // GPUDeviceType::GFX901
414    { 9, 0, 2 }, // GPUDeviceType::GFX902
415    { 9, 0, 3 }, // GPUDeviceType::GFX903
416    { 9, 0, 4 }, // GPUDeviceType::GFX904
417    { 9, 0, 5 }  // GPUDeviceType::GFX905
418};
419
420AMDGPUArchVersion CLRX::getGPUArchVersion(GPUDeviceType deviceType,
421                            GPUArchVersionTable table)
422{
423    if (deviceType > GPUDeviceType::GPUDEVICE_MAX)
424        throw GPUIdException("Unknown GPU device type");
425    // choose correct GPU arch values table
426    const AMDGPUArchVersion* archValuesTable = (table == GPUArchVersionTable::AMDCL2) ?
427            amdCL2GpuArchVersionTbl :
428            ((table == GPUArchVersionTable::OPENSOURCE) ? galliumGpuArchVersionTbl :
429            rocmGpuArchVersionTbl);
430    return archValuesTable[cxuint(deviceType)];
431}
432
433// GPU arch version with device type
434struct AMDGPUArchVersionEntry
435{
436    uint32_t major;
437    uint32_t minor;
438    uint32_t stepping;
439    GPUDeviceType deviceType;
440};
441
442// list of AMDGPU arch entries for GPU devices
443static const AMDGPUArchVersionEntry amdGpuArchVersionEntriesTbl[] =
444{
445    { 0, 0, 0, GPUDeviceType::CAPE_VERDE },
446    { 7, 0, 0, GPUDeviceType::BONAIRE },
447    { 7, 0, 1, GPUDeviceType::HAWAII },
448    { 8, 0, 0, GPUDeviceType::ICELAND },
449    { 8, 0, 1, GPUDeviceType::CARRIZO },
450    { 8, 0, 2, GPUDeviceType::ICELAND },
451    { 8, 0, 3, GPUDeviceType::FIJI },
452    { 8, 0, 4, GPUDeviceType::FIJI },
453    { 8, 1, 0, GPUDeviceType::STONEY },
454    { 9, 0, 0, GPUDeviceType::GFX900 },
455    { 9, 0, 1, GPUDeviceType::GFX901 },
456    { 9, 0, 2, GPUDeviceType::GFX902 },
457    { 9, 0, 3, GPUDeviceType::GFX903 },
458    { 9, 0, 4, GPUDeviceType::GFX904 },
459    { 9, 0, 5, GPUDeviceType::GFX905 }
460};
461
462static const size_t amdGpuArchVersionEntriesNum = sizeof(amdGpuArchVersionEntriesTbl) /
463                sizeof(AMDGPUArchVersionEntry);
464
465GPUDeviceType CLRX::getGPUDeviceTypeFromArchVersion(cxuint archMajor, cxuint archMinor,
466                            cxuint archStepping)
467{
468    // determine device type
469    GPUDeviceType deviceType = GPUDeviceType::CAPE_VERDE;
470    // choose lowest GPU device by archMajor by default
471    if (archMajor==0)
472        deviceType = GPUDeviceType::CAPE_VERDE;
473    else if (archMajor==7)
474        deviceType = GPUDeviceType::BONAIRE;
475    else if (archMajor==8)
476        deviceType = GPUDeviceType::ICELAND;
477    else if (archMajor==9)
478        deviceType = GPUDeviceType::GFX900;
479   
480    // recognize device type by arch major, minor and stepping
481    for (cxuint i = 0; i < amdGpuArchVersionEntriesNum; i++)
482        if (amdGpuArchVersionEntriesTbl[i].major==archMajor &&
483            amdGpuArchVersionEntriesTbl[i].minor==archMinor &&
484            amdGpuArchVersionEntriesTbl[i].stepping==archStepping)
485        {
486            deviceType = amdGpuArchVersionEntriesTbl[i].deviceType;
487            break;
488        }
489    return deviceType;
490}
Note: See TracBrowser for help on using the repository browser.