Skip to content

Commit 6393bc4

Browse files
codexpsychocoderHPC
authored andcommitted
Update mallocMC examples for alpaka3 macros
1 parent 1cfd563 commit 6393bc4

4 files changed

Lines changed: 16 additions & 17 deletions

File tree

examples/getAvailableSlots/source/main.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include <mallocMC/alignmentPolicies/Shrink.hpp>
1111
#include <mallocMC/allocator.hpp>
1212
#include <mallocMC/creationPolicies/FlatterScatter.hpp>
13+
#include <mallocMC/creationPolicies/GallatinCuda.hpp>
1314
#include <mallocMC/distributionPolicies/Noop.hpp>
1415
#include <mallocMC/oOMPolicies/ReturnNull.hpp>
1516
#include <mallocMC/reservePoolPolicies/AlpakaBuf.hpp>
@@ -131,11 +132,15 @@ auto main() -> int
131132
result = runExample<Executor, Scatter<FlatterScatterHeapConfig>, mallocMC::ReservePoolPolicies::AlpakaBuf>(
132133
deviceSpec,
133134
exec);
134-
#ifdef ALPAKA_ACC_GPU_CUDA_ENABLED
135+
#if ALPAKA_LANG_CUDA
135136
# ifdef mallocMC_HAS_Gallatin_AVAILABLE
136137
if(result == EXIT_SUCCESS)
137138
{
138-
result = EXIT_SUCCESS;
139+
result = runExample<
140+
Executor,
141+
mallocMC::CreationPolicies::GallatinCuda<>,
142+
mallocMC::ReservePoolPolicies::Noop,
143+
mallocMC::AlignmentPolicies::Noop>(deviceSpec, exec);
139144
}
140145
# endif
141146
#endif

examples/vectorAdd/source/main.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@
44

55
#include <alpaka/alpaka.hpp>
66

7+
#include <mallocMC/alignmentPolicies/Noop.hpp>
78
#include <mallocMC/alignmentPolicies/Shrink.hpp>
89
#include <mallocMC/allocator.hpp>
910
#include <mallocMC/creationPolicies/FlatterScatter.hpp>
11+
#include <mallocMC/creationPolicies/GallatinCuda.hpp>
1012
#include <mallocMC/creationPolicies/OldMalloc.hpp>
1113
#include <mallocMC/creationPolicies/Scatter.hpp>
1214
#include <mallocMC/distributionPolicies/Noop.hpp>
@@ -173,11 +175,15 @@ auto main() -> int
173175
result = runExample<Executor, Scatter<FlatterScatterHeapConfig>, mallocMC::ReservePoolPolicies::AlpakaBuf>(
174176
deviceSpec,
175177
exec);
176-
#ifdef ALPAKA_ACC_GPU_CUDA_ENABLED
178+
#if ALPAKA_LANG_CUDA
177179
# ifdef mallocMC_HAS_Gallatin_AVAILABLE
178180
if(result == EXIT_SUCCESS)
179181
{
180-
result = EXIT_SUCCESS;
182+
result = runExample<
183+
Executor,
184+
mallocMC::CreationPolicies::GallatinCuda<>,
185+
mallocMC::ReservePoolPolicies::Noop,
186+
mallocMC::AlignmentPolicies::Noop>(deviceSpec, exec);
181187
}
182188
# endif
183189
#endif

include/mallocMC/reservePoolPolicies/CudaSetLimits.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
#pragma once
3030

31-
#ifdef ALPAKA_ACC_GPU_CUDA_ENABLED
31+
#if ALPAKA_LANG_CUDA
3232

3333
# include "CudaSetLimits.hpp"
3434

test/multithreaded/source/BitField.cpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,6 @@ using mallocMC::CreationPolicies::FlatterScatterAlloc::BitMask;
4040
using mallocMC::CreationPolicies::FlatterScatterAlloc::BitMaskSize;
4141
using namespace std::chrono_literals;
4242

43-
// The following test is a particular regression test which (in its current form) requires to be able to stop a
44-
// thread from the outside. This is not possible through the alpaka interface. Thus, we resort to running this with
45-
// `std::jthread` but we have to ensure that the alpaka atomics work. Thus, the ifdef.
46-
#ifdef ALPAKA_ACC_CPU_B_SEQ_T_THREADS_ENABLED
47-
4843
TEST_CASE("Threaded BitMask")
4944
{
5045
BitMask mask{};
@@ -81,10 +76,3 @@ TEST_CASE("Threaded BitMask")
8176
noiseThread.request_stop();
8277
}
8378
}
84-
#else
85-
TEST_CASE("Threaded BitMask", "[!shouldfail]")
86-
{
87-
FAIL("The Threaded BitMask regression test could not run because it is only available with the std::threads "
88-
"backend enabled.");
89-
}
90-
#endif // ALPAKA_ACC_CPU_B_SEQ_T_THREADS_ENABLED

0 commit comments

Comments
 (0)