Skip to content

Feature/oro 0 premake update#138

Draft
shoikeda wants to merge 16 commits into
mainfrom
feature/ORO-0-premake-update
Draft

Feature/oro 0 premake update#138
shoikeda wants to merge 16 commits into
mainfrom
feature/ORO-0-premake-update

Conversation

@shoikeda

Copy link
Copy Markdown
Collaborator

Summary

Refactor and clean up the Premake5 build configuration. No changes to Orochi library code or public APIs.

Changes

  • --builddir option — generated project files and intermediate artifacts are now written to the path specified by --builddir (defaults to the project root), keeping the working tree clean.
  • Premake5 binaries updated — Linux and Windows binaries refreshed to a newer release.
  • Configuration cleanup — removed unused copydir helper, dead options and files; aligned indentation, descriptions, and option names across all premake5.lua files.
  • Script cleanupscripts/ and tools/ Python and shell scripts tidied: consistent argument parsing, removed dead code, minor portability fixes.
  • .gitignore expanded — additional generated paths covered so they are not accidentally staged.
  • UnitTest rename — test target renamed for consistency.

Testing

Build scripts verified on Linux. No Orochi source files were modified.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Refactors the Premake5-based build setup and related helper scripts to better separate generated build files (via --builddir), reduce duplicated Premake logic, and standardize naming/formatting across test/demo projects.

Changes:

  • Reworked root premake5.lua to add --builddir / warning-level options, centralize common link logic (linkVersionLib()), and align configurations (incl. RelWithDebInfo).
  • Updated multiple premake5.lua project files to use workspace-relative location and the shared Windows version-lib helper.
  • Tidied Python/shell/batch scripts for kernel baking/compilation and unit test execution; expanded .gitignore for generated outputs.

Reviewed changes

Copilot reviewed 36 out of 39 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
premake5.lua Major workspace/options refactor; adds --builddir, centralizes shared settings and project includes.
Orochi/enable_cuew.lua Cleans CUDA path detection and switches to externalincludedirs for CUDA SDK includes.
UnitTest/premake5.lua Renames UnitTest target and aligns to new workspace conventions (location/helper usage).
UnitTest/main.cpp Minor whitespace cleanup.
UnitTest/demosTest.cpp Uses BUILD_CONFIG for demo binary path construction.
Test/premake5.lua Updates demo project location and Windows version-lib linking via helper.
Test/DeviceEnum/premake5.lua Updates location and uses linkVersionLib().
Test/WMMA/premake5.lua Updates location and uses linkVersionLib().
Test/Texture/premake5.lua Updates location and uses linkVersionLib().
Test/RadixSort/premake5.lua Updates location and uses linkVersionLib().
Test/VulkanComputeSimple/premake5.lua Moves Windows-specific options/links behind a Windows filter block.
Test/SimpleD3D12/premake5.lua Reformats and consolidates file/link lists; updates location.
Test/SimpleD3D12/simpleD3D12.cpp Small safety refactors (avoid addresses of temporaries) and explicit casts.
tools/stringify.py Refactors into functions/main; improves readability and CLI handling.
tools/genArgs.py Refactors into functions/main; standardizes parsing and output.
tools/bakeKernel.sh Adds shebang/comments; keeps kernel baking flow.
tools/bakeKernel.bat Adds header/comments; keeps kernel baking flow.
scripts/unittest.sh Adds config selection and consistent naming for UnitTest target execution.
scripts/unittest.bat Adds config parsing/suffix handling for UnitTest target execution.
scripts/unittest_vega20.sh Adds config selection and consistent UnitTest target naming.
scripts/unittest_vega20.bat Adds config parsing/suffix handling and updates UnitTest target name.
scripts/unittest_vega10.sh Adds config selection and consistent UnitTest target naming.
scripts/unittest_vega10.bat Adds config parsing/suffix handling and updates UnitTest target name.
scripts/unittest_navi2.sh Adds config selection and consistent UnitTest target naming.
scripts/unittest_navi2.bat Adds config parsing/suffix handling and updates UnitTest target name.
scripts/unittest_navi1.sh Adds config selection and consistent UnitTest target naming.
scripts/unittest_navi1.bat Adds config parsing/suffix handling and updates UnitTest target name.
scripts/unittest_gfx1102.sh Adds config selection and consistent UnitTest target naming.
scripts/unittest_gfx1102.bat Adds config parsing/suffix handling and updates UnitTest target name.
scripts/unittest_gfx1100.sh Adds config selection and consistent UnitTest target naming.
scripts/unittest_gfx1100.bat Adds config parsing/suffix handling and updates UnitTest target name.
scripts/kernelCompile.py Refactors kernel compilation script into functions/main and standardizes subprocess usage.
scripts/enumArch.py Refactors architecture enumeration and improves parsing/readability.
scripts/create_archive.cmake Cleans formatting and clarifies variable expectations.
scripts/convert_binary_to_array.py Refactors into functions/main and clarifies CLI/metadata output.
scripts/amdGpuList.json Adds additional AMD gfx targets.
.gitignore Expands ignored generated artifacts and organizes ignore rules.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread premake5.lua
Comment on lines +154 to +160
if _OPTIONS["bakeKernel"] then
if os.ishost("windows") then
os.execute("%[./tools/bakeKernel.bat]")
else
os.execute("%[./tools/bakeKernel.sh]")
end
end
Comment thread premake5.lua
Comment thread scripts/unittest.bat Outdated
Comment on lines +6 to +12
set CONFIG=%1
if "%CONFIG%"=="" set CONFIG=Release
set SUFFIX=
if "%CONFIG%"=="Debug" set SUFFIX=D

rd /s /q cache
..\dist\bin\Release\Unittest64.exe --gtest_filter=-*link_bundledBc*:*VulkanComputeSimple64* --gtest_output=xml:../result.xml
..\dist\bin\Release\UnitTest64.exe --gtest_filter=-*link_bundledBc*:*VulkanComputeSimple64* --gtest_output=xml:../result.xml

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in the latest commit — the hard-coded Release path and bare UnitTest64.exe are now replaced with ..\dist\bin\%CONFIG%\UnitTest64%SUFFIX%.exe, so unittest.bat Debug correctly runs the Debug binary and unittest.bat RelWithDebInfo runs the RelWithDebInfo binary.

Comment thread UnitTest/premake5.lua
Comment on lines +22 to +25
if _OPTIONS["kernelcompile"] then
os.execute("cd ./bitcodes/ && generate_bitcodes.bat")
os.execute("cd ./bitcodes/ && generate_bitcodes_nvidia.bat")
end
Comment thread scripts/enumArch.py
Comment on lines +18 to +23
process = subprocess.Popen(
['llc', '-march=amdgcn', '-mcpu=help'],
shell=True,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE
)
Comment thread scripts/kernelCompile.py
Comment on lines +44 to +47
print(" ".join(command))

use_shell = (os.name == 'nt')
return subprocess.Popen(command, shell=use_shell)
Comment thread tools/stringify.py
Comment on lines +2 to +9
"""Stringify GPU kernel source files into C++ string literals.

Reads kernel source files and converts them into C++ const char* variables
that can be compiled directly into the binary.

Usage:
python stringify.py <kernel_file> [encryption_key]
"""
Comment thread tools/stringify.py
Comment on lines +73 to +76
def main():
if len(sys.argv) < 2:
print("Usage: {} <kernel_file> [encryption_key]".format(sys.argv[0]), file=sys.stderr)
sys.exit(1)
@shoikeda shoikeda marked this pull request as draft June 19, 2026 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants