1 //===-- AMDILDeviceInfo.cpp - AMDILDeviceInfo class -----------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //==-----------------------------------------------------------------------===//
10 // Function that creates DeviceInfo from a device name and other information.
12 //==-----------------------------------------------------------------------===//
13 #include "AMDILDevices.h"
14 #include "AMDGPUSubtarget.h"
18 namespace AMDGPUDeviceInfo
{
20 getDeviceFromName(const std::string
&deviceName
, AMDGPUSubtarget
*ptr
,
21 bool is64bit
, bool is64on32bit
)
23 if (deviceName
.c_str()[2] == '7') {
24 switch (deviceName
.c_str()[3]) {
26 return new AMDGPU710Device(ptr
);
28 return new AMDGPU770Device(ptr
);
30 return new AMDGPU7XXDevice(ptr
);
32 } else if (deviceName
== "cypress") {
34 assert(!is64bit
&& "This device does not support 64bit pointers!");
35 assert(!is64on32bit
&& "This device does not support 64bit"
36 " on 32bit pointers!");
38 return new AMDGPUCypressDevice(ptr
);
39 } else if (deviceName
== "juniper") {
41 assert(!is64bit
&& "This device does not support 64bit pointers!");
42 assert(!is64on32bit
&& "This device does not support 64bit"
43 " on 32bit pointers!");
45 return new AMDGPUEvergreenDevice(ptr
);
46 } else if (deviceName
== "redwood") {
48 assert(!is64bit
&& "This device does not support 64bit pointers!");
49 assert(!is64on32bit
&& "This device does not support 64bit"
50 " on 32bit pointers!");
52 return new AMDGPURedwoodDevice(ptr
);
53 } else if (deviceName
== "cedar") {
55 assert(!is64bit
&& "This device does not support 64bit pointers!");
56 assert(!is64on32bit
&& "This device does not support 64bit"
57 " on 32bit pointers!");
59 return new AMDGPUCedarDevice(ptr
);
60 } else if (deviceName
== "barts"
61 || deviceName
== "turks") {
63 assert(!is64bit
&& "This device does not support 64bit pointers!");
64 assert(!is64on32bit
&& "This device does not support 64bit"
65 " on 32bit pointers!");
67 return new AMDGPUNIDevice(ptr
);
68 } else if (deviceName
== "cayman") {
70 assert(!is64bit
&& "This device does not support 64bit pointers!");
71 assert(!is64on32bit
&& "This device does not support 64bit"
72 " on 32bit pointers!");
74 return new AMDGPUCaymanDevice(ptr
);
75 } else if (deviceName
== "caicos") {
77 assert(!is64bit
&& "This device does not support 64bit pointers!");
78 assert(!is64on32bit
&& "This device does not support 64bit"
79 " on 32bit pointers!");
81 return new AMDGPUNIDevice(ptr
);
82 } else if (deviceName
== "SI") {
83 return new AMDGPUSIDevice(ptr
);
86 assert(!is64bit
&& "This device does not support 64bit pointers!");
87 assert(!is64on32bit
&& "This device does not support 64bit"
88 " on 32bit pointers!");
90 return new AMDGPU7XXDevice(ptr
);
93 } // End namespace AMDGPUDeviceInfo
94 } // End namespace llvm