-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move ASSERT_DEVICE_MATCHES_HOST_COLLECTION to a separate file
- Loading branch information
Showing
2 changed files
with
26 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
HeterogeneousCore/AlpakaInterface/interface/AssertDeviceMatchesHostCollection.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#ifndef HeterogeneousCore_AlpakaInterface_interface_AssertDeviceMatchesHostCollection_h | ||
#define HeterogeneousCore_AlpakaInterface_interface_AssertDeviceMatchesHostCollection_h | ||
|
||
#include <type_traits> | ||
|
||
#include "HeterogeneousCore/AlpakaInterface/interface/config.h" | ||
|
||
#if defined ALPAKA_ACC_CPU_B_SEQ_T_SEQ_ENABLED | ||
|
||
// check that the portable device collection for the host device is the same as the portable host collection | ||
#define ASSERT_DEVICE_MATCHES_HOST_COLLECTION(DEVICE_COLLECTION, HOST_COLLECTION) \ | ||
static_assert(std::is_same_v<alpaka_serial_sync::DEVICE_COLLECTION, HOST_COLLECTION>, \ | ||
"The device collection for the host device and the host collection must be the same type!"); | ||
|
||
#else | ||
|
||
// the portable device collections for the non-host devices do not require any checks | ||
#define ASSERT_DEVICE_MATCHES_HOST_COLLECTION(DEVICE_COLLECTION, HOST_COLLECTION) | ||
|
||
#endif // ALPAKA_ACC_CPU_B_SEQ_T_SEQ_ENABLED | ||
|
||
#endif // HeterogeneousCore_AlpakaInterface_interface_AssertDeviceMatchesHostCollection_h |