Skip to content

Commit ccca3ba

Browse files
Using a static assert in fpga_reg instead of a type_trait in the function signature
1 parent 37739ac commit ccca3ba

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

sycl/include/CL/sycl/INTEL/fpga_reg.hpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ namespace INTEL {
1818
// Returns a registered copy of the input
1919
// This function is intended for FPGA users to instruct the compiler to insert
2020
// at least one register stage between the input and the return value.
21-
template <typename _T>
22-
typename std::enable_if<std::is_trivially_copyable<_T>::value, _T>::type
23-
fpga_reg(_T t) {
21+
template <typename _T> _T fpga_reg(_T t) {
22+
static_assert(std::is_trivially_copyable<_T>::value,
23+
"Type is not trivially_copyable.");
2424
#if __has_builtin(__builtin_intel_fpga_reg)
2525
return __builtin_intel_fpga_reg(t);
2626
#else
@@ -31,4 +31,3 @@ fpga_reg(_T t) {
3131
} // namespace INTEL
3232
} // namespace sycl
3333
} // __SYCL_INLINE_NAMESPACE(cl)
34-

0 commit comments

Comments
 (0)