Skip to content

Commit 48c8cc1

Browse files
authored
[SYCL][FPGA] Prepare future implementation of experimental pipe properties (#5886)
Add a template parameter to pass compile-time constant properties to sycl::ext::intel::experimental::pipe, and redeclare pipe implementation as a specialization when the properties list is empty; otherwise, when the properties list is non-empty, throw a descriptive compiler error. The unnamed template parameter allows implementation of the case where the properties list is non-empty in a downstream, FPGA-specific header, before finalizing pipe properties for inclusion into this header. See draft specification in #5838
1 parent fa054cc commit 48c8cc1

File tree

1 file changed

+15
-1
lines changed
  • sycl/include/sycl/ext/intel/experimental

1 file changed

+15
-1
lines changed

sycl/include/sycl/ext/intel/experimental/pipes.hpp

+15-1
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,28 @@
1212
#include <CL/__spirv/spirv_ops.hpp>
1313
#include <CL/__spirv/spirv_types.hpp>
1414
#include <CL/sycl/stl.hpp>
15+
#include <sycl/ext/oneapi/properties/properties.hpp>
16+
#include <type_traits>
1517

1618
__SYCL_INLINE_NAMESPACE(cl) {
1719
namespace sycl {
1820
namespace ext {
1921
namespace intel {
2022
namespace experimental {
2123

22-
template <class _name, class _dataT, int32_t _min_capacity = 0> class pipe {
24+
template <class _name, class _dataT, int32_t _min_capacity = 0,
25+
class _propertiesT = decltype(oneapi::experimental::properties{}),
26+
class = void>
27+
class pipe {
28+
static_assert(std::is_same_v<_propertiesT,
29+
decltype(oneapi::experimental::properties{})>,
30+
"experimental pipe properties are not yet implemented");
31+
};
32+
33+
template <class _name, class _dataT, int32_t _min_capacity, class _propertiesT>
34+
class pipe<_name, _dataT, _min_capacity, _propertiesT,
35+
std::enable_if_t<std::is_same_v<
36+
_propertiesT, decltype(oneapi::experimental::properties{})>>> {
2337
public:
2438
// Non-blocking pipes
2539
// Reading from pipe is lowered to SPIR-V instruction OpReadPipe via SPIR-V

0 commit comments

Comments
 (0)