File: um_km_data_translator.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 (55 lines) | stat: -rw-r--r-- 1,998 bytes parent folder | download | duplicates (2)
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
/*
 * Copyright (C) 2021-2023 Intel Corporation
 *
 * SPDX-License-Identifier: MIT
 *
 */

#include "shared/source/os_interface/windows/wddm/um_km_data_translator.h"

#include "shared/source/gmm_helper/client_context/gmm_handle_allocator.h"
#include "shared/source/helpers/string.h"

namespace NEO {

size_t UmKmDataTranslator::getSizeForAdapterInfoInternalRepresentation() {
    return sizeof(ADAPTER_INFO);
}

bool UmKmDataTranslator::translateAdapterInfoFromInternalRepresentation(ADAPTER_INFO_KMD &dst, const void *src, size_t srcSize) {
    return (0 == memcpy_s(&dst, sizeof(ADAPTER_INFO_KMD), src, srcSize));
}

size_t UmKmDataTranslator::getSizeForCreateContextDataInternalRepresentation() {
    return sizeof(CREATECONTEXT_PVTDATA);
}

bool UmKmDataTranslator::translateCreateContextDataToInternalRepresentation(void *dst, size_t dstSize, const CREATECONTEXT_PVTDATA &src) {
    return (0 == memcpy_s(dst, dstSize, &src, sizeof(CREATECONTEXT_PVTDATA)));
}

size_t UmKmDataTranslator::getSizeForCommandBufferHeaderDataInternalRepresentation() {
    return sizeof(COMMAND_BUFFER_HEADER);
}

bool UmKmDataTranslator::translateCommandBufferHeaderDataToInternalRepresentation(void *dst, size_t dstSize, const COMMAND_BUFFER_HEADER &src) {
    return (0 == memcpy_s(dst, dstSize, &src, sizeof(COMMAND_BUFFER_HEADER)));
}

size_t UmKmDataTranslator::getSizeForGmmGfxPartitioningInternalRepresentation() {
    return sizeof(GMM_GFX_PARTITIONING);
}

bool UmKmDataTranslator::translateGmmGfxPartitioningToInternalRepresentation(void *dst, size_t dstSize, const GMM_GFX_PARTITIONING &src) {
    return (0 == memcpy_s(dst, dstSize, &src, sizeof(src)));
}

bool UmKmDataTranslator::translateGmmGfxPartitioningFromInternalRepresentation(GMM_GFX_PARTITIONING &dst, const void *src, size_t srcSize) {
    return (0 == memcpy_s(&dst, sizeof(GMM_GFX_PARTITIONING), src, srcSize));
}

std::unique_ptr<GmmHandleAllocator> UmKmDataTranslator::createGmmHandleAllocator() {
    return {};
}

} // namespace NEO