Skip to content

Commit 1ce4b3c

Browse files
test/support/utils_invoke.h - introduce CREATE_NEW_POLICY macro
1 parent 3640670 commit 1ce4b3c

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

test/support/utils_invoke.h

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -130,17 +130,21 @@ struct policy_container
130130

131131
if constexpr (std::is_rvalue_reference_v<_Policy>)
132132
{
133-
// Return policy as r-value
134-
return std::move(__policy);
135-
}
133+
// Return policy as r-value
134+
return std::move(__policy);
135+
}
136136
else
137-
{
138-
// Return policy as l-value
139-
return __policy;
137+
{
138+
// Return policy as l-value
139+
return __policy;
140140
}
141141
}
142142
};
143143

144+
// Create new policy and pass it into called function as l-value / r-value
145+
// depends on qualifiers of source policy type
146+
#define CREATE_NEW_POLICY(exec, idx) policy_container<decltype(exec)>(make_new_policy<new_kernel_name<std::decay_t<decltype(exec)>, idx>>(exec)).get()
147+
144148
#endif // TEST_DPCPP_BACKEND_PRESENT
145149

146150
////////////////////////////////////////////////////////////////////////////////

0 commit comments

Comments
 (0)