File: gpu_page_fault_helper.cpp

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 (55 lines) | stat: -rw-r--r-- 1,210 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) 2024 Intel Corporation
 *
 * SPDX-License-Identifier: MIT
 *
 */

#include "shared/source/helpers/gpu_page_fault_helper.h"

namespace NEO::GpuPageFaultHelpers {

std::string faultTypeToString(FaultType type) {
    switch (type) {
    case FaultType::notPresent:
        return "NotPresent";
    case FaultType::writeAccessViolation:
        return "WriteAccessViolation";
    case FaultType::atomicAccessViolation:
        return "AtomicAccessViolation";
    default:
        return "Unknown";
    }
}

std::string faultAccessToString(FaultAccess access) {
    switch (access) {
    case FaultAccess::read:
        return "Read";
    case FaultAccess::write:
        return "Write";
    case FaultAccess::atomic:
        return "Atomic";
    default:
        return "Unknown";
    }
}

std::string faultLevelToString(FaultLevel level) {
    switch (level) {
    case FaultLevel::pte:
        return "PTE";
    case FaultLevel::pde:
        return "PDE";
    case FaultLevel::pdp:
        return "PDP";
    case FaultLevel::pml4:
        return "PML4";
    case FaultLevel::pml5:
        return "PML5";
    default:
        return "Unknown";
    }
}

} // namespace NEO::GpuPageFaultHelpers