cuda::experimental::stf::shuffled_args_check#

template<typename ...ArgTypes, typename ...DataTypes>
void cuda::experimental::stf::shuffled_args_check(
const DataTypes&...,
)#

Checks the convertibility of argument types to a set of data types.

This function checks if each type in ArgTypes is convertible to exactly one type in DataTypes. If a type is not convertible to exactly one type, a static assertion will fail at compile time.

struct A {};
struct B {};
struct C {};
struct D {};

A a;
B b;
C c;
D d;

// This will compile successfully because each type A, B, C is convertible to itself and only itself.
shuffled_args_check<A, B, C>(c, a, b);

// This will fail to compile because type D is not provided in the DataTypes.
// shuffled_args_check<A, B, C>(a, b, c, d);

// This will fail to compile because int is convertible to both float and double, causing ambiguity.
// shuffled_args_check<int, float, double>(5);

Note

A static_assert error occurs if a type is not convertible to exactly one type.

Template Parameters:
  • ArgTypes – The types to check the convertibility of.

  • DataTypes – The types to check the convertibility to.

Parameters:

... – The data of the types to check the convertibility to.