Skip to content

Commit

Permalink
Add new layer for Arm GPU timeline semantics (#24)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
solidpixel authored Dec 11, 2024
1 parent 9160898 commit 5a84c96
Show file tree
Hide file tree
Showing 14 changed files with 1,032 additions and 3 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/build_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@ jobs:
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release ..
make -j4
- name: Build layer_gpu_timeline
run: |
export CXX=clang++
mkdir layer_gpu_timeline/build_rel
cd layer_gpu_timeline/build_rel
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release ..
make -j4
- name: Build and run unit tests
run: |
export CXX=clang++
Expand All @@ -56,6 +64,14 @@ jobs:
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release ..
make -j4
- name: Build layer_gpu_timeline
run: |
export CXX=g++
mkdir layer_gpu_timeline/build_rel
cd layer_gpu_timeline/build_rel
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release ..
make -j4
build-android:
name: Android
runs-on: ubuntu-22.04
Expand Down
2 changes: 1 addition & 1 deletion generator/vk_layer/source/entry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
#include <mutex>
#include <thread>

#include "framework/utils.hpp"
#include "framework/instance_functions_manual.hpp"
#include "framework/utils.hpp"

std::mutex g_vulkanLock;

Expand Down
2 changes: 1 addition & 1 deletion layer_example/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ project(VkLayerExample VERSION 1.0.0)

# Common configuration
set(LGL_LOG_TAG "VkLayerExample")
set(LGL_CONFIG_TRACE 1)
set(LGL_CONFIG_TRACE 0)
set(LGL_CONFIG_LOG 1)

include(../source_common/compiler_helper.cmake)
Expand Down
2 changes: 1 addition & 1 deletion layer_example/source/entry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
#include <mutex>
#include <thread>

#include "framework/utils.hpp"
#include "framework/instance_functions_manual.hpp"
#include "framework/utils.hpp"

std::mutex g_vulkanLock;

Expand Down
39 changes: 39 additions & 0 deletions layer_gpu_timeline/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# SPDX-License-Identifier: MIT
# -----------------------------------------------------------------------------
# Copyright (c) 2024 Arm Limited
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
# -----------------------------------------------------------------------------

cmake_minimum_required(VERSION 3.17)

set(CMAKE_CXX_STANDARD 20)

project(VkLayerGPUTimeline VERSION 1.0.0)

# Common configuration
set(LGL_LOG_TAG "VkLayerGPUTimeline")
set(LGL_CONFIG_TRACE 0)
set(LGL_CONFIG_LOG 1)

include(../source_common/compiler_helper.cmake)

# Build steps
add_subdirectory(source)
add_subdirectory(../source_common/framework source_common/framework)
82 changes: 82 additions & 0 deletions layer_gpu_timeline/android_build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: MIT
# ----------------------------------------------------------------------------
# Copyright (c) 2024 Arm Limited
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
# ----------------------------------------------------------------------------

# ----------------------------------------------------------------------------
# Configuration

# Exit immediately if any component command errors
set -e

BUILD_DIR_64=build_arm64
BUILD_DIR_PACK=build_package

# ----------------------------------------------------------------------------
# Process command line options
if [ "$#" -lt 1 ]; then
BUILD_TYPE=Release
else
BUILD_TYPE=$1
fi

# Process command line options
if [ "$#" -lt 2 ]; then
PACKAGE=0
else
PACKAGE=$2
fi

if [ "${PACKAGE}" -gt "0" ]; then
echo "Building a ${BUILD_TYPE} build with packaging"
else
echo "Building a ${BUILD_TYPE} build without packaging"
fi

# ----------------------------------------------------------------------------
# Build the 64-bit layer
mkdir -p ${BUILD_DIR_64}
pushd ${BUILD_DIR_64}

cmake \
-DCMAKE_SYSTEM_NAME=Android \
-DANDROID_PLATFORM=29 \
-DANDROID_ABI=arm64-v8a \
-DANDROID_TOOLCHAIN=clang \
-DANDROID_STL=c++_static \
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
-DCMAKE_TOOLCHAIN_FILE="${ANDROID_NDK_HOME}/build/cmake/android.toolchain.cmake" \
..

make -j1

popd

# ----------------------------------------------------------------------------
# Build the release package
if [ "${PACKAGE}" -gt "0" ]; then
# Setup the package directories
mkdir -p ${BUILD_DIR_PACK}/bin/android/arm64

# Install the 64-bit layer
cp ${BUILD_DIR_64}/source/*.so ${BUILD_DIR_PACK}/bin/android/arm64
fi
Loading

0 comments on commit 5a84c96

Please sign in to comment.