Skip to content

Commit

Permalink
Resolve "Generate VS files from external meta-data repository"
Browse files Browse the repository at this point in the history
  • Loading branch information
Snektron authored and MKKnorr committed Dec 13, 2024
1 parent f8cb857 commit 301d243
Show file tree
Hide file tree
Showing 379 changed files with 4,394 additions and 5,967 deletions.
49 changes: 33 additions & 16 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,14 @@ include:
- /gpus-rocm.yaml
- /gpus-nvcc.yaml
- /rules.yaml
- project: 'amd/libraries/examples-registry'
ref: main
file:
- /.gitlab/setup-pdm.yml

variables:
# Temporary suppress warnings due to nvidia_hip_runtime_api bug
# See https://github.com/ROCm/hipother/issues/2
CUDA_WARNING_SUPPRESS_FLAGS: ",-Wno-missing-field-initializers,-Wno-deprecated-declarations,-Wno-sign-compare,-Wno-return-local-addr -diag-suppress=1056"
CUDA_FLAGS: "-Xcompiler -Wall,-Wextra,-Werror${CUDA_WARNING_SUPPRESS_FLAGS} --Werror all-warnings"
# We require '-Wno-unused-command-line-argument' due to the following warning:
Expand Down Expand Up @@ -95,6 +100,24 @@ check-vs-files:
- python3 -m pip install rich
- Scripts/VisualStudio/check_vs_files.py

check-registry-consistency:
image: python:3.11
stage: lint
needs: []
tags:
- build
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
extends:
- .setup-pdm
script:
- apt-get update -qq
- apt-get install -qq git
- git clone https://gitlab-ci-token:${CI_JOB_TOKEN}@${CI_SERVER_HOST}/amd/libraries/examples-registry /examples-registry
- cd /examples-registry
- pdm sync --clean
- COLUMNS=1000 FORCE_COLOR=1 pdm run generate --check $CI_PROJECT_DIR

.build:dockerfiles:
timeout: 60m
image:
Expand Down Expand Up @@ -288,6 +311,7 @@ test:cuda:
.test:windows-vs:
stage: test
timeout: 30m
needs: []
extends:
- .rules:test
parallel:
Expand Down Expand Up @@ -324,7 +348,10 @@ test:cuda:
"/p:CL_MPCount=8"
"/verbosity:minimal"
"/validate"
"/warnAsError"
# Disable errors caused by warnings
# This is required as a workaround for issues in hipother
# See https://github.com/ROCm/hipother/issues/2
# "/warnAsError"
# MSBuild cannot properly resolve the `<Content Include=` dependencies, and will sometimes try to copy
# two or more files at once. This results in a warning before it retries, which is counted towards
# /warnAsError by default. For this reason, we disable the relevant warning (MSB3026).
Expand All @@ -347,19 +374,9 @@ test:windows-rocm-vs:
variables:
SOLUTION_PREFIX: ROCm-Examples-VS
# hip_vulkan_interop: graphical
# applications_monte_carlo_pi: broken with new SDK (5.7 v66)
# hipfft/rocfft_*: broken with new SDK (5.7 v66)
SkippedExamples: >
hip_vulkan_interop_*.exe,
applications_monte_carlo_pi_*.exe,
hipfft_plan_d2z_*.exe,
hipfft_plan_z2z_*.exe,
hipfft_plan_many_2d_r2c_*.exe,
hipfft_plan_many_2d_z2z_*.exe,
hipfft_setworkarea_*.exe,
rocfft_complex_complex_*.exe,
rocfft_complex_real_*.exe,
rocfft_real_complex_*.exe
hip_opengl_interop_*.exe,
test:windows-nvcc-vs:
extends:
- .test:windows-nvcc
Expand All @@ -368,16 +385,16 @@ test:windows-nvcc-vs:
- nvcc-windows
variables:
SOLUTION_PREFIX: ROCm-Examples-Portable-VS
# NVCC examples broken with new SDK (5.7 v66)
# hip_cooperative_groups: unsupported on this GPU
SkippedExamples: >
*.exe
hip_cooperative_groups_*.exe
before_script:
# To test for NVIDIA, we need to set the platform toolset to HIP_nvcc. This cannot be done with /p:PlatformToolset
# To test for NVIDIA, we need to set the platform toolset to HIP nvcc. This cannot be done with /p:PlatformToolset
# though, as some examples use the regular msvc toolchain.
- |
Foreach ($f in (Get-ChildItem -Recurse -Filter "*.vcxproj" "$CI_PROJECT_DIR").FullName) {
(Get-Content $f) |
% { $_ -replace "<PlatformToolset>HIP_clang</PlatformToolset>","<PlatformToolset>HIP_nvcc</PlatformToolset>" } |
% { $_ -replace "<PlatformToolset>HIP clang","<PlatformToolset>HIP nvcc" } |
Set-Content $f
}
Expand Down
5 changes: 1 addition & 4 deletions .gitlab/merge_request_templates/example.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@ _The reviewer should acknowledge all these topics._
- [ ] CMake support is added
- [ ] Dependencies are copied via `IMPORTED_RUNTIME_ARTIFACTS` if applicable
- [ ] GNU Make support is added (Linux)
- [ ] Visual Studio project is added for VS2017, 2019, 2022 (Windows) (use [the script](https://projects.streamhpc.com/departments/knowledge/employee-handbook/-/wikis/Projects/AMD/Libraries/examples/Adding-Visual-Studio-Projects-to-new-examples#scripts))
- [ ] DLL dependencies are copied via `<Content Include`
- [ ] Visual Studio project is added to `ROCm-Examples-vs*.sln` (ROCm)
- [ ] Visual Studio project is added to `ROCm-Examples-Portable-vs*.sln` (ROCm/CUDA) if applicable
- [ ] Visual Studio project definitions are added to the [Examples Registry](https://projects.streamhpc.com/amd/libraries/examples-registry). See [Examples Registry - adding a new example](https://projects.streamhpc.com/amd/libraries/examples-registry#adding-a-new-example) and [Examples Registry - registry file documentation](https://projects.streamhpc.com/amd/libraries/examples-registry#registry).
- [ ] Inline code documentation is added
- [ ] README is added according to template
- [ ] Related READMEs, ToC are updated
Expand Down
15 changes: 6 additions & 9 deletions Applications/bitonic_sort/bitonic_sort_vs2017.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>15.0</VCProjectVersion>
<ProjectGuid>{265F7154-A362-45FA-B300-DB74E14BA010}</ProjectGuid>
<ProjectGuid>{265f7154-a362-45fa-b300-db74e14ba010}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>bitonic_sort_vs2017</RootNamespace>
<WindowsTargetPlatformVersion>$(LatestTargetPlatformVersion)</WindowsTargetPlatformVersion>
Expand Down Expand Up @@ -65,7 +65,7 @@
<LinkIncremental>false</LinkIncremental>
<TargetName>applications_$(ProjectName)</TargetName>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ItemDefinitionGroup>
<ClCompile>
<IntrinsicFunctions>true</IntrinsicFunctions>
</ClCompile>
Expand All @@ -74,8 +74,8 @@
<ClCompile>
<WarningLevel>Level2</WarningLevel>
<PreprocessorDefinitions>__clang__;__HIP__;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<LanguageStandard>stdcpp17</LanguageStandard>
<AdditionalIncludeDirectories>$(MSBuildProjectDirectory)\..\..\Common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<LanguageStandard>stdcpp17</LanguageStandard>
<RuntimeTypeInfo>true</RuntimeTypeInfo>
</ClCompile>
<Link>
Expand All @@ -87,8 +87,8 @@
<ClCompile>
<WarningLevel>Level2</WarningLevel>
<PreprocessorDefinitions>__CUDACC__;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<LanguageStandard>stdcpp17</LanguageStandard>
<AdditionalIncludeDirectories>$(MSBuildProjectDirectory)\..\..\Common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<LanguageStandard>stdcpp17</LanguageStandard>
<RuntimeTypeInfo>true</RuntimeTypeInfo>
</ClCompile>
<Link>
Expand All @@ -101,8 +101,8 @@
<WarningLevel>Level2</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PreprocessorDefinitions>__clang__;__HIP__;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<LanguageStandard>stdcpp17</LanguageStandard>
<AdditionalIncludeDirectories>$(MSBuildProjectDirectory)\..\..\Common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<LanguageStandard>stdcpp17</LanguageStandard>
<RuntimeTypeInfo>true</RuntimeTypeInfo>
</ClCompile>
<Link>
Expand All @@ -114,17 +114,14 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64' and '$(PlatformToolset)'=='HIP nvcc $(HIPVersion)'">
<ClCompile>
<WarningLevel>Level2</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PreprocessorDefinitions>__CUDACC__;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<LanguageStandard>stdcpp17</LanguageStandard>
<AdditionalIncludeDirectories>$(MSBuildProjectDirectory)\..\..\Common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<LanguageStandard>stdcpp17</LanguageStandard>
<RuntimeTypeInfo>true</RuntimeTypeInfo>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
</Link>
</ItemDefinitionGroup>
Expand Down
4 changes: 2 additions & 2 deletions Applications/bitonic_sort/bitonic_sort_vs2017.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\Common\example_utils.hpp">
<ClInclude Include="..\..\Common\cmdparser.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\Common\cmdparser.hpp">
<ClInclude Include="..\..\Common\example_utils.hpp">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
Expand Down
15 changes: 6 additions & 9 deletions Applications/bitonic_sort/bitonic_sort_vs2019.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion>
<ProjectGuid>{D0112253-C970-41CA-998B-83F9AA2F0A0B}</ProjectGuid>
<ProjectGuid>{d0112253-c970-41ca-998b-83f9aa2f0a0b}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>bitonic_sort_vs2019</RootNamespace>
<WindowsTargetPlatformVersion>$(LatestTargetPlatformVersion)</WindowsTargetPlatformVersion>
Expand Down Expand Up @@ -65,7 +65,7 @@
<LinkIncremental>false</LinkIncremental>
<TargetName>applications_$(ProjectName)</TargetName>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ItemDefinitionGroup>
<ClCompile>
<IntrinsicFunctions>true</IntrinsicFunctions>
</ClCompile>
Expand All @@ -74,8 +74,8 @@
<ClCompile>
<WarningLevel>Level2</WarningLevel>
<PreprocessorDefinitions>__clang__;__HIP__;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<LanguageStandard>stdcpp17</LanguageStandard>
<AdditionalIncludeDirectories>$(MSBuildProjectDirectory)\..\..\Common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<LanguageStandard>stdcpp17</LanguageStandard>
<RuntimeTypeInfo>true</RuntimeTypeInfo>
</ClCompile>
<Link>
Expand All @@ -87,8 +87,8 @@
<ClCompile>
<WarningLevel>Level2</WarningLevel>
<PreprocessorDefinitions>__CUDACC__;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<LanguageStandard>stdcpp17</LanguageStandard>
<AdditionalIncludeDirectories>$(MSBuildProjectDirectory)\..\..\Common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<LanguageStandard>stdcpp17</LanguageStandard>
<RuntimeTypeInfo>true</RuntimeTypeInfo>
</ClCompile>
<Link>
Expand All @@ -101,8 +101,8 @@
<WarningLevel>Level2</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PreprocessorDefinitions>__clang__;__HIP__;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<LanguageStandard>stdcpp17</LanguageStandard>
<AdditionalIncludeDirectories>$(MSBuildProjectDirectory)\..\..\Common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<LanguageStandard>stdcpp17</LanguageStandard>
<RuntimeTypeInfo>true</RuntimeTypeInfo>
</ClCompile>
<Link>
Expand All @@ -114,17 +114,14 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64' and '$(PlatformToolset)'=='HIP nvcc $(HIPVersion)'">
<ClCompile>
<WarningLevel>Level2</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PreprocessorDefinitions>__CUDACC__;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<LanguageStandard>stdcpp17</LanguageStandard>
<AdditionalIncludeDirectories>$(MSBuildProjectDirectory)\..\..\Common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<LanguageStandard>stdcpp17</LanguageStandard>
<RuntimeTypeInfo>true</RuntimeTypeInfo>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
</Link>
</ItemDefinitionGroup>
Expand Down
4 changes: 2 additions & 2 deletions Applications/bitonic_sort/bitonic_sort_vs2019.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\Common\example_utils.hpp">
<ClInclude Include="..\..\Common\cmdparser.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\Common\cmdparser.hpp">
<ClInclude Include="..\..\Common\example_utils.hpp">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
Expand Down
15 changes: 6 additions & 9 deletions Applications/bitonic_sort/bitonic_sort_vs2022.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>17.0</VCProjectVersion>
<ProjectGuid>{E4170146-420D-4084-BE3B-E0D973CE5818}</ProjectGuid>
<ProjectGuid>{e4170146-420d-4084-be3b-e0d973ce5818}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>bitonic_sort_vs2022</RootNamespace>
<WindowsTargetPlatformVersion>$(LatestTargetPlatformVersion)</WindowsTargetPlatformVersion>
Expand Down Expand Up @@ -65,7 +65,7 @@
<LinkIncremental>false</LinkIncremental>
<TargetName>applications_$(ProjectName)</TargetName>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ItemDefinitionGroup>
<ClCompile>
<IntrinsicFunctions>true</IntrinsicFunctions>
</ClCompile>
Expand All @@ -74,8 +74,8 @@
<ClCompile>
<WarningLevel>Level2</WarningLevel>
<PreprocessorDefinitions>__clang__;__HIP__;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<LanguageStandard>stdcpp17</LanguageStandard>
<AdditionalIncludeDirectories>$(MSBuildProjectDirectory)\..\..\Common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<LanguageStandard>stdcpp17</LanguageStandard>
<RuntimeTypeInfo>true</RuntimeTypeInfo>
</ClCompile>
<Link>
Expand All @@ -87,8 +87,8 @@
<ClCompile>
<WarningLevel>Level2</WarningLevel>
<PreprocessorDefinitions>__CUDACC__;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<LanguageStandard>stdcpp17</LanguageStandard>
<AdditionalIncludeDirectories>$(MSBuildProjectDirectory)\..\..\Common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<LanguageStandard>stdcpp17</LanguageStandard>
<RuntimeTypeInfo>true</RuntimeTypeInfo>
</ClCompile>
<Link>
Expand All @@ -101,8 +101,8 @@
<WarningLevel>Level2</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PreprocessorDefinitions>__clang__;__HIP__;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<LanguageStandard>stdcpp17</LanguageStandard>
<AdditionalIncludeDirectories>$(MSBuildProjectDirectory)\..\..\Common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<LanguageStandard>stdcpp17</LanguageStandard>
<RuntimeTypeInfo>true</RuntimeTypeInfo>
</ClCompile>
<Link>
Expand All @@ -114,17 +114,14 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64' and '$(PlatformToolset)'=='HIP nvcc $(HIPVersion)'">
<ClCompile>
<WarningLevel>Level2</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PreprocessorDefinitions>__CUDACC__;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<LanguageStandard>stdcpp17</LanguageStandard>
<AdditionalIncludeDirectories>$(MSBuildProjectDirectory)\..\..\Common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<LanguageStandard>stdcpp17</LanguageStandard>
<RuntimeTypeInfo>true</RuntimeTypeInfo>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
</Link>
</ItemDefinitionGroup>
Expand Down
4 changes: 2 additions & 2 deletions Applications/bitonic_sort/bitonic_sort_vs2022.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\Common\example_utils.hpp">
<ClInclude Include="..\..\Common\cmdparser.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\Common\cmdparser.hpp">
<ClInclude Include="..\..\Common\example_utils.hpp">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
Expand Down
Loading

0 comments on commit 301d243

Please sign in to comment.