File: igc_platform_helper.cpp

package info (click to toggle)
intel-compute-runtime 26.05.37020.3-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 83,596 kB
  • sloc: cpp: 976,037; lisp: 2,096; sh: 704; makefile: 162
file content (59 lines) | stat: -rw-r--r-- 2,498 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
52
53
54
55
56
57
58
59
/*
 * Copyright (C) 2022-2026 Intel Corporation
 *
 * SPDX-License-Identifier: MIT
 *
 */

#include "shared/source/compiler_interface/igc_platform_helper.h"

#include "shared/source/helpers/compiler_product_helper.h"
#include "shared/source/helpers/hw_info.h"
#include "shared/source/helpers/validators.h"

#include "ocl_igc_interface/platform_helper.h"

namespace NEO {

void populateIgcPlatform(PlatformTag &igcPlatform, const HardwareInfo &inputHwInfo) {
    auto hwInfo = inputHwInfo;
    auto compilerProductHelper = CompilerProductHelper::create(hwInfo.platform.eProductFamily);
    if (compilerProductHelper) {
        compilerProductHelper->adjustHwInfoForIgc(hwInfo);
    }
    igcPlatform.SetProductFamily(hwInfo.platform.eProductFamily);
    igcPlatform.SetPCHProductFamily(hwInfo.platform.ePCHProductFamily);
    igcPlatform.SetDisplayCoreFamily(hwInfo.platform.eDisplayCoreFamily);
    igcPlatform.SetRenderCoreFamily(hwInfo.platform.eRenderCoreFamily);
    igcPlatform.SetPlatformType(hwInfo.platform.ePlatformType);
    igcPlatform.SetDeviceID(hwInfo.platform.usDeviceID);
    igcPlatform.SetRevId(hwInfo.platform.usRevId);
    igcPlatform.SetDeviceID_PCH(hwInfo.platform.usDeviceID_PCH);
    igcPlatform.SetRevId_PCH(hwInfo.platform.usRevId_PCH);
    igcPlatform.SetGTType(hwInfo.platform.eGTType);
    igcPlatform.SetRenderBlockID(hwInfo.ipVersion.value);
}

bool initializeIgcDeviceContext(NEO::IgcOclDeviceCtxTag *igcDeviceCtx, const HardwareInfo &hwInfo, const CompilerProductHelper *compilerProductHelper) {
    auto igcPlatform = igcDeviceCtx->GetPlatformHandle<NEO::PlatformTag>();
    auto igcGtSystemInfo = igcDeviceCtx->GetGTSystemInfoHandle<NEO::GTSystemInfoTag>();
    auto igcFtrWa = igcDeviceCtx->GetIgcFeaturesAndWorkaroundsHandle<NEO::IgcFeaturesAndWorkaroundsTag>();

    if (false == NEO::areNotNullptr(igcPlatform.get(), igcGtSystemInfo.get(), igcFtrWa.get())) {
        return false;
    }
    populateIgcPlatform(*igcPlatform, hwInfo);

    IGC::GtSysInfoHelper::PopulateInterfaceWith(*igcGtSystemInfo, hwInfo.gtSystemInfo);

    if (compilerProductHelper) {
        igcFtrWa->SetFtrGpGpuMidThreadLevelPreempt(compilerProductHelper->isMidThreadPreemptionSupported(hwInfo));
    }
    igcFtrWa->SetFtrWddm2Svm(hwInfo.featureTable.flags.ftrWddm2Svm);
    igcFtrWa->SetFtrPooledEuEnabled(hwInfo.featureTable.flags.ftrPooledEuEnabled);
    igcFtrWa->SetFtrEfficient64BitAddressing(hwInfo.featureTable.flags.ftrHeaplessMode);

    return true;
}

} // namespace NEO