Skip to content

Commit

Permalink
ParSEC: Templatize derived device ops check
Browse files Browse the repository at this point in the history
So we can delay evaluation until the derived struct has been populated.

Signed-off-by: Joseph Schuchart <[email protected]>
  • Loading branch information
devreal committed Dec 23, 2024
1 parent 3e66f28 commit 819be34
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ttg/ttg/parsec/ttg.h
Original file line number Diff line number Diff line change
Expand Up @@ -1224,6 +1224,7 @@ namespace ttg_parsec {

public:
/// @return true if derivedT::have_cuda_op exists and is defined to true
template<typename TT = derivedT>
static constexpr bool derived_has_cuda_op() {
if constexpr (ttg::meta::is_detected_v<have_cuda_op_non_type_t, derivedT>) {
return derivedT::have_cuda_op;
Expand All @@ -1233,6 +1234,7 @@ namespace ttg_parsec {
}

/// @return true if derivedT::have_hip_op exists and is defined to true
template<typename TT = derivedT>
static constexpr bool derived_has_hip_op() {
if constexpr (ttg::meta::is_detected_v<have_hip_op_non_type_t, derivedT>) {
return derivedT::have_hip_op;
Expand All @@ -1242,6 +1244,7 @@ namespace ttg_parsec {
}

/// @return true if derivedT::have_hip_op exists and is defined to true
template<typename TT = derivedT>
static constexpr bool derived_has_level_zero_op() {
if constexpr (ttg::meta::is_detected_v<have_level_zero_op_non_type_t, derivedT>) {
return derivedT::have_level_zero_op;
Expand All @@ -1251,6 +1254,7 @@ namespace ttg_parsec {
}

/// @return true if the TT supports device execution
template<typename TT = derivedT>
static constexpr bool derived_has_device_op() {
return (derived_has_cuda_op() || derived_has_hip_op() || derived_has_level_zero_op());
}
Expand Down

0 comments on commit 819be34

Please sign in to comment.