File: unified_memory.h

package info (click to toggle)
intel-compute-runtime 25.35.35096.9-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 79,324 kB
  • sloc: cpp: 926,243; lisp: 3,433; sh: 715; makefile: 162; python: 21
file content (57 lines) | stat: -rw-r--r-- 1,268 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
/*
 * Copyright (C) 2019-2024 Intel Corporation
 *
 * SPDX-License-Identifier: MIT
 *
 */

#pragma once

#include <stdint.h>

enum class InternalMemoryType : uint32_t {
    notSpecified = 0b0,
    svm = 0b1,
    deviceUnifiedMemory = 0b10,
    hostUnifiedMemory = 0b100,
    sharedUnifiedMemory = 0b1000,
    reservedDeviceMemory = 0b10000,
    reservedHostMemory = 0b100000
};

enum class InternalIpcMemoryType : uint32_t {
    deviceUnifiedMemory = 0,
    hostUnifiedMemory = 1,
    deviceVirtualAddress = 2
};

enum class TransferType : uint32_t {
    unknown = 0,

    hostNonUsmToHostUsm = 1,
    hostNonUsmToDeviceUsm = 2,
    hostNonUsmToSharedUsm = 3,
    hostNonUsmToHostNonUsm = 4,

    hostUsmToHostUsm = 5,
    hostUsmToDeviceUsm = 6,
    hostUsmToSharedUsm = 7,
    hostUsmToHostNonUsm = 8,

    deviceUsmToHostUsm = 9,
    deviceUsmToDeviceUsm = 10,
    deviceUsmToSharedUsm = 11,
    deviceUsmToHostNonUsm = 12,

    sharedUsmToHostUsm = 13,
    sharedUsmToDeviceUsm = 14,
    sharedUsmToSharedUsm = 15,
    sharedUsmToHostNonUsm = 16
};

struct UnifiedMemoryControls {
    uint32_t generateMask();
    bool indirectDeviceAllocationsAllowed = false;
    bool indirectHostAllocationsAllowed = false;
    bool indirectSharedAllocationsAllowed = false;
};