1 //===-- AMDILNIDevice.cpp - Device Info for Northern Islands devices ------===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //==-----------------------------------------------------------------------===//
9 #include "AMDILNIDevice.h"
10 #include "AMDILEvergreenDevice.h"
11 #include "AMDGPUSubtarget.h"
12 
13 using namespace llvm;
14 
AMDGPUNIDevice(AMDGPUSubtarget * ST)15 AMDGPUNIDevice::AMDGPUNIDevice(AMDGPUSubtarget *ST)
16   : AMDGPUEvergreenDevice(ST)
17 {
18   std::string name = ST->getDeviceName();
19   if (name == "caicos") {
20     mDeviceFlag = OCL_DEVICE_CAICOS;
21   } else if (name == "turks") {
22     mDeviceFlag = OCL_DEVICE_TURKS;
23   } else if (name == "cayman") {
24     mDeviceFlag = OCL_DEVICE_CAYMAN;
25   } else {
26     mDeviceFlag = OCL_DEVICE_BARTS;
27   }
28 }
~AMDGPUNIDevice()29 AMDGPUNIDevice::~AMDGPUNIDevice()
30 {
31 }
32 
33 size_t
getMaxLDSSize() const34 AMDGPUNIDevice::getMaxLDSSize() const
35 {
36   if (usesHardware(AMDGPUDeviceInfo::LocalMem)) {
37     return MAX_LDS_SIZE_900;
38   } else {
39     return 0;
40   }
41 }
42 
43 uint32_t
getGeneration() const44 AMDGPUNIDevice::getGeneration() const
45 {
46   return AMDGPUDeviceInfo::HD6XXX;
47 }
48 
49 
AMDGPUCaymanDevice(AMDGPUSubtarget * ST)50 AMDGPUCaymanDevice::AMDGPUCaymanDevice(AMDGPUSubtarget *ST)
51   : AMDGPUNIDevice(ST)
52 {
53   setCaps();
54 }
55 
~AMDGPUCaymanDevice()56 AMDGPUCaymanDevice::~AMDGPUCaymanDevice()
57 {
58 }
59 
60 void
setCaps()61 AMDGPUCaymanDevice::setCaps()
62 {
63   if (mSTM->isOverride(AMDGPUDeviceInfo::DoubleOps)) {
64     mHWBits.set(AMDGPUDeviceInfo::DoubleOps);
65     mHWBits.set(AMDGPUDeviceInfo::FMA);
66   }
67   mHWBits.set(AMDGPUDeviceInfo::Signed24BitOps);
68   mSWBits.reset(AMDGPUDeviceInfo::Signed24BitOps);
69   mSWBits.set(AMDGPUDeviceInfo::ArenaSegment);
70 }
71 
72