File: ze_runtime_loader.cpp

package info (click to toggle)
intel-compute-runtime 25.44.36015.8-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 79,632 kB
  • sloc: cpp: 931,547; lisp: 2,074; sh: 719; makefile: 162; python: 21
file content (28 lines) | stat: -rw-r--r-- 1,279 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
/*
 * Copyright (C) 2025 Intel Corporation
 *
 * SPDX-License-Identifier: MIT
 *
 */

#include "level_zero/ddi/ze_ddi_tables.h"
#include <level_zero/zer_api.h>
#include <level_zero/zer_ddi.h>

ZE_APIEXPORT ze_result_t ZE_APICALL
zerGetGlobalProcAddrTable(
    ze_api_version_t version,
    zer_global_dditable_t *pDdiTable) {
    if (nullptr == pDdiTable) {
        return ZE_RESULT_ERROR_INVALID_ARGUMENT;
    }
    if (ZE_MAJOR_VERSION(L0::globalDriverDispatch.runtime.version) != ZE_MAJOR_VERSION(version)) {
        return ZE_RESULT_ERROR_UNSUPPORTED_VERSION;
    }
    ze_result_t result = ZE_RESULT_SUCCESS;
    fillDdiEntry(pDdiTable->pfnGetLastErrorDescription, L0::globalDriverDispatch.runtimeGlobal.pfnGetLastErrorDescription, version, ZE_API_VERSION_1_14);
    fillDdiEntry(pDdiTable->pfnTranslateDeviceHandleToIdentifier, L0::globalDriverDispatch.runtimeGlobal.pfnTranslateDeviceHandleToIdentifier, version, ZE_API_VERSION_1_14);
    fillDdiEntry(pDdiTable->pfnTranslateIdentifierToDeviceHandle, L0::globalDriverDispatch.runtimeGlobal.pfnTranslateIdentifierToDeviceHandle, version, ZE_API_VERSION_1_14);
    fillDdiEntry(pDdiTable->pfnGetDefaultContext, L0::globalDriverDispatch.runtimeGlobal.pfnGetDefaultContext, version, ZE_API_VERSION_1_14);
    return result;
}