CMS 3D CMS Logo

AssertDeviceMatchesHostCollection.h
Go to the documentation of this file.
1 #ifndef HeterogeneousCore_AlpakaInterface_interface_AssertDeviceMatchesHostCollection_h
2 #define HeterogeneousCore_AlpakaInterface_interface_AssertDeviceMatchesHostCollection_h
3 
4 #include <type_traits>
5 
7 
8 #if defined ALPAKA_ACC_CPU_B_SEQ_T_SEQ_ENABLED
9 
10 // check that the portable device collection for the host device is the same as the portable host collection
11 #define ASSERT_DEVICE_MATCHES_HOST_COLLECTION(DEVICE_COLLECTION, HOST_COLLECTION) \
12  static_assert(std::is_same_v<alpaka_serial_sync::DEVICE_COLLECTION, HOST_COLLECTION>, \
13  "The device collection for the host device and the host collection must be the same type!");
14 
15 #else
16 
17 // the portable device collections for the non-host devices do not require any checks
18 #define ASSERT_DEVICE_MATCHES_HOST_COLLECTION(DEVICE_COLLECTION, HOST_COLLECTION)
19 
20 #endif // ALPAKA_ACC_CPU_B_SEQ_T_SEQ_ENABLED
21 
22 #endif // HeterogeneousCore_AlpakaInterface_interface_AssertDeviceMatchesHostCollection_h