Hash :
c0d806b4
Author :
Date :
2025-02-10T23:01:33
CL: OpenCL support for ANGLE Capture/Replay Implementation of OpenCL Capture/Replay tool in ANGLE. Brief notes about the change: - Most meaningful changes for the capture process are made in src/libANGLE/capture/ - Most meaningful changes for replay are made in util/capture/ and src/tests/perf_tests/ - Many autogenerated files are changed/added to allow the capture of OpenCL objects & calls - The following applications were captured/replayed: benchmark_model, GeekBench Compute, GeekBench ML, AI-Benchmark, various OCL CTS tests - End2end test added to capture_tests. CapturedTestCL.MultiFrameCL/ES3_Vulkan Bug: angleproject:383841335 Change-Id: I55fdaa6cd6c7ba740aaa2351e4d29050059d6d1d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6102105 Commit-Queue: Cody Northrop <cnorthrop@google.com> Reviewed-by: Roman Lavrov <romanl@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com>
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_