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 /// \file 9 //==-----------------------------------------------------------------------===// 10 #include "AMDILNIDevice.h" 11 #include "AMDGPUSubtarget.h" 12 #include "AMDILEvergreenDevice.h" 13 14 using namespace llvm; 15 AMDGPUNIDevice(AMDGPUSubtarget * ST)16AMDGPUNIDevice::AMDGPUNIDevice(AMDGPUSubtarget *ST) 17 : AMDGPUEvergreenDevice(ST) { 18 std::string name = ST->getDeviceName(); 19 if (name == "caicos") { 20 DeviceFlag = OCL_DEVICE_CAICOS; 21 } else if (name == "turks") { 22 DeviceFlag = OCL_DEVICE_TURKS; 23 } else if (name == "cayman") { 24 DeviceFlag = OCL_DEVICE_CAYMAN; 25 } else { 26 DeviceFlag = OCL_DEVICE_BARTS; 27 } 28 } ~AMDGPUNIDevice()29AMDGPUNIDevice::~AMDGPUNIDevice() { 30 } 31 32 size_t getMaxLDSSize() const33AMDGPUNIDevice::getMaxLDSSize() const { 34 if (usesHardware(AMDGPUDeviceInfo::LocalMem)) { 35 return MAX_LDS_SIZE_900; 36 } else { 37 return 0; 38 } 39 } 40 41 uint32_t getGeneration() const42AMDGPUNIDevice::getGeneration() const { 43 return AMDGPUDeviceInfo::HD6XXX; 44 } 45 46 AMDGPUCaymanDevice(AMDGPUSubtarget * ST)47AMDGPUCaymanDevice::AMDGPUCaymanDevice(AMDGPUSubtarget *ST) 48 : AMDGPUNIDevice(ST) { 49 setCaps(); 50 } 51 ~AMDGPUCaymanDevice()52AMDGPUCaymanDevice::~AMDGPUCaymanDevice() { 53 } 54 55 void setCaps()56AMDGPUCaymanDevice::setCaps() { 57 if (mSTM->isOverride(AMDGPUDeviceInfo::DoubleOps)) { 58 mHWBits.set(AMDGPUDeviceInfo::DoubleOps); 59 mHWBits.set(AMDGPUDeviceInfo::FMA); 60 } 61 mHWBits.set(AMDGPUDeviceInfo::Signed24BitOps); 62 mSWBits.reset(AMDGPUDeviceInfo::Signed24BitOps); 63 mSWBits.set(AMDGPUDeviceInfo::ArenaSegment); 64 } 65 66