File: trace_fixture_cl.h

package info (click to toggle)
webkit2gtk 2.50.1-1~deb12u1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm-proposed-updates
  • size: 445,776 kB
  • sloc: cpp: 3,798,329; javascript: 197,914; ansic: 161,337; python: 49,141; asm: 21,987; ruby: 18,540; perl: 16,723; xml: 4,623; yacc: 2,360; sh: 2,246; java: 2,019; lex: 1,327; pascal: 366; makefile: 289
file content (99 lines) | stat: -rw-r--r-- 3,444 bytes parent folder | download | duplicates (6)
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
//
// Copyright 2025 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// trace_fixture_cl.h:
//   OpenCL-specific code for the ANGLE trace replays.
//

#ifndef ANGLE_TRACE_FIXTURE_CL_H_
#define ANGLE_TRACE_FIXTURE_CL_H_

#include <CL/cl.h>

#include <EGL/egl.h>
#include <EGL/eglext.h>
#include <math.h>
#include <stddef.h>
#include <stdint.h>

#include "trace_interface.h"
#include "traces_export.h"

#include "trace_egl_loader_autogen.h"
#include "trace_gles_loader_autogen.h"

#if defined(__cplusplus)
#    include <cstdio>
#    include <cstring>
#    include <limits>
#    include <unordered_map>
#    include <vector>

extern "C" {

// Functions implemented by traces.
// "not exported" tag is a hack to get around trace interpreter codegen -_-
/* not exported */ void SetupReplay();
/* not exported */ void ReplayFrame(uint32_t frameIndex);
/* not exported */ void ResetReplay();
/* not exported */ void FinishReplay();
/* not exported */ void SetupFirstFrame();

ANGLE_REPLAY_EXPORT void SetupEntryPoints(angle::TraceCallbacks *traceCallbacks,
                                          angle::TraceFunctions **traceFunctions);
#endif  // defined(__cplusplus)

extern uint8_t *gBinaryData;
extern uint8_t *gReadBuffer;

extern cl_platform_id *clPlatformsMap;
extern cl_device_id *clDevicesMap;
extern cl_context *clContextsMap;
extern cl_command_queue *clCommandQueuesMap;
extern cl_mem *clMemMap;
extern cl_event *clEventsMap;
extern cl_program *clProgramsMap;
extern cl_kernel *clKernelsMap;
extern cl_sampler *clSamplerMap;
extern void **clVoidMap;

extern std::vector<cl_platform_id> temporaryPlatformsList;
extern std::vector<cl_device_id> temporaryDevicesList;
extern std::vector<cl_kernel> temporaryKernelsList;
extern std::vector<cl_mem> temporaryBuffersList;
extern std::vector<cl_program> temporaryProgramsList;
extern std::vector<cl_event> temporaryEventsList;
extern cl_image_desc temporaryImageDesc;
extern std::vector<cl_context_properties> temporaryContextProps;
extern std::vector<const char *> temporaryCharPointerList;
extern std::vector<const void *> temporaryVoidPtrList;
extern std::vector<const unsigned char *> temporaryUnsignedCharPointerList;
extern void *temporaryVoidPtr;

void InitializeReplayCL(const char *binaryDataFileName,
                        size_t maxClientArraySize,
                        size_t readBufferSize,
                        uint32_t maxCLPlatform,
                        uint32_t maxCLDevices,
                        uint32_t maxCLContexts,
                        uint32_t maxCLCommandQueues,
                        uint32_t maxCLMem,
                        uint32_t maxCLEvents,
                        uint32_t maxCLPrograms,
                        uint32_t maxCLKernels,
                        uint32_t maxCLSamplers,
                        uint32_t maxCLVoidPointer);

void UpdateCLContextPropertiesNoPlatform(size_t propSize, const cl_context_properties *propData);
void UpdateCLContextPropertiesWithPlatform(size_t propSize,
                                           const cl_context_properties *propData,
                                           size_t platformIdxInProps,
                                           size_t platformIdxInMap);

#if defined(__cplusplus)
}       // extern "C"
#endif  // defined(__cplusplus)

#endif  // ANGLE_TRACE_FIXTURE_CL_H_