aboutsummaryrefslogtreecommitdiff
path: root/lib/Target/R600/AMDILNIDevice.cpp
blob: 47c3f7f209d6185a1cb54dee4fabbc424a55ef6a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
//===-- AMDILNIDevice.cpp - Device Info for Northern Islands devices ------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
/// \file
//==-----------------------------------------------------------------------===//
#include "AMDILNIDevice.h"
#include "AMDGPUSubtarget.h"
#include "AMDILEvergreenDevice.h"

using namespace llvm;

AMDGPUNIDevice::AMDGPUNIDevice(AMDGPUSubtarget *ST)
  : AMDGPUEvergreenDevice(ST) {
  std::string name = ST->getDeviceName();
  if (name == "caicos") {
    DeviceFlag = OCL_DEVICE_CAICOS;
  } else if (name == "turks") {
    DeviceFlag = OCL_DEVICE_TURKS;
  } else if (name == "cayman") {
    DeviceFlag = OCL_DEVICE_CAYMAN;
  } else {
    DeviceFlag = OCL_DEVICE_BARTS;
  }
}
AMDGPUNIDevice::~AMDGPUNIDevice() {
}

size_t
AMDGPUNIDevice::getMaxLDSSize() const {
  if (usesHardware(AMDGPUDeviceInfo::LocalMem)) {
    return MAX_LDS_SIZE_900;
  } else {
    return 0;
  }
}

uint32_t
AMDGPUNIDevice::getGeneration() const {
  return AMDGPUDeviceInfo::HD6XXX;
}


AMDGPUCaymanDevice::AMDGPUCaymanDevice(AMDGPUSubtarget *ST)
  : AMDGPUNIDevice(ST) {
  setCaps();
}

AMDGPUCaymanDevice::~AMDGPUCaymanDevice() {
}

void
AMDGPUCaymanDevice::setCaps() {
  if (mSTM->isOverride(AMDGPUDeviceInfo::DoubleOps)) {
    mHWBits.set(AMDGPUDeviceInfo::DoubleOps);
    mHWBits.set(AMDGPUDeviceInfo::FMA);
  }
  mHWBits.set(AMDGPUDeviceInfo::Signed24BitOps);
  mSWBits.reset(AMDGPUDeviceInfo::Signed24BitOps);
  mSWBits.set(AMDGPUDeviceInfo::ArenaSegment);
}