Skip to content

Commit

Permalink
Merge pull request #287 from chillenzer/interface-takes-tag-over-acc
Browse files Browse the repository at this point in the history
Allocator takes Acc by tag
  • Loading branch information
psychocoderHPC authored Feb 10, 2025
2 parents bde4b6f + b88d2b0 commit ba2f417
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion examples/getAvailableSlots/source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ template<
auto example03() -> int
{
using Allocator = mallocMC::Allocator<
Acc,
alpaka::AccToTag<Acc>,
T_CreationPolicy,
mallocMC::DistributionPolicies::Noop,
mallocMC::OOMPolicies::ReturnNull,
Expand Down
2 changes: 1 addition & 1 deletion examples/vectorAdd/source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ template<
auto example01() -> int
{
using Allocator = mallocMC::Allocator<
Acc,
alpaka::AccToTag<Acc>,
T_CreationPolicy,
mallocMC::DistributionPolicies::Noop,
mallocMC::OOMPolicies::ReturnNull,
Expand Down
5 changes: 4 additions & 1 deletion include/mallocMC/allocator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ namespace mallocMC
* @tparam T_AlignmentPolicy The desired type of a AlignmentPolicy
*/
template<
typename AlpakaAcc,
typename T_AccTag,
typename T_CreationPolicy,
typename T_DistributionPolicy,
typename T_OOMPolicy,
Expand All @@ -113,6 +113,9 @@ namespace mallocMC
using uint32 = std::uint32_t;

public:
using Dim = alpaka::DimInt<1>;
using Idx = std::uint32_t;
using AlpakaAcc = alpaka::TagToAcc<T_AccTag, Dim, Idx>;
using DistributionPolicy = T_DistributionPolicy;
using OOMPolicy = T_OOMPolicy;
using ReservePoolPolicy = T_ReservePoolPolicy;
Expand Down

0 comments on commit ba2f417

Please sign in to comment.