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

Add more CUDA builds to CI #317

Merged
merged 2 commits into from
Jul 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,20 @@ jobs:
fail-fast: false
matrix:
include:
- name: build-ubuntu-gcc9-cuda
env: {CXX: g++-9, CUDA_INSTALLER: cuda_11.2.0_460.27.04_linux.run}
#- name: build-ubuntu-gcc9-cuda11.0
# env: {CXX: g++-9, CUDA_URL: "https://developer.download.nvidia.com/compute/cuda/11.0.3/local_installers/cuda_11.0.3_450.51.06_linux.run"}
# cuda: true
#- name: build-ubuntu-gcc9-cuda11.1
# env: {CXX: g++-9, CUDA_URL: "https://developer.download.nvidia.com/compute/cuda/11.1.1/local_installers/cuda_11.1.1_455.32.00_linux.run"}
# cuda: true
- name: build-ubuntu-gcc9-cuda11.2
env: {CXX: g++-9, CUDA_URL: "https://developer.download.nvidia.com/compute/cuda/11.2.1/local_installers/cuda_11.2.1_460.32.03_linux.run"}
cuda: true
- name: build-ubuntu-gcc9-cuda11.3
env: {CXX: g++-9, CUDA_URL: "https://developer.download.nvidia.com/compute/cuda/11.3.1/local_installers/cuda_11.3.1_465.19.01_linux.run"}
cuda: true
- name: build-ubuntu-gcc9-cuda11.4
env: {CXX: g++-9, CUDA_URL: "https://developer.download.nvidia.com/compute/cuda/11.4.0/local_installers/cuda_11.4.0_470.42.01_linux.run"}
cuda: true
- name: build-ubuntu-gcc10
env: {CXX: g++-10}
Expand Down Expand Up @@ -123,11 +135,11 @@ jobs:
- name: download CUDA 11
if: ${{ matrix.cuda }}
run: |
wget --no-verbose https://developer.download.nvidia.com/compute/cuda/11.2.0/local_installers/$CUDA_INSTALLER
wget --no-verbose -O cuda_installer.run $CUDA_URL
- name: install CUDA 11
if: ${{ matrix.cuda }}
run: |
sudo sh $CUDA_INSTALLER --silent --toolkit
sudo sh cuda_installer.run --silent --toolkit
- name: install alpaka
run: |
if [ ${{ matrix.intel }} ]; then source /opt/intel/oneapi/setvars.sh; fi
Expand Down
10 changes: 5 additions & 5 deletions examples/alpaka/nbody/nbody.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ struct UpdateKernel
{
constexpr auto sharedMapping = []
{
constexpr auto arrayDims = llama::ArrayDims{BlockSize};
constexpr auto arrayDims = llama::ArrayDims<1>{BlockSize};
if constexpr (MappingSM == AoS)
return llama::mapping::AoS{arrayDims, Particle{}};
if constexpr (MappingSM == SoA)
Expand All @@ -180,7 +180,7 @@ struct UpdateKernel
// TODO: we could optimize here, because only velocity is ever updated
auto pi = [&]
{
constexpr auto arrayDims = llama::ArrayDims{Elems};
constexpr auto arrayDims = llama::ArrayDims<1>{Elems};
constexpr auto mapping
= llama::mapping::SoA<typename View::ArrayDims, typename View::RecordDim, false>{arrayDims};
constexpr auto blobAlloc = llama::bloballoc::Stack<llama::sizeOf<typename View::RecordDim> * Elems>{};
Expand Down Expand Up @@ -266,7 +266,7 @@ void run(std::ostream& plotFile)
{
const auto arrayDims = llama::ArrayDims{PROBLEM_SIZE};
if constexpr (MappingGM == AoS)
return llama::mapping::AoS{arrayDims, Particle{}};
return llama::mapping::AoS<decltype(arrayDims), Particle>{arrayDims};
if constexpr (MappingGM == SoA)
return llama::mapping::SoA<decltype(arrayDims), Particle, false>{arrayDims};
// if constexpr (MappingGM == 2)
Expand All @@ -284,8 +284,8 @@ void run(std::ostream& plotFile)

watch.printAndReset("alloc");

auto hostView = llama::View{mapping, llama::Array{alpaka::getPtrNative(hostBuffer)}};
auto accView = llama::View{mapping, llama::Array{alpaka::getPtrNative(accBuffer)}};
auto hostView = llama::View(mapping, llama::Array{alpaka::getPtrNative(hostBuffer)});
auto accView = llama::View(mapping, llama::Array{alpaka::getPtrNative(accBuffer)});

watch.printAndReset("views");

Expand Down
4 changes: 2 additions & 2 deletions examples/alpaka/vectoradd/vectoradd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@ try
{
const auto arrayDims = llama::ArrayDims{PROBLEM_SIZE};
if constexpr (MAPPING == 0)
return llama::mapping::AoS{arrayDims, Vector{}};
return llama::mapping::AoS<decltype(arrayDims), Vector>{arrayDims};
if constexpr (MAPPING == 1)
return llama::mapping::SoA<decltype(arrayDims), Vector, false>{arrayDims, Vector{}};
return llama::mapping::SoA<decltype(arrayDims), Vector, false>{arrayDims};
if constexpr (MAPPING == 2)
return llama::mapping::SoA<decltype(arrayDims), Vector, true>{arrayDims};
if constexpr (MAPPING == 3)
Expand Down
10 changes: 5 additions & 5 deletions examples/cuda/nbody/nbody.cu
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,9 @@ __global__ void updateSM(View particles)
{
constexpr auto arrayDims = llama::ArrayDims{SHARED_ELEMENTS_PER_BLOCK};
if constexpr (MappingSM == 0)
return llama::mapping::AoS{arrayDims, SharedMemoryParticle{}};
return llama::mapping::AoS<decltype(arrayDims), SharedMemoryParticle>{arrayDims};
if constexpr (MappingSM == 1)
return llama::mapping::SoA{arrayDims, SharedMemoryParticle{}};
return llama::mapping::SoA<decltype(arrayDims), SharedMemoryParticle, false>{arrayDims};
if constexpr (MappingSM == 2)
return llama::mapping::SoA<decltype(arrayDims), SharedMemoryParticle, true>{arrayDims};
if constexpr (MappingSM == 3)
Expand Down Expand Up @@ -180,11 +180,11 @@ try
{
const auto arrayDims = llama::ArrayDims{PROBLEM_SIZE};
if constexpr (Mapping == 0)
return llama::mapping::AoS{arrayDims, Particle{}};
return llama::mapping::AoS<decltype(arrayDims), Particle>{arrayDims};
if constexpr (Mapping == 1)
return llama::mapping::SoA{arrayDims, Particle{}};
return llama::mapping::SoA<decltype(arrayDims), Particle, false>{arrayDims};
if constexpr (Mapping == 2)
return llama::mapping::SoA<decltype(arrayDims), Particle, true>{arrayDims, Particle{}};
return llama::mapping::SoA<decltype(arrayDims), Particle, true>{arrayDims};
if constexpr (Mapping == 3)
return llama::mapping::AoSoA<decltype(arrayDims), Particle, AOSOA_LANES>{arrayDims};
if constexpr (Mapping == 4)
Expand Down