Skip to content

Commit

Permalink
Created Seperated Classes for Sparse and Dense Objects
Browse files Browse the repository at this point in the history
  • Loading branch information
GlockPL committed Jun 5, 2024
1 parent 95d7171 commit 0db3783
Show file tree
Hide file tree
Showing 9 changed files with 739 additions and 0 deletions.
63 changes: 63 additions & 0 deletions .github/workflows/cmake-multi-platform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,66 @@ jobs:
# Execute tests defined by the CMake configuration. Note that --build-config is needed because the default Windows generator is a multi-config generator (Visual Studio generator).
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: ctest --build-config ${{ matrix.build_type }}


name: CUDA CMake Multi-Platform Build

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
include:
- os: ubuntu-latest
cuda: '12.1.0'
- os: windows-latest
cuda: '12.1.0'
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up CUDA
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y wget
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-repo-ubuntu2004_${{ matrix.cuda }}-1_amd64.deb
sudo dpkg -i cuda-repo-ubuntu2004_${{ matrix.cuda }}-1_amd64.deb
sudo apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/7fa2af80.pub
sudo apt-get update
sudo apt-get -y install cuda
shell: bash

- name: Set up CUDA on Windows
if: matrix.os == 'windows-latest'
run: |
choco install cuda --version=${{ matrix.cuda }}
shell: powershell

- name: Add CUDA to PATH on Ubuntu
if: matrix.os == 'ubuntu-latest'
run: echo "/usr/local/cuda-${{ matrix.cuda }}/bin" >> $GITHUB_PATH
shell: bash

- name: Add CUDA to PATH on Windows
if: matrix.os == 'windows-latest'
run: echo "C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v${{ matrix.cuda }}\\bin" >> $Env:GITHUB_PATH
shell: powershell

- name: Configure CMake
run: mkdir build && cd build && cmake ..
shell: bash

- name: Build with CMake
run: cmake --build build --config Release
shell: bash

11 changes: 11 additions & 0 deletions CudaMaxCutPlanted/CudaMaxCutPlanted.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<PublicIncludeDirectories>
</PublicIncludeDirectories>
<ExternalIncludePath>$(VC_IncludePath);$(WindowsSDK_IncludePath);$(CUDA_PATH)\include</ExternalIncludePath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
Expand Down Expand Up @@ -81,13 +86,19 @@
<TargetMachinePlatform>64</TargetMachinePlatform>
<AdditionalOptions>-allow-unsupported-compiler %(AdditionalOptions)</AdditionalOptions>
<Runtime>MT</Runtime>
<Defines>__CUDACC__</Defines>
</CudaCompile>
</ItemDefinitionGroup>
<ItemGroup>
<CudaCompile Include="CudaSparseMatrix.cu" />
<CudaCompile Include="kernel.cu" />
<CudaCompile Include="SparseMatrixSumKernel.cu" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="CudaSparseMatrix.hpp" />
<ClInclude Include="indicators.hpp" />
<ClInclude Include="intellisense_cuda_intrinsics.h" />
<ClInclude Include="SparseMatrixSumKernel.cuh" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
Expand Down
29 changes: 29 additions & 0 deletions CudaMaxCutPlanted/CudaMaxCutPlanted.vcxproj.filters
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<CudaCompile Include="kernel.cu" />
<CudaCompile Include="CudaSparseMatrix.cu">
<Filter>Objects</Filter>
</CudaCompile>
<CudaCompile Include="SparseMatrixSumKernel.cu">
<Filter>Objects</Filter>
</CudaCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="indicators.hpp" />
<ClInclude Include="CudaSparseMatrix.hpp">
<Filter>Objects</Filter>
</ClInclude>
<ClInclude Include="intellisense_cuda_intrinsics.h">
<Filter>Objects</Filter>
</ClInclude>
<ClInclude Include="SparseMatrixSumKernel.cuh">
<Filter>Objects</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<Filter Include="Objects">
<UniqueIdentifier>{18091014-bd5e-4043-84b0-eb5610c3f083}</UniqueIdentifier>
</Filter>
</ItemGroup>
</Project>
Loading

0 comments on commit 0db3783

Please sign in to comment.