Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VS support for multiple HIP SDK versions #203

Open
wants to merge 10 commits into
base: amd-staging
Choose a base branch
from
  •  
  •  
  •  
21 changes: 15 additions & 6 deletions Applications/bitonic_sort/bitonic_sort_vs2017.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@
<RootNamespace>bitonic_sort_vs2017</RootNamespace>
<WindowsTargetPlatformVersion>$(LatestTargetPlatformVersion)</WindowsTargetPlatformVersion>
</PropertyGroup>
<PropertyGroup>
<HIPVersionFileContents>$([System.IO.File]::ReadAllText('$(HIP_PATH)bin\.hipversion'))</HIPVersionFileContents>
<HIPVersionMajor>$(HIPVersionFileContents.Substring($([MSBuild]::Add($(HIPVersionFileContents.LastIndexOf("HIP_VERSION_MAJOR")),18)),2).Trim())</HIPVersionMajor>
<HIPVersionMinor>$(HIPVersionFileContents.Substring($([MSBuild]::Add($(HIPVersionFileContents.LastIndexOf("HIP_VERSION_MINOR")),18)),2).Trim())</HIPVersionMinor>
<HIPPathVersion>$(HIPVersionMajor).$(HIPVersionMinor)</HIPPathVersion>
</PropertyGroup>
<ItemGroup>
<ClCompile Include="main.hip" />
</ItemGroup>
Expand All @@ -28,13 +34,13 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>HIP clang 6.2</PlatformToolset>
<PlatformToolset>HIP clang $(HIPPathVersion)</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>HIP clang 6.2</PlatformToolset>
<PlatformToolset>HIP clang $(HIPPathVersion)</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(PlatformToolset.Contains(`HIP clang `))'">
Expand All @@ -56,6 +62,9 @@
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Condition="'$(PlatformToolset)'!='HIP nvcc $(HIPPathVersion)' and '$(PlatformToolset)'!='HIP clang $(HIPPathVersion)'">
<ProjectExcludedFromBuild>true</ProjectExcludedFromBuild>
</PropertyGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
Expand All @@ -70,7 +79,7 @@
<IntrinsicFunctions>true</IntrinsicFunctions>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64' and '$(PlatformToolset)'=='HIP clang $(HIPVersion)'">
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64' and $(PlatformToolset.Contains('HIP clang'))">
<ClCompile>
<WarningLevel>Level2</WarningLevel>
<PreprocessorDefinitions>__clang__;__HIP__;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
Expand All @@ -83,7 +92,7 @@
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64' and '$(PlatformToolset)'=='HIP nvcc $(HIPVersion)'">
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64' and $(PlatformToolset.Contains('HIP nvcc'))">
<ClCompile>
<WarningLevel>Level2</WarningLevel>
<PreprocessorDefinitions>__CUDACC__;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
Expand All @@ -96,7 +105,7 @@
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64' and '$(PlatformToolset)'=='HIP clang $(HIPVersion)'">
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64' and $(PlatformToolset.Contains('HIP clang'))">
<ClCompile>
<WarningLevel>Level2</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
Expand All @@ -111,7 +120,7 @@
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64' and '$(PlatformToolset)'=='HIP nvcc $(HIPVersion)'">
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64' and $(PlatformToolset.Contains('HIP nvcc'))">
<ClCompile>
<WarningLevel>Level2</WarningLevel>
<WholeProgramOptimization>true</WholeProgramOptimization>
Expand Down
21 changes: 15 additions & 6 deletions Applications/bitonic_sort/bitonic_sort_vs2019.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@
<RootNamespace>bitonic_sort_vs2019</RootNamespace>
<WindowsTargetPlatformVersion>$(LatestTargetPlatformVersion)</WindowsTargetPlatformVersion>
</PropertyGroup>
<PropertyGroup>
<HIPVersionFileContents>$([System.IO.File]::ReadAllText('$(HIP_PATH)bin\.hipversion'))</HIPVersionFileContents>
<HIPVersionMajor>$(HIPVersionFileContents.Substring($([MSBuild]::Add($(HIPVersionFileContents.LastIndexOf("HIP_VERSION_MAJOR")),18)),2).Trim())</HIPVersionMajor>
<HIPVersionMinor>$(HIPVersionFileContents.Substring($([MSBuild]::Add($(HIPVersionFileContents.LastIndexOf("HIP_VERSION_MINOR")),18)),2).Trim())</HIPVersionMinor>
<HIPPathVersion>$(HIPVersionMajor).$(HIPVersionMinor)</HIPPathVersion>
</PropertyGroup>
<ItemGroup>
<ClCompile Include="main.hip" />
</ItemGroup>
Expand All @@ -28,13 +34,13 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>HIP clang 6.2</PlatformToolset>
<PlatformToolset>HIP clang $(HIPPathVersion)</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>HIP clang 6.2</PlatformToolset>
<PlatformToolset>HIP clang $(HIPPathVersion)</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(PlatformToolset.Contains(`HIP clang `))'">
Expand All @@ -56,6 +62,9 @@
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Condition="'$(PlatformToolset)'!='HIP nvcc $(HIPPathVersion)' and '$(PlatformToolset)'!='HIP clang $(HIPPathVersion)'">
<ProjectExcludedFromBuild>true</ProjectExcludedFromBuild>
</PropertyGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
Expand All @@ -70,7 +79,7 @@
<IntrinsicFunctions>true</IntrinsicFunctions>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64' and '$(PlatformToolset)'=='HIP clang $(HIPVersion)'">
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64' and $(PlatformToolset.Contains('HIP clang'))">
<ClCompile>
<WarningLevel>Level2</WarningLevel>
<PreprocessorDefinitions>__clang__;__HIP__;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
Expand All @@ -83,7 +92,7 @@
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64' and '$(PlatformToolset)'=='HIP nvcc $(HIPVersion)'">
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64' and $(PlatformToolset.Contains('HIP nvcc'))">
<ClCompile>
<WarningLevel>Level2</WarningLevel>
<PreprocessorDefinitions>__CUDACC__;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
Expand All @@ -96,7 +105,7 @@
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64' and '$(PlatformToolset)'=='HIP clang $(HIPVersion)'">
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64' and $(PlatformToolset.Contains('HIP clang'))">
<ClCompile>
<WarningLevel>Level2</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
Expand All @@ -111,7 +120,7 @@
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64' and '$(PlatformToolset)'=='HIP nvcc $(HIPVersion)'">
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64' and $(PlatformToolset.Contains('HIP nvcc'))">
<ClCompile>
<WarningLevel>Level2</WarningLevel>
<WholeProgramOptimization>true</WholeProgramOptimization>
Expand Down
21 changes: 15 additions & 6 deletions Applications/bitonic_sort/bitonic_sort_vs2022.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@
<RootNamespace>bitonic_sort_vs2022</RootNamespace>
<WindowsTargetPlatformVersion>$(LatestTargetPlatformVersion)</WindowsTargetPlatformVersion>
</PropertyGroup>
<PropertyGroup>
<HIPVersionFileContents>$([System.IO.File]::ReadAllText('$(HIP_PATH)bin\.hipversion'))</HIPVersionFileContents>
<HIPVersionMajor>$(HIPVersionFileContents.Substring($([MSBuild]::Add($(HIPVersionFileContents.LastIndexOf("HIP_VERSION_MAJOR")),18)),2).Trim())</HIPVersionMajor>
<HIPVersionMinor>$(HIPVersionFileContents.Substring($([MSBuild]::Add($(HIPVersionFileContents.LastIndexOf("HIP_VERSION_MINOR")),18)),2).Trim())</HIPVersionMinor>
<HIPPathVersion>$(HIPVersionMajor).$(HIPVersionMinor)</HIPPathVersion>
</PropertyGroup>
<ItemGroup>
<ClCompile Include="main.hip" />
</ItemGroup>
Expand All @@ -28,13 +34,13 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>HIP clang 6.2</PlatformToolset>
<PlatformToolset>HIP clang $(HIPPathVersion)</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>HIP clang 6.2</PlatformToolset>
<PlatformToolset>HIP clang $(HIPPathVersion)</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(PlatformToolset.Contains(`HIP clang `))'">
Expand All @@ -56,6 +62,9 @@
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Condition="'$(PlatformToolset)'!='HIP nvcc $(HIPPathVersion)' and '$(PlatformToolset)'!='HIP clang $(HIPPathVersion)'">
<ProjectExcludedFromBuild>true</ProjectExcludedFromBuild>
</PropertyGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
Expand All @@ -70,7 +79,7 @@
<IntrinsicFunctions>true</IntrinsicFunctions>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64' and '$(PlatformToolset)'=='HIP clang $(HIPVersion)'">
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64' and $(PlatformToolset.Contains('HIP clang'))">
<ClCompile>
<WarningLevel>Level2</WarningLevel>
<PreprocessorDefinitions>__clang__;__HIP__;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
Expand All @@ -83,7 +92,7 @@
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64' and '$(PlatformToolset)'=='HIP nvcc $(HIPVersion)'">
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64' and $(PlatformToolset.Contains('HIP nvcc'))">
<ClCompile>
<WarningLevel>Level2</WarningLevel>
<PreprocessorDefinitions>__CUDACC__;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
Expand All @@ -96,7 +105,7 @@
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64' and '$(PlatformToolset)'=='HIP clang $(HIPVersion)'">
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64' and $(PlatformToolset.Contains('HIP clang'))">
<ClCompile>
<WarningLevel>Level2</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
Expand All @@ -111,7 +120,7 @@
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64' and '$(PlatformToolset)'=='HIP nvcc $(HIPVersion)'">
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64' and $(PlatformToolset.Contains('HIP nvcc'))">
<ClCompile>
<WarningLevel>Level2</WarningLevel>
<WholeProgramOptimization>true</WholeProgramOptimization>
Expand Down
21 changes: 15 additions & 6 deletions Applications/convolution/convolution_vs2017.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@
<RootNamespace>convolution_vs2017</RootNamespace>
<WindowsTargetPlatformVersion>$(LatestTargetPlatformVersion)</WindowsTargetPlatformVersion>
</PropertyGroup>
<PropertyGroup>
<HIPVersionFileContents>$([System.IO.File]::ReadAllText('$(HIP_PATH)bin\.hipversion'))</HIPVersionFileContents>
<HIPVersionMajor>$(HIPVersionFileContents.Substring($([MSBuild]::Add($(HIPVersionFileContents.LastIndexOf("HIP_VERSION_MAJOR")),18)),2).Trim())</HIPVersionMajor>
<HIPVersionMinor>$(HIPVersionFileContents.Substring($([MSBuild]::Add($(HIPVersionFileContents.LastIndexOf("HIP_VERSION_MINOR")),18)),2).Trim())</HIPVersionMinor>
<HIPPathVersion>$(HIPVersionMajor).$(HIPVersionMinor)</HIPPathVersion>
</PropertyGroup>
<ItemGroup>
<ClCompile Include="main.hip" />
</ItemGroup>
Expand All @@ -28,13 +34,13 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>HIP clang 6.2</PlatformToolset>
<PlatformToolset>HIP clang $(HIPPathVersion)</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>HIP clang 6.2</PlatformToolset>
<PlatformToolset>HIP clang $(HIPPathVersion)</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(PlatformToolset.Contains(`HIP clang `))'">
Expand All @@ -56,6 +62,9 @@
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Condition="'$(PlatformToolset)'!='HIP nvcc $(HIPPathVersion)' and '$(PlatformToolset)'!='HIP clang $(HIPPathVersion)'">
<ProjectExcludedFromBuild>true</ProjectExcludedFromBuild>
</PropertyGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
Expand All @@ -70,7 +79,7 @@
<IntrinsicFunctions>true</IntrinsicFunctions>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64' and '$(PlatformToolset)'=='HIP clang $(HIPVersion)'">
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64' and $(PlatformToolset.Contains('HIP clang'))">
<ClCompile>
<WarningLevel>Level2</WarningLevel>
<PreprocessorDefinitions>__clang__;__HIP__;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
Expand All @@ -83,7 +92,7 @@
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64' and '$(PlatformToolset)'=='HIP nvcc $(HIPVersion)'">
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64' and $(PlatformToolset.Contains('HIP nvcc'))">
<ClCompile>
<WarningLevel>Level2</WarningLevel>
<PreprocessorDefinitions>__CUDACC__;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
Expand All @@ -96,7 +105,7 @@
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64' and '$(PlatformToolset)'=='HIP clang $(HIPVersion)'">
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64' and $(PlatformToolset.Contains('HIP clang'))">
<ClCompile>
<WarningLevel>Level2</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
Expand All @@ -111,7 +120,7 @@
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64' and '$(PlatformToolset)'=='HIP nvcc $(HIPVersion)'">
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64' and $(PlatformToolset.Contains('HIP nvcc'))">
<ClCompile>
<WarningLevel>Level2</WarningLevel>
<WholeProgramOptimization>true</WholeProgramOptimization>
Expand Down
Loading