AMDILDeviceInfo.h revision 2f921101c0826dc52a2c69f85c3da0f7f6e8212a
1fa63f976522bd4faf19249e8c9ac4d3edda498d9Tom Stellard//===-- AMDILDeviceInfo.h - Constants for describing devices --------------===//
2a75c6163e605f35b14f26930dd9227e4f337ec9eTom Stellard//
3a75c6163e605f35b14f26930dd9227e4f337ec9eTom Stellard//                     The LLVM Compiler Infrastructure
4a75c6163e605f35b14f26930dd9227e4f337ec9eTom Stellard//
5a75c6163e605f35b14f26930dd9227e4f337ec9eTom Stellard// This file is distributed under the University of Illinois Open Source
6a75c6163e605f35b14f26930dd9227e4f337ec9eTom Stellard// License. See LICENSE.TXT for details.
7a75c6163e605f35b14f26930dd9227e4f337ec9eTom Stellard//
8a75c6163e605f35b14f26930dd9227e4f337ec9eTom Stellard//==-----------------------------------------------------------------------===//
9a75c6163e605f35b14f26930dd9227e4f337ec9eTom Stellard#ifndef _AMDILDEVICEINFO_H_
10a75c6163e605f35b14f26930dd9227e4f337ec9eTom Stellard#define _AMDILDEVICEINFO_H_
11a75c6163e605f35b14f26930dd9227e4f337ec9eTom Stellard
12a75c6163e605f35b14f26930dd9227e4f337ec9eTom Stellard
13a75c6163e605f35b14f26930dd9227e4f337ec9eTom Stellard#include <string>
14a75c6163e605f35b14f26930dd9227e4f337ec9eTom Stellard
15a75c6163e605f35b14f26930dd9227e4f337ec9eTom Stellardnamespace llvm
16a75c6163e605f35b14f26930dd9227e4f337ec9eTom Stellard{
172f921101c0826dc52a2c69f85c3da0f7f6e8212aTom Stellard  class AMDGPUDevice;
18b72ab79d73b29ec087d90cf2c698adbab4db5defTom Stellard  class AMDGPUSubtarget;
192f921101c0826dc52a2c69f85c3da0f7f6e8212aTom Stellard  namespace AMDGPUDeviceInfo
20a75c6163e605f35b14f26930dd9227e4f337ec9eTom Stellard  {
21a75c6163e605f35b14f26930dd9227e4f337ec9eTom Stellard    // Each Capabilities can be executed using a hardware instruction,
22a75c6163e605f35b14f26930dd9227e4f337ec9eTom Stellard    // emulated with a sequence of software instructions, or not
23a75c6163e605f35b14f26930dd9227e4f337ec9eTom Stellard    // supported at all.
24a75c6163e605f35b14f26930dd9227e4f337ec9eTom Stellard    enum ExecutionMode {
25a75c6163e605f35b14f26930dd9227e4f337ec9eTom Stellard      Unsupported = 0, // Unsupported feature on the card(Default value)
26a75c6163e605f35b14f26930dd9227e4f337ec9eTom Stellard      Software, // This is the execution mode that is set if the
27a75c6163e605f35b14f26930dd9227e4f337ec9eTom Stellard      // feature is emulated in software
28a75c6163e605f35b14f26930dd9227e4f337ec9eTom Stellard      Hardware  // This execution mode is set if the feature exists
29a75c6163e605f35b14f26930dd9227e4f337ec9eTom Stellard        // natively in hardware
30a75c6163e605f35b14f26930dd9227e4f337ec9eTom Stellard    };
31a75c6163e605f35b14f26930dd9227e4f337ec9eTom Stellard
32a75c6163e605f35b14f26930dd9227e4f337ec9eTom Stellard    // Any changes to this needs to have a corresponding update to the
33a75c6163e605f35b14f26930dd9227e4f337ec9eTom Stellard    // twiki page GPUMetadataABI
34a75c6163e605f35b14f26930dd9227e4f337ec9eTom Stellard    enum Caps {
35a75c6163e605f35b14f26930dd9227e4f337ec9eTom Stellard      HalfOps          = 0x1,  // Half float is supported or not.
36a75c6163e605f35b14f26930dd9227e4f337ec9eTom Stellard      DoubleOps        = 0x2,  // Double is supported or not.
37a75c6163e605f35b14f26930dd9227e4f337ec9eTom Stellard      ByteOps          = 0x3,  // Byte(char) is support or not.
38a75c6163e605f35b14f26930dd9227e4f337ec9eTom Stellard      ShortOps         = 0x4,  // Short is supported or not.
39a75c6163e605f35b14f26930dd9227e4f337ec9eTom Stellard      LongOps          = 0x5,  // Long is supported or not.
40a75c6163e605f35b14f26930dd9227e4f337ec9eTom Stellard      Images           = 0x6,  // Images are supported or not.
41a75c6163e605f35b14f26930dd9227e4f337ec9eTom Stellard      ByteStores       = 0x7,  // ByteStores available(!HD4XXX).
42a75c6163e605f35b14f26930dd9227e4f337ec9eTom Stellard      ConstantMem      = 0x8,  // Constant/CB memory.
43a75c6163e605f35b14f26930dd9227e4f337ec9eTom Stellard      LocalMem         = 0x9,  // Local/LDS memory.
44a75c6163e605f35b14f26930dd9227e4f337ec9eTom Stellard      PrivateMem       = 0xA,  // Scratch/Private/Stack memory.
45a75c6163e605f35b14f26930dd9227e4f337ec9eTom Stellard      RegionMem        = 0xB,  // OCL GDS Memory Extension.
46a75c6163e605f35b14f26930dd9227e4f337ec9eTom Stellard      FMA              = 0xC,  // Use HW FMA or SW FMA.
47a75c6163e605f35b14f26930dd9227e4f337ec9eTom Stellard      ArenaSegment     = 0xD,  // Use for Arena UAV per pointer 12-1023.
48a75c6163e605f35b14f26930dd9227e4f337ec9eTom Stellard      MultiUAV         = 0xE,  // Use for UAV per Pointer 0-7.
49a75c6163e605f35b14f26930dd9227e4f337ec9eTom Stellard      Reserved0        = 0xF,  // ReservedFlag
50a75c6163e605f35b14f26930dd9227e4f337ec9eTom Stellard      NoAlias          = 0x10, // Cached loads.
51a75c6163e605f35b14f26930dd9227e4f337ec9eTom Stellard      Signed24BitOps   = 0x11, // Peephole Optimization.
52a75c6163e605f35b14f26930dd9227e4f337ec9eTom Stellard      // Debug mode implies that no hardware features or optimizations
53a75c6163e605f35b14f26930dd9227e4f337ec9eTom Stellard      // are performned and that all memory access go through a single
54a75c6163e605f35b14f26930dd9227e4f337ec9eTom Stellard      // uav(Arena on HD5XXX/HD6XXX and Raw on HD4XXX).
55a75c6163e605f35b14f26930dd9227e4f337ec9eTom Stellard      Debug            = 0x12, // Debug mode is enabled.
56a75c6163e605f35b14f26930dd9227e4f337ec9eTom Stellard      CachedMem        = 0x13, // Cached mem is available or not.
57a75c6163e605f35b14f26930dd9227e4f337ec9eTom Stellard      BarrierDetect    = 0x14, // Detect duplicate barriers.
58a75c6163e605f35b14f26930dd9227e4f337ec9eTom Stellard      Reserved1        = 0x15, // Reserved flag
59a75c6163e605f35b14f26930dd9227e4f337ec9eTom Stellard      ByteLDSOps       = 0x16, // Flag to specify if byte LDS ops are available.
60a75c6163e605f35b14f26930dd9227e4f337ec9eTom Stellard      ArenaVectors     = 0x17, // Flag to specify if vector loads from arena work.
61a75c6163e605f35b14f26930dd9227e4f337ec9eTom Stellard      TmrReg           = 0x18, // Flag to specify if Tmr register is supported.
62a75c6163e605f35b14f26930dd9227e4f337ec9eTom Stellard      NoInline         = 0x19, // Flag to specify that no inlining should occur.
63a75c6163e605f35b14f26930dd9227e4f337ec9eTom Stellard      MacroDB          = 0x1A, // Flag to specify that backend handles macrodb.
64a75c6163e605f35b14f26930dd9227e4f337ec9eTom Stellard      HW64BitDivMod    = 0x1B, // Flag for backend to generate 64bit div/mod.
65a75c6163e605f35b14f26930dd9227e4f337ec9eTom Stellard      ArenaUAV         = 0x1C, // Flag to specify that arena uav is supported.
66a75c6163e605f35b14f26930dd9227e4f337ec9eTom Stellard      PrivateUAV       = 0x1D, // Flag to specify that private memory uses uav's.
67a75c6163e605f35b14f26930dd9227e4f337ec9eTom Stellard      // If more capabilities are required, then
68a75c6163e605f35b14f26930dd9227e4f337ec9eTom Stellard      // this number needs to be increased.
69a75c6163e605f35b14f26930dd9227e4f337ec9eTom Stellard      // All capabilities must come before this
70a75c6163e605f35b14f26930dd9227e4f337ec9eTom Stellard      // number.
71a75c6163e605f35b14f26930dd9227e4f337ec9eTom Stellard      MaxNumberCapabilities = 0x20
72a75c6163e605f35b14f26930dd9227e4f337ec9eTom Stellard    };
73a75c6163e605f35b14f26930dd9227e4f337ec9eTom Stellard    // These have to be in order with the older generations
74a75c6163e605f35b14f26930dd9227e4f337ec9eTom Stellard    // having the lower number enumerations.
75a75c6163e605f35b14f26930dd9227e4f337ec9eTom Stellard    enum Generation {
76a75c6163e605f35b14f26930dd9227e4f337ec9eTom Stellard      HD4XXX = 0, // 7XX based devices.
77a75c6163e605f35b14f26930dd9227e4f337ec9eTom Stellard      HD5XXX, // Evergreen based devices.
78a75c6163e605f35b14f26930dd9227e4f337ec9eTom Stellard      HD6XXX, // NI/Evergreen+ based devices.
79a75c6163e605f35b14f26930dd9227e4f337ec9eTom Stellard      HD7XXX,
80a75c6163e605f35b14f26930dd9227e4f337ec9eTom Stellard      HDTEST, // Experimental feature testing device.
81a75c6163e605f35b14f26930dd9227e4f337ec9eTom Stellard      HDNUMGEN
82a75c6163e605f35b14f26930dd9227e4f337ec9eTom Stellard    };
83a75c6163e605f35b14f26930dd9227e4f337ec9eTom Stellard
84a75c6163e605f35b14f26930dd9227e4f337ec9eTom Stellard
852f921101c0826dc52a2c69f85c3da0f7f6e8212aTom Stellard  AMDGPUDevice*
86b72ab79d73b29ec087d90cf2c698adbab4db5defTom Stellard    getDeviceFromName(const std::string &name, AMDGPUSubtarget *ptr,
87b72ab79d73b29ec087d90cf2c698adbab4db5defTom Stellard                      bool is64bit = false, bool is64on32bit = false);
88a75c6163e605f35b14f26930dd9227e4f337ec9eTom Stellard  } // namespace AMDILDeviceInfo
89a75c6163e605f35b14f26930dd9227e4f337ec9eTom Stellard} // namespace llvm
90a75c6163e605f35b14f26930dd9227e4f337ec9eTom Stellard#endif // _AMDILDEVICEINFO_H_
91