Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move thread_count trait around and remove unused sink.
Browse files Browse the repository at this point in the history
wmaxey committed May 6, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 4a50dfd commit e4ef13e
Showing 1 changed file with 7 additions and 13 deletions.
20 changes: 7 additions & 13 deletions libcudacxx/test/libcudacxx/heterogeneous/helpers.h
Original file line number Diff line number Diff line change
@@ -16,19 +16,8 @@
#include <thread>
#include <vector>

#include <stdlib.h>

#include "meta.h"

template <typename ... T>
struct void_sink{};

template <typename T, typename = int>
struct has_threadcount : std::false_type { };

template <typename T>
struct has_threadcount <T, decltype((void) T::threadcount, (int)0)> : std::true_type {};

#define DEFINE_ASYNC_TRAIT(...) \
template <typename T, typename = cuda::std::true_type> \
struct async##__VA_ARGS__##_trait_impl \
@@ -49,6 +38,13 @@ DEFINE_ASYNC_TRAIT()
DEFINE_ASYNC_TRAIT(_initialize)
DEFINE_ASYNC_TRAIT(_validate)

#undef DEFINE_ASYNC_TRAIT

template <typename T, typename = int>
struct has_threadcount : std::false_type { };
template <typename T>
struct has_threadcount <T, decltype((void) T::threadcount, (int)0)> : std::true_type {};

template <typename T, bool = has_threadcount<T>::value>
struct threadcount_trait_impl
{
@@ -64,8 +60,6 @@ struct threadcount_trait_impl<T, true>
template <typename T>
using threadcount_trait = threadcount_trait_impl<T>;

#undef DEFINE_ASYNC_TRAIT

#define HETEROGENEOUS_SAFE_CALL(...) \
do \
{ \

0 comments on commit e4ef13e

Please sign in to comment.