1//===-- AMDIL7XXDevice.cpp - Device Info for 7XX GPUs ---------------------===// 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 "AMDIL7XXDevice.h" 11#include "AMDGPUSubtarget.h" 12#include "AMDILDevice.h" 13 14using namespace llvm; 15 16AMDGPU7XXDevice::AMDGPU7XXDevice(AMDGPUSubtarget *ST) : AMDGPUDevice(ST) { 17 setCaps(); 18 std::string name = mSTM->getDeviceName(); 19 if (name == "rv710") { 20 DeviceFlag = OCL_DEVICE_RV710; 21 } else if (name == "rv730") { 22 DeviceFlag = OCL_DEVICE_RV730; 23 } else { 24 DeviceFlag = OCL_DEVICE_RV770; 25 } 26} 27 28AMDGPU7XXDevice::~AMDGPU7XXDevice() { 29} 30 31void AMDGPU7XXDevice::setCaps() { 32 mSWBits.set(AMDGPUDeviceInfo::LocalMem); 33} 34 35size_t AMDGPU7XXDevice::getMaxLDSSize() const { 36 if (usesHardware(AMDGPUDeviceInfo::LocalMem)) { 37 return MAX_LDS_SIZE_700; 38 } 39 return 0; 40} 41 42size_t AMDGPU7XXDevice::getWavefrontSize() const { 43 return AMDGPUDevice::HalfWavefrontSize; 44} 45 46uint32_t AMDGPU7XXDevice::getGeneration() const { 47 return AMDGPUDeviceInfo::HD4XXX; 48} 49 50uint32_t AMDGPU7XXDevice::getResourceID(uint32_t DeviceID) const { 51 switch (DeviceID) { 52 default: 53 assert(0 && "ID type passed in is unknown!"); 54 break; 55 case GLOBAL_ID: 56 case CONSTANT_ID: 57 case RAW_UAV_ID: 58 case ARENA_UAV_ID: 59 break; 60 case LDS_ID: 61 if (usesHardware(AMDGPUDeviceInfo::LocalMem)) { 62 return DEFAULT_LDS_ID; 63 } 64 break; 65 case SCRATCH_ID: 66 if (usesHardware(AMDGPUDeviceInfo::PrivateMem)) { 67 return DEFAULT_SCRATCH_ID; 68 } 69 break; 70 case GDS_ID: 71 assert(0 && "GDS UAV ID is not supported on this chip"); 72 if (usesHardware(AMDGPUDeviceInfo::RegionMem)) { 73 return DEFAULT_GDS_ID; 74 } 75 break; 76 }; 77 78 return 0; 79} 80 81uint32_t AMDGPU7XXDevice::getMaxNumUAVs() const { 82 return 1; 83} 84 85AMDGPU770Device::AMDGPU770Device(AMDGPUSubtarget *ST): AMDGPU7XXDevice(ST) { 86 setCaps(); 87} 88 89AMDGPU770Device::~AMDGPU770Device() { 90} 91 92void AMDGPU770Device::setCaps() { 93 if (mSTM->isOverride(AMDGPUDeviceInfo::DoubleOps)) { 94 mSWBits.set(AMDGPUDeviceInfo::FMA); 95 mHWBits.set(AMDGPUDeviceInfo::DoubleOps); 96 } 97 mSWBits.set(AMDGPUDeviceInfo::BarrierDetect); 98 mHWBits.reset(AMDGPUDeviceInfo::LongOps); 99 mSWBits.set(AMDGPUDeviceInfo::LongOps); 100 mSWBits.set(AMDGPUDeviceInfo::LocalMem); 101} 102 103size_t AMDGPU770Device::getWavefrontSize() const { 104 return AMDGPUDevice::WavefrontSize; 105} 106 107AMDGPU710Device::AMDGPU710Device(AMDGPUSubtarget *ST) : AMDGPU7XXDevice(ST) { 108} 109 110AMDGPU710Device::~AMDGPU710Device() { 111} 112 113size_t AMDGPU710Device::getWavefrontSize() const { 114 return AMDGPUDevice::QuarterWavefrontSize; 115} 116