Skip to content

[SYCL][FPGA][NFC] Locally scoping the template params in pipes.hpp #2484

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Sep 21, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 34 additions & 34 deletions sycl/include/CL/sycl/INTEL/pipes.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,31 +21,31 @@ template <class _name, class _dataT, int32_t _min_capacity = 0> class pipe {
// Non-blocking pipes
// Reading from pipe is lowered to SPIR-V instruction OpReadPipe via SPIR-V
// friendly LLVM IR.
static _dataT read(bool &Success) {
static _dataT read(bool &_Success) {
#ifdef __SYCL_DEVICE_ONLY__
RPipeTy<_dataT> RPipe =
RPipeTy<_dataT> _RPipe =
__spirv_CreatePipeFromPipeStorage_read<_dataT>(&m_Storage);
_dataT TempData;
Success = !static_cast<bool>(
__spirv_ReadPipe(RPipe, &TempData, m_Size, m_Alignment));
_Success = !static_cast<bool>(
__spirv_ReadPipe(_RPipe, &TempData, m_Size, m_Alignment));
return TempData;
#else
(void)Success;
(void)_Success;
assert(!"Pipes are not supported on a host device!");
#endif // __SYCL_DEVICE_ONLY__
}

// Writing to pipe is lowered to SPIR-V instruction OpWritePipe via SPIR-V
// friendly LLVM IR.
static void write(const _dataT &Data, bool &Success) {
static void write(const _dataT &_Data, bool &_Success) {
#ifdef __SYCL_DEVICE_ONLY__
WPipeTy<_dataT> WPipe =
WPipeTy<_dataT> _WPipe =
__spirv_CreatePipeFromPipeStorage_write<_dataT>(&m_Storage);
Success = !static_cast<bool>(
__spirv_WritePipe(WPipe, &Data, m_Size, m_Alignment));
_Success = !static_cast<bool>(
__spirv_WritePipe(_WPipe, &_Data, m_Size, m_Alignment));
#else
(void)Success;
(void)Data;
(void)_Success;
(void)_Data;
assert(!"Pipes are not supported on a host device!");
#endif // __SYCL_DEVICE_ONLY__
}
Expand All @@ -55,10 +55,10 @@ template <class _name, class _dataT, int32_t _min_capacity = 0> class pipe {
// friendly LLVM IR.
static _dataT read() {
#ifdef __SYCL_DEVICE_ONLY__
RPipeTy<_dataT> RPipe =
RPipeTy<_dataT> _RPipe =
__spirv_CreatePipeFromPipeStorage_read<_dataT>(&m_Storage);
_dataT TempData;
__spirv_ReadPipeBlockingINTEL(RPipe, &TempData, m_Size, m_Alignment);
__spirv_ReadPipeBlockingINTEL(_RPipe, &TempData, m_Size, m_Alignment);
return TempData;
#else
assert(!"Pipes are not supported on a host device!");
Expand All @@ -67,13 +67,13 @@ template <class _name, class _dataT, int32_t _min_capacity = 0> class pipe {

// Writing to pipe is lowered to SPIR-V instruction OpWritePipe via SPIR-V
// friendly LLVM IR.
static void write(const _dataT &Data) {
static void write(const _dataT &_Data) {
#ifdef __SYCL_DEVICE_ONLY__
WPipeTy<_dataT> WPipe =
WPipeTy<_dataT> _WPipe =
__spirv_CreatePipeFromPipeStorage_write<_dataT>(&m_Storage);
__spirv_WritePipeBlockingINTEL(WPipe, &Data, m_Size, m_Alignment);
__spirv_WritePipeBlockingINTEL(_WPipe, &_Data, m_Size, m_Alignment);
#else
(void)Data;
(void)_Data;
assert(!"Pipes are not supported on a host device!");
#endif // __SYCL_DEVICE_ONLY__
}
Expand Down Expand Up @@ -114,16 +114,16 @@ class kernel_readable_io_pipe {
// Non-blocking pipes
// Reading from pipe is lowered to SPIR-V instruction OpReadPipe via SPIR-V
// friendly LLVM IR.
static _dataT read(bool &Success) {
static _dataT read(bool &_Success) {
#ifdef __SYCL_DEVICE_ONLY__
RPipeTy<_dataT> RPipe =
RPipeTy<_dataT> _RPipe =
__spirv_CreatePipeFromPipeStorage_read<_dataT>(&m_Storage);
_dataT TempData;
Success = !static_cast<bool>(
__spirv_ReadPipe(RPipe, &TempData, m_Size, m_Alignment));
_Success = !static_cast<bool>(
__spirv_ReadPipe(_RPipe, &TempData, m_Size, m_Alignment));
return TempData;
#else
(void)Success;
(void)_Success;
assert(!"Pipes are not supported on a host device!");
#endif // __SYCL_DEVICE_ONLY__
}
Expand All @@ -133,10 +133,10 @@ class kernel_readable_io_pipe {
// friendly LLVM IR.
static _dataT read() {
#ifdef __SYCL_DEVICE_ONLY__
RPipeTy<_dataT> RPipe =
RPipeTy<_dataT> _RPipe =
__spirv_CreatePipeFromPipeStorage_read<_dataT>(&m_Storage);
_dataT TempData;
__spirv_ReadPipeBlockingINTEL(RPipe, &TempData, m_Size, m_Alignment);
__spirv_ReadPipeBlockingINTEL(_RPipe, &TempData, m_Size, m_Alignment);
return TempData;
#else
assert(!"Pipes are not supported on a host device!");
Expand All @@ -160,29 +160,29 @@ class kernel_writeable_io_pipe {
// Non-blocking pipes
// Writing to pipe is lowered to SPIR-V instruction OpWritePipe via SPIR-V
// friendly LLVM IR.
static void write(const _dataT &Data, bool &Success) {
static void write(const _dataT &_Data, bool &_Success) {
#ifdef __SYCL_DEVICE_ONLY__
WPipeTy<_dataT> WPipe =
WPipeTy<_dataT> _WPipe =
__spirv_CreatePipeFromPipeStorage_write<_dataT>(&m_Storage);
Success = !static_cast<bool>(
__spirv_WritePipe(WPipe, &Data, m_Size, m_Alignment));
_Success = !static_cast<bool>(
__spirv_WritePipe(_WPipe, &_Data, m_Size, m_Alignment));
#else
(void)Data;
(void)Success;
(void)_Data;
(void)_Success;
assert(!"Pipes are not supported on a host device!");
#endif // __SYCL_DEVICE_ONLY__
}

// Blocking pipes
// Writing to pipe is lowered to SPIR-V instruction OpWritePipe via SPIR-V
// friendly LLVM IR.
static void write(const _dataT &Data) {
static void write(const _dataT &_Data) {
#ifdef __SYCL_DEVICE_ONLY__
WPipeTy<_dataT> WPipe =
WPipeTy<_dataT> _WPipe =
__spirv_CreatePipeFromPipeStorage_write<_dataT>(&m_Storage);
__spirv_WritePipeBlockingINTEL(WPipe, &Data, m_Size, m_Alignment);
__spirv_WritePipeBlockingINTEL(_WPipe, &_Data, m_Size, m_Alignment);
#else
(void)Data;
(void)_Data;
assert(!"Pipes are not supported on a host device!");
#endif // __SYCL_DEVICE_ONLY__
}
Expand Down