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 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 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168
# Copyright 2023 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.
import("../../gni/angle.gni")
declare_args() {
angle_enable_tracegz = false
}
template("angle_trace") {
angle_shared_library(target_name) {
testonly = true
data = invoker.data
defines = [ "ANGLE_REPLAY_IMPLEMENTATION" ]
suppressed_configs += [ "$angle_root:constructor_and_destructor_warnings" ]
_trace_data = read_file(invoker.json_file_name, "json")
parsed_json = _trace_data.TraceMetadata
if (defined(invoker.rebased_path)) {
sources = rebase_path(_trace_data.TraceFiles, ".", invoker.rebased_path)
} else {
sources = _trace_data.TraceFiles
}
# Dummy statement to enable the use of defined(parsed_json.IsOpenCL)
if (parsed_json.IsBinaryDataCompressed) {
}
if (defined(parsed_json.IsOpenCL) && parsed_json.IsOpenCL &&
angle_enable_cl) {
deps = [ "$angle_root/util:angle_trace_fixture_cl" ]
} else {
deps = [ "$angle_root/util:angle_trace_fixture" ]
}
deps += [ "$angle_root/util:angle_trace_loader" ]
if (defined(invoker.deps)) {
deps += invoker.deps
}
if (is_android) {
libs = [ "log" ]
}
# Disable optimization in the trace perf tests to avoid optimizing huge files.
if (!is_debug && !is_ubsan) {
suppressed_configs += [
"//build/config/compiler:afdo",
"//build/config/compiler:afdo_optimize_size",
"//build/config/compiler:optimize_max",
"//build/config/compiler/pgo:default_pgo_flags",
]
configs += [ "//build/config/compiler:no_optimize" ]
}
include_dirs = [ "." ]
if (defined(invoker.output_name)) {
output_name = invoker.output_name
}
}
}
set_defaults("angle_trace_libs") {
# Uses a short name to work around file path limits on Windows.
short_names = false
}
template("angle_trace_libs") {
_trace_list = []
_trace_targets = []
_trace_lib_files = []
if (invoker.short_names) {
_trace_counter = 1
}
foreach(_trace_and_version, invoker.trace_list) {
_trace_and_version_arr = []
_trace_and_version_arr = string_split(_trace_and_version)
_trace = _trace_and_version_arr[0]
_trace_list += [ _trace ]
if (defined(invoker.trace_dir)) {
_trace_dir = invoker.trace_dir
} else {
_trace_dir = _trace
}
_trace_json_path = "$_trace_dir/$_trace.json"
json_file_name = _trace_json_path
rebased_path = _trace_dir
if (invoker.short_names) {
_target = "cr_trace_${_trace_counter}"
_trace_counter += 1
} else {
_target = "${target_name}_$_trace"
}
if (angle_enable_tracegz) {
_gen_tracegz_target = "gen${target_name}_$_trace"
action(_gen_tracegz_target) {
script = "//scripts/tracegz.py"
args = [
_trace,
rebase_path(_trace_dir, root_build_dir),
]
outputs = [ "$root_gen_dir/tracegz_$_trace.gz" ]
}
}
angle_trace(_target) {
data = [
"$_trace_dir/$_trace.json",
"$_trace_dir/$_trace.angledata.gz",
]
deps = []
if (angle_enable_cl) {
deps += [ "$angle_root/src/libOpenCL:OpenCL_ANGLE" ]
}
if (angle_enable_tracegz) {
deps += [ ":$_gen_tracegz_target" ]
data += [ "$root_gen_dir/tracegz_$_trace.gz" ]
}
if (invoker.short_names) {
output_name = _trace
}
}
_trace_targets += [ ":$_target" ]
_trace_lib_files += [ "${root_out_dir}/lib${_target}.so" ]
}
angle_shared_library(target_name) {
testonly = true
data = [ invoker.json_path ]
data_deps = _trace_targets
deps = [ "$angle_root:angle_common" ]
public_deps = [ "$angle_root/util:angle_trace_loader" ]
}
if (restricted_traces_outside_of_apk) {
group("${target_name}__unpacked_libs") {
testonly = true
deps = [
":angle_restricted_traces",
"$angle_root/util:angle_trace_interpreter",
]
# Also need files listed as data to be picked up by isolate
data =
_trace_lib_files + [ "${root_out_dir}/libangle_trace_interpreter.so" ]
}
}
group("gen_trace_list_json") {
_output_json_path = "$root_gen_dir/trace_list.json"
write_file(_output_json_path, _trace_list, "json")
data = [ _output_json_path ]
}
}