30
30
31
31
#include < alpaka/alpaka.hpp>
32
32
33
- #ifdef ALPAKA_ACC_GPU_CUDA_ENABLED
33
+ #ifdef mallocMC_HAS_Gallatin_AVAILABLE
34
34
# include < gallatin/allocators/gallatin.cuh>
35
35
#else
36
36
@@ -45,6 +45,23 @@ namespace gallatin::allocators
45
45
{
46
46
return nullptr ;
47
47
}
48
+
49
+ template <typename ... T>
50
+ auto malloc (T... /* unused*/ ) -> void*
51
+ {
52
+ // This always triggers but it depends on the template parameter, so it's only instantiated if we actually
53
+ // use it.
54
+ static_assert (sizeof ...(T) < 0 , " Attempt to use malloc of unavailable gallatin prototype." );
55
+ return nullptr ;
56
+ }
57
+
58
+ template <typename ... T>
59
+ auto free (T... /* unused*/ )
60
+ {
61
+ // This always triggers but it depends on the template parameter, so it's only instantiated if we actually
62
+ // use it.
63
+ static_assert (sizeof ...(T) < 0 , " Attempt to use free of unavailable gallatin prototype." );
64
+ }
48
65
};
49
66
} // namespace gallatin::allocators
50
67
@@ -89,7 +106,7 @@ namespace mallocMC
89
106
static constexpr auto providesAvailableSlots = false ;
90
107
91
108
template <typename AlpakaAcc>
92
- ALPAKA_FN_ACC auto create (AlpakaAcc const & acc, uint32_t bytes) const -> void*
109
+ ALPAKA_FN_ACC auto create (AlpakaAcc const & /* acc*/ , uint32_t bytes) const -> void*
93
110
{
94
111
return heap->malloc (static_cast <size_t >(bytes));
95
112
}
@@ -107,7 +124,7 @@ namespace mallocMC
107
124
108
125
template <typename AlpakaAcc, typename AlpakaDevice, typename AlpakaQueue, typename T_DeviceAllocator>
109
126
static void initHeap (
110
- AlpakaDevice& dev,
127
+ AlpakaDevice& /* dev*/ ,
111
128
AlpakaQueue& queue,
112
129
T_DeviceAllocator* devAllocator,
113
130
void *,
0 commit comments