Skip to content

Commit 5a84c96

Browse files
authored
Add new layer for Arm GPU timeline semantics (#24)
Adds the skeleton for a new layer that implements semantic annotation feedback for the Arm GPU scheduling timeline. This commit adds the autogenerate layer, but it is empty and does nothing. Future PRs will flesh this out with the actual semantics layer implementation.
1 parent 9160898 commit 5a84c96

File tree

14 files changed

+1032
-3
lines changed

14 files changed

+1032
-3
lines changed

.github/workflows/build_test.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,14 @@ jobs:
3030
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release ..
3131
make -j4
3232
33+
- name: Build layer_gpu_timeline
34+
run: |
35+
export CXX=clang++
36+
mkdir layer_gpu_timeline/build_rel
37+
cd layer_gpu_timeline/build_rel
38+
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release ..
39+
make -j4
40+
3341
- name: Build and run unit tests
3442
run: |
3543
export CXX=clang++
@@ -56,6 +64,14 @@ jobs:
5664
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release ..
5765
make -j4
5866
67+
- name: Build layer_gpu_timeline
68+
run: |
69+
export CXX=g++
70+
mkdir layer_gpu_timeline/build_rel
71+
cd layer_gpu_timeline/build_rel
72+
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release ..
73+
make -j4
74+
5975
build-android:
6076
name: Android
6177
runs-on: ubuntu-22.04

generator/vk_layer/source/entry.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@
3535
#include <mutex>
3636
#include <thread>
3737

38-
#include "framework/utils.hpp"
3938
#include "framework/instance_functions_manual.hpp"
39+
#include "framework/utils.hpp"
4040

4141
std::mutex g_vulkanLock;
4242

layer_example/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ project(VkLayerExample VERSION 1.0.0)
2929

3030
# Common configuration
3131
set(LGL_LOG_TAG "VkLayerExample")
32-
set(LGL_CONFIG_TRACE 1)
32+
set(LGL_CONFIG_TRACE 0)
3333
set(LGL_CONFIG_LOG 1)
3434

3535
include(../source_common/compiler_helper.cmake)

layer_example/source/entry.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@
3535
#include <mutex>
3636
#include <thread>
3737

38-
#include "framework/utils.hpp"
3938
#include "framework/instance_functions_manual.hpp"
39+
#include "framework/utils.hpp"
4040

4141
std::mutex g_vulkanLock;
4242

layer_gpu_timeline/CMakeLists.txt

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# SPDX-License-Identifier: MIT
2+
# -----------------------------------------------------------------------------
3+
# Copyright (c) 2024 Arm Limited
4+
#
5+
# Permission is hereby granted, free of charge, to any person obtaining a copy
6+
# of this software and associated documentation files (the "Software"), to
7+
# deal in the Software without restriction, including without limitation the
8+
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
9+
# sell copies of the Software, and to permit persons to whom the Software is
10+
# furnished to do so, subject to the following conditions:
11+
#
12+
# The above copyright notice and this permission notice shall be included in
13+
# all copies or substantial portions of the Software.
14+
#
15+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
# SOFTWARE.
22+
# -----------------------------------------------------------------------------
23+
24+
cmake_minimum_required(VERSION 3.17)
25+
26+
set(CMAKE_CXX_STANDARD 20)
27+
28+
project(VkLayerGPUTimeline VERSION 1.0.0)
29+
30+
# Common configuration
31+
set(LGL_LOG_TAG "VkLayerGPUTimeline")
32+
set(LGL_CONFIG_TRACE 0)
33+
set(LGL_CONFIG_LOG 1)
34+
35+
include(../source_common/compiler_helper.cmake)
36+
37+
# Build steps
38+
add_subdirectory(source)
39+
add_subdirectory(../source_common/framework source_common/framework)
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
#!/usr/bin/env bash
2+
# SPDX-License-Identifier: MIT
3+
# ----------------------------------------------------------------------------
4+
# Copyright (c) 2024 Arm Limited
5+
#
6+
# Permission is hereby granted, free of charge, to any person obtaining a copy
7+
# of this software and associated documentation files (the "Software"), to
8+
# deal in the Software without restriction, including without limitation the
9+
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10+
# sell copies of the Software, and to permit persons to whom the Software is
11+
# furnished to do so, subject to the following conditions:
12+
#
13+
# The above copyright notice and this permission notice shall be included in
14+
# all copies or substantial portions of the Software.
15+
#
16+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21+
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
22+
# IN THE SOFTWARE.
23+
# ----------------------------------------------------------------------------
24+
25+
# ----------------------------------------------------------------------------
26+
# Configuration
27+
28+
# Exit immediately if any component command errors
29+
set -e
30+
31+
BUILD_DIR_64=build_arm64
32+
BUILD_DIR_PACK=build_package
33+
34+
# ----------------------------------------------------------------------------
35+
# Process command line options
36+
if [ "$#" -lt 1 ]; then
37+
BUILD_TYPE=Release
38+
else
39+
BUILD_TYPE=$1
40+
fi
41+
42+
# Process command line options
43+
if [ "$#" -lt 2 ]; then
44+
PACKAGE=0
45+
else
46+
PACKAGE=$2
47+
fi
48+
49+
if [ "${PACKAGE}" -gt "0" ]; then
50+
echo "Building a ${BUILD_TYPE} build with packaging"
51+
else
52+
echo "Building a ${BUILD_TYPE} build without packaging"
53+
fi
54+
55+
# ----------------------------------------------------------------------------
56+
# Build the 64-bit layer
57+
mkdir -p ${BUILD_DIR_64}
58+
pushd ${BUILD_DIR_64}
59+
60+
cmake \
61+
-DCMAKE_SYSTEM_NAME=Android \
62+
-DANDROID_PLATFORM=29 \
63+
-DANDROID_ABI=arm64-v8a \
64+
-DANDROID_TOOLCHAIN=clang \
65+
-DANDROID_STL=c++_static \
66+
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
67+
-DCMAKE_TOOLCHAIN_FILE="${ANDROID_NDK_HOME}/build/cmake/android.toolchain.cmake" \
68+
..
69+
70+
make -j1
71+
72+
popd
73+
74+
# ----------------------------------------------------------------------------
75+
# Build the release package
76+
if [ "${PACKAGE}" -gt "0" ]; then
77+
# Setup the package directories
78+
mkdir -p ${BUILD_DIR_PACK}/bin/android/arm64
79+
80+
# Install the 64-bit layer
81+
cp ${BUILD_DIR_64}/source/*.so ${BUILD_DIR_PACK}/bin/android/arm64
82+
fi

0 commit comments

Comments
 (0)