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

Update before flatterscatter #270

Merged
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
11 changes: 2 additions & 9 deletions src/include/mallocMC/allocator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
#include "mallocMC_allocator_handle.hpp"
#include "mallocMC_constraints.hpp"
#include "mallocMC_traits.hpp"
#include "mallocMC_utils.hpp"

#include <alpaka/alpaka.hpp>

Expand Down Expand Up @@ -113,11 +112,11 @@ namespace mallocMC
using uint32 = std::uint32_t;

public:
using CreationPolicy = T_CreationPolicy;
using DistributionPolicy = T_DistributionPolicy;
using OOMPolicy = T_OOMPolicy;
using ReservePoolPolicy = T_ReservePoolPolicy;
using AlignmentPolicy = T_AlignmentPolicy;
using CreationPolicy = T_CreationPolicy::template AlignmentAwarePolicy<AlignmentPolicy>;
using HeapInfoVector = std::vector<HeapInfo>;
using DevAllocator = DeviceAllocator<CreationPolicy, DistributionPolicy, OOMPolicy, AlignmentPolicy>;
using AllocatorHandle = AllocatorHandleImpl<Allocator>;
Expand All @@ -135,13 +134,7 @@ namespace mallocMC
* @param size number of bytes
*/
template<typename AlpakaDevice, typename AlpakaQueue>
ALPAKA_FN_HOST void
/* `volatile size_t size` is required to break clang optimizations which
* results into runtime errors. Observed in PIConGPU if size is known at
* compile time. The volatile workaround has no negative effects on the
* register usage in CUDA.
*/
alloc(AlpakaDevice& dev, AlpakaQueue& queue, size_t volatile size)
ALPAKA_FN_HOST void alloc(AlpakaDevice& dev, AlpakaQueue& queue, size_t size)
{
void* pool = reservePolicy.setMemPool(dev, size);
std::tie(pool, size) = AlignmentPolicy::alignPool(pool, size);
Expand Down
5 changes: 4 additions & 1 deletion src/include/mallocMC/creationPolicies/OldMalloc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,12 @@ namespace mallocMC
using uint32 = std::uint32_t;

public:
template<typename T_AlignmentPolicy>
using AlignmentAwarePolicy = OldMalloc;

static constexpr auto providesAvailableSlots = false;

template<typename AlignmentPolicy, typename AlpakaAcc>
template<typename AlpakaAcc>
ALPAKA_FN_ACC auto create(AlpakaAcc const& acc, uint32 bytes) const -> void*
{
return ::malloc(static_cast<size_t>(bytes));
Expand Down
Loading
Loading