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

Allocator takes Acc by tag #287

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
2 changes: 1 addition & 1 deletion examples/getAvailableSlots/source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ template<typename T_CreationPolicy>
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<typename T_CreationPolicy>
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;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: This will limit the number of threads to 4 giga threads but this should be ok.

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