Skip to content

Commit ccd77bd

Browse files
committed
Set CUDA heap size explicitly
1 parent a901222 commit ccd77bd

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

standalone/source/main.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#include <tuple>
1010
#include <utility>
1111
#include <variant>
12-
#ifdef alpaka_ACC_GPU_CUDA_ENABLED
12+
#ifdef ALPAKA_ACC_GPU_CUDA_ENABLED
1313
# include <cuda_runtime.h>
1414
#endif // alpaka_ACC_GPU_CUDA_ENABLE
1515

@@ -41,8 +41,11 @@ namespace membenchmc::Actions {
4141
auto makeExecutionDetails() {
4242
auto const platformAcc = alpaka::Platform<Acc>{};
4343
auto const dev = alpaka::getDevByIdx(platformAcc, 0);
44+
#ifdef ALPAKA_ACC_GPU_CUDA_ENABLED
45+
cudaDeviceSetLimit(cudaLimitMallocHeapSize, 1024U * 1024U * 1024U);
46+
#endif
4447
uint32_t const numThreadsPerBlock = 256U;
45-
uint32_t const numThreads = 8U * numThreadsPerBlock;
48+
uint32_t const numThreads = 4U * numThreadsPerBlock;
4649
auto workdiv = [numThreads, numThreadsPerBlock]() -> alpaka::WorkDivMembers<Dim, Idx> {
4750
if constexpr (std::is_same_v<alpaka::AccToTag<Acc>, alpaka::TagCpuSerial>) {
4851
return {{1U}, {1U}, {numThreads}};
@@ -175,8 +178,6 @@ struct IotaReductionChecker {
175178
if (range.data() == nullptr) {
176179
return std::make_tuple(Actions::CHECK, Payload(std::make_pair(false, Reason::nullpointer)));
177180
}
178-
static_assert(decltype(isSpan(range))::value,
179-
"We expected a span pointing to the allocated memory here.");
180181
auto uintRange = convertDataType<uint32_t>(range);
181182
std::iota(std::begin(uintRange), std::end(uintRange), currentValue);
182183
size_t n = uintRange.size();
@@ -222,7 +223,7 @@ template <typename T> struct AcumulateChecksProvider {
222223
namespace setups {
223224
struct SingleSizeMallocRecipe {
224225
static constexpr std::uint32_t allocationSize{ALLOCATION_SIZE};
225-
static constexpr std::uint32_t numAllocations{16U};
226+
static constexpr std::uint32_t numAllocations{256U};
226227
std::array<std::byte*, numAllocations> pointers{{}};
227228
std::uint32_t counter{0U};
228229

0 commit comments

Comments
 (0)