llnl / llnl/camp

make concepts and detector reliable under EDG etc.

Open
#6 0 comments 0 reactions 1 assignee Claimed by @trws View on GitHub
Dominant language
C++
Stars
107
Forks
26
Avg merge
8d 11h
Merged PRs (30d)
2

Description

Three issues have come up over the past couple weeks:

* The integral/float concepts don't work, this comes down to wiring them up the wrong way
* The detector only works reliably with a slightly different concept declaration than we are using
* Some of the more round-about Kokkos use-cases don't work without modifying the declarations and detector slightly

Given how many of these there are, concepts in CAMP need a pretty substantial rework. The new setup will look about like this:

```c++
// Classic detector pattern
template class Concept,
class ...Args>
struct _detector {
using value_t = std::false_type;
constexpr static auto value = false;
using type = Default;
};

template class Concept, class... Args>
struct _detector>::type,
Concept,
Args...> {
using value_t = std::true_type;
constexpr static auto value = true;
using type = typename Concept::type;
};
#define CAMP_CONCEPT(name, params, ...) \
template \
struct name { using type = __Res; }
#define CAMP_DETECTOR(name, params) \
template \
struct name { using type = __Res; }

```

Thanks to @dhollman in kokkos/kokkos#2407 we found some nasty issues in even recent EDGs. This variation works for his tests (if you have some nastier ones, do sling them over, this has been really useful), the ones from GEOSX, and compiles about 30% faster than falling back to per-condition detectors. It does not support gcc 4.8 or EDG compilers older than about icc 16, but it covers everything we currently test with.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.