File: app_resource_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 (126 lines) | stat: -rw-r--r-- 3,947 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
/*
 * Copyright (C) 2021-2025 Intel Corporation
 *
 * SPDX-License-Identifier: MIT
 *
 */

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

#include "shared/source/debug_settings/debug_settings_manager.h"
#include "shared/source/helpers/app_resource_defines.h"
#include "shared/source/helpers/string.h"

namespace NEO {

void AppResourceHelper::copyResourceTagStr(char *dst, AllocationType type, size_t size) {
    if (debugManager.flags.EnableResourceTags.get()) {
        auto tag = getResourceTagStr(type);
        strcpy_s(dst, size, tag);
    }
}

const char *AppResourceHelper::getResourceTagStr(AllocationType type) {
    switch (type) {
    case AllocationType::unknown:
        return "UNKNOWN";
    case AllocationType::buffer:
        return "BUFFER";
    case AllocationType::bufferHostMemory:
        return "BFHSTMEM";
    case AllocationType::commandBuffer:
        return "CMNDBUFF";
    case AllocationType::constantSurface:
        return "CSNTSRFC";
    case AllocationType::externalHostPtr:
        return "EXHSTPTR";
    case AllocationType::fillPattern:
        return "FILPATRN";
    case AllocationType::globalSurface:
        return "GLBLSRFC";
    case AllocationType::image:
        return "IMAGE";
    case AllocationType::indirectObjectHeap:
        return "INOBHEAP";
    case AllocationType::instructionHeap:
        return "INSTHEAP";
    case AllocationType::internalHeap:
        return "INTLHEAP";
    case AllocationType::internalHostMemory:
        return "INHSTMEM";
    case AllocationType::kernelArgsBuffer:
        return "KARGBUF";
    case AllocationType::kernelIsa:
        return "KERNLISA";
    case AllocationType::kernelIsaInternal:
        return "KRLISAIN";
    case AllocationType::linearStream:
        return "LINRSTRM";
    case AllocationType::mapAllocation:
        return "MAPALLOC";
    case AllocationType::mcs:
        return "MCS";
    case AllocationType::preemption:
        return "PRMPTION";
    case AllocationType::printfSurface:
        return "PRNTSRFC";
    case AllocationType::privateSurface:
        return "PRVTSRFC";
    case AllocationType::profilingTagBuffer:
        return "PROFTGBF";
    case AllocationType::scratchSurface:
        return "SCRHSRFC";
    case AllocationType::sharedBuffer:
        return "SHRDBUFF";
    case AllocationType::sharedImage:
        return "SHERDIMG";
    case AllocationType::sharedResourceCopy:
        return "SRDRSCCP";
    case AllocationType::surfaceStateHeap:
        return "SRFCSTHP";
    case AllocationType::svmCpu:
        return "SVM_CPU";
    case AllocationType::svmGpu:
        return "SVM_GPU";
    case AllocationType::svmZeroCopy:
        return "SVM0COPY";
    case AllocationType::syncBuffer:
        return "SYNCBUFF";
    case AllocationType::tagBuffer:
        return "TAGBUFER";
    case AllocationType::globalFence:
        return "GLBLFENC";
    case AllocationType::timestampPacketTagBuffer:
        return "TSPKTGBF";
    case AllocationType::writeCombined:
        return "WRTCMBND";
    case AllocationType::ringBuffer:
        return "RINGBUFF";
    case AllocationType::semaphoreBuffer:
        return "SMPHRBUF";
    case AllocationType::debugContextSaveArea:
        return "DBCXSVAR";
    case AllocationType::debugSbaTrackingBuffer:
        return "DBSBATRB";
    case AllocationType::debugModuleArea:
        return "DBMDLARE";
    case AllocationType::unifiedSharedMemory:
        return "USHRDMEM";
    case AllocationType::workPartitionSurface:
        return "WRPRTSRF";
    case AllocationType::gpuTimestampDeviceBuffer:
        return "GPUTSDBF";
    case AllocationType::swTagBuffer:
        return "SWTAGBF";
    case AllocationType::deferredTasksList:
        return "TSKLIST";
    case AllocationType::assertBuffer:
        return "ASSRTBUF";
    case AllocationType::syncDispatchToken:
        return "SYNCTOK";
    default:
        return "NOTFOUND";
    }
}

} // namespace NEO