File: platform_impl.cpp

package info (click to toggle)
intel-graphics-compiler2 2.16.0-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 106,644 kB
  • sloc: cpp: 805,640; lisp: 287,672; ansic: 16,414; python: 3,952; yacc: 2,588; lex: 1,666; pascal: 313; sh: 186; makefile: 35
file content (51 lines) | stat: -rw-r--r-- 2,593 bytes parent folder | download
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
/*========================== begin_copyright_notice ============================

Copyright (C) 2017-2021 Intel Corporation

SPDX-License-Identifier: MIT

============================= end_copyright_notice ===========================*/

#include "ocl_igc_interface/platform.h"
#include "ocl_igc_interface/impl/platform_impl.h"

#include "cif/macros/enable.h"

namespace IGC {

// Helpers for clarity
// Basically, these forward GetX/SetX from interface (of given version)
// to GT_SYSTEM_INFO inside pImpl
//
// DEFINE_GET_SET as defined in igc_features_and_workarounds_impl.cpp cannot
// handle complex objects.
#define DEFINE_GET_SET_COMPLEX(INTERFACE, VERSION, NAME, TYPE, SOURCE)                                                 \
  TYPE CIF_GET_INTERFACE_CLASS(INTERFACE, VERSION)::Get##NAME() const {                                                \
    return static_cast<TYPE>(CIF_GET_PIMPL()->p.SOURCE);                                                               \
  }                                                                                                                    \
  void CIF_GET_INTERFACE_CLASS(INTERFACE, VERSION)::Set##NAME(TYPE v) {                                                \
    CIF_GET_PIMPL()->p.SOURCE = static_cast<decltype(CIF_GET_PIMPL()->p.SOURCE)>(v);                                   \
  }

// Interface version 1.
DEFINE_GET_SET_COMPLEX(Platform, 1, ProductFamily, TypeErasedEnum, eProductFamily);
DEFINE_GET_SET_COMPLEX(Platform, 1, PCHProductFamily, TypeErasedEnum, ePCHProductFamily);
DEFINE_GET_SET_COMPLEX(Platform, 1, DisplayCoreFamily, TypeErasedEnum, eDisplayCoreFamily);
DEFINE_GET_SET_COMPLEX(Platform, 1, RenderCoreFamily, TypeErasedEnum, eRenderCoreFamily);
DEFINE_GET_SET_COMPLEX(Platform, 1, PlatformType, TypeErasedEnum, ePlatformType);
DEFINE_GET_SET_COMPLEX(Platform, 1, DeviceID, unsigned short, usDeviceID);
DEFINE_GET_SET_COMPLEX(Platform, 1, RevId, unsigned short, usRevId);
DEFINE_GET_SET_COMPLEX(Platform, 1, DeviceID_PCH, unsigned short, usDeviceID_PCH);
DEFINE_GET_SET_COMPLEX(Platform, 1, RevId_PCH, unsigned short, usRevId_PCH);
DEFINE_GET_SET_COMPLEX(Platform, 1, GTType, TypeErasedEnum, eGTType);

// Interface version 2.
//  Added Render/Media/Display block IDs
DEFINE_GET_SET_COMPLEX(Platform, 2, RenderBlockID, unsigned int, sRenderBlockID.Value);
DEFINE_GET_SET_COMPLEX(Platform, 2, MediaBlockID, unsigned int, sMediaBlockID.Value);
DEFINE_GET_SET_COMPLEX(Platform, 2, DisplayBlockID, unsigned int, sDisplayBlockID.Value);

#undef DEFINE_GET_SET_COMPLEX
} // namespace IGC

#include "cif/macros/disable.h"