Skip to content

[SYCL][NFC] Fix -Wno-unused-parameter warning in headers #11318

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
Show file tree
Hide file tree
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
39 changes: 35 additions & 4 deletions sycl/include/sycl/accessor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1569,6 +1569,7 @@ class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor :
: impl(id<AdjustedDim>(), detail::GetZeroDimAccessRange(BufferRef),
BufferRef.get_range()) {
(void)PropertyList;
(void)CodeLoc;
#else
: AccessorBaseHost(
/*Offset=*/{0, 0, 0},
Expand Down Expand Up @@ -1609,6 +1610,7 @@ class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor :
: impl(id<AdjustedDim>(), detail::GetZeroDimAccessRange(BufferRef),
BufferRef.get_range()) {
(void)PropertyList;
(void)CodeLoc;
#else
: AccessorBaseHost(
/*Offset=*/{0, 0, 0},
Expand Down Expand Up @@ -1645,6 +1647,7 @@ class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor :
BufferRef.get_range()) {
(void)CommandGroupHandler;
(void)PropertyList;
(void)CodeLoc;
}
#else
: AccessorBaseHost(
Expand Down Expand Up @@ -1682,6 +1685,7 @@ class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor :
BufferRef.get_range()) {
(void)CommandGroupHandler;
(void)PropertyList;
(void)CodeLoc;
}
#else
: AccessorBaseHost(
Expand Down Expand Up @@ -1715,6 +1719,7 @@ class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor :
#ifdef __SYCL_DEVICE_ONLY__
: impl(id<Dimensions>(), BufferRef.get_range(), BufferRef.get_range()) {
(void)PropertyList;
(void)CodeLoc;
}
#else
: AccessorBaseHost(
Expand Down Expand Up @@ -1751,6 +1756,7 @@ class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor :
#ifdef __SYCL_DEVICE_ONLY__
: impl(id<Dimensions>(), BufferRef.get_range(), BufferRef.get_range()) {
(void)PropertyList;
(void)CodeLoc;
}
#else
: AccessorBaseHost(
Expand Down Expand Up @@ -1815,6 +1821,7 @@ class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor :
: impl(id<AdjustedDim>(), BufferRef.get_range(), BufferRef.get_range()) {
(void)CommandGroupHandler;
(void)PropertyList;
(void)CodeLoc;
}
#else
: AccessorBaseHost(
Expand Down Expand Up @@ -1850,6 +1857,7 @@ class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor :
: impl(id<AdjustedDim>(), BufferRef.get_range(), BufferRef.get_range()) {
(void)CommandGroupHandler;
(void)PropertyList;
(void)CodeLoc;
}
#else
: AccessorBaseHost(
Expand Down Expand Up @@ -2026,6 +2034,7 @@ class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor :
#ifdef __SYCL_DEVICE_ONLY__
: impl(AccessOffset, AccessRange, BufferRef.get_range()) {
(void)PropertyList;
(void)CodeLoc;
}
#else
: AccessorBaseHost(detail::convertToArrayOfN<3, 0>(AccessOffset),
Expand Down Expand Up @@ -2069,6 +2078,7 @@ class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor :
#ifdef __SYCL_DEVICE_ONLY__
: impl(AccessOffset, AccessRange, BufferRef.get_range()) {
(void)PropertyList;
(void)CodeLoc;
}
#else
: AccessorBaseHost(detail::convertToArrayOfN<3, 0>(AccessOffset),
Expand Down Expand Up @@ -2141,6 +2151,7 @@ class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor :
: impl(AccessOffset, AccessRange, BufferRef.get_range()) {
(void)CommandGroupHandler;
(void)PropertyList;
(void)CodeLoc;
}
#else
: AccessorBaseHost(detail::convertToArrayOfN<3, 0>(AccessOffset),
Expand Down Expand Up @@ -2184,6 +2195,7 @@ class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor :
: impl(AccessOffset, AccessRange, BufferRef.get_range()) {
(void)CommandGroupHandler;
(void)PropertyList;
(void)CodeLoc;
}
#else
: AccessorBaseHost(detail::convertToArrayOfN<3, 0>(AccessOffset),
Expand Down Expand Up @@ -2260,6 +2272,7 @@ class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor :
static_assert(
PropertyListT::template areSameCompileTimeProperties<NewPropsT...>(),
"Compile-time-constant properties must be the same");
(void)CodeLoc;
#ifndef __SYCL_DEVICE_ONLY__
detail::constructorNotification(getMemoryObject(), impl.get(), AccessTarget,
AccessMode, CodeLoc);
Expand Down Expand Up @@ -2849,7 +2862,9 @@ class __SYCL_SPECIAL_CLASS local_accessor_base :
local_accessor_base(handler &, const detail::code_location CodeLoc =
detail::code_location::current())
#ifdef __SYCL_DEVICE_ONLY__
: impl(range<AdjustedDim>{1}){}
: impl(range<AdjustedDim>{1}) {
(void)CodeLoc;
}
#else
: LocalAccessorBaseHost(range<3>{1, 1, 1}, AdjustedDim, sizeof(DataT)) {
detail::constructorNotification(nullptr, LocalAccessorBaseHost::impl.get(),
Expand All @@ -2865,6 +2880,7 @@ class __SYCL_SPECIAL_CLASS local_accessor_base :
#ifdef __SYCL_DEVICE_ONLY__
: impl(range<AdjustedDim>{1}) {
(void)propList;
(void)CodeLoc;
}
#else
: LocalAccessorBaseHost(range<3>{1, 1, 1}, AdjustedDim, sizeof(DataT),
Expand All @@ -2880,7 +2896,9 @@ class __SYCL_SPECIAL_CLASS local_accessor_base :
range<Dimensions> AllocationSize, handler &,
const detail::code_location CodeLoc = detail::code_location::current())
#ifdef __SYCL_DEVICE_ONLY__
: impl(AllocationSize){}
: impl(AllocationSize) {
(void)CodeLoc;
}
#else
: LocalAccessorBaseHost(detail::convertToArrayOfN<3, 1>(AllocationSize),
AdjustedDim, sizeof(DataT)) {
Expand All @@ -2899,6 +2917,7 @@ class __SYCL_SPECIAL_CLASS local_accessor_base :
#ifdef __SYCL_DEVICE_ONLY__
: impl(AllocationSize) {
(void)propList;
(void)CodeLoc;
}
#else
: LocalAccessorBaseHost(detail::convertToArrayOfN<3, 1>(AllocationSize),
Expand Down Expand Up @@ -3574,6 +3593,7 @@ class __SYCL_EBO host_accessor
AccessorT::MAccData = other.MAccData;
#else
{
(void)other;
#endif // __SYCL_DEVICE_ONLY__
}

Expand All @@ -3589,6 +3609,7 @@ class __SYCL_EBO host_accessor
AccessorT::MAccData = other.MAccData;
#else
{
(void)other;
#endif // __SYCL_DEVICE_ONLY__
}

Expand Down Expand Up @@ -3685,7 +3706,12 @@ class __SYCL_EBO unsampled_image_accessor :
handler &CommandGroupHandlerRef, const property_list &PropList = {},
const detail::code_location CodeLoc = detail::code_location::current())
#ifdef __SYCL_DEVICE_ONLY__
{}
{
(void)ImageRef;
(void)CommandGroupHandlerRef;
(void)PropList;
(void)CodeLoc;
}
#else
: host_base_class(detail::convertToArrayOfN<3, 1>(ImageRef.get_range()),
AccessMode, detail::getSyclObjImpl(ImageRef).get(),
Expand Down Expand Up @@ -3951,7 +3977,12 @@ class __SYCL_EBO sampled_image_accessor :
handler &CommandGroupHandlerRef, const property_list &PropList = {},
const detail::code_location CodeLoc = detail::code_location::current())
#ifdef __SYCL_DEVICE_ONLY__
{}
{
(void)ImageRef;
(void)CommandGroupHandlerRef;
(void)PropList;
(void)CodeLoc;
}
#else
: host_base_class(detail::convertToArrayOfN<3, 1>(ImageRef.get_range()),
detail::getSyclObjImpl(ImageRef).get(), Dimensions,
Expand Down
2 changes: 1 addition & 1 deletion sycl/include/sycl/detail/kernel_desc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ template <class KernelNameType> struct KernelInfo {
#else
template <char...> struct KernelInfoData {
static constexpr unsigned getNumParams() { return 0; }
static const kernel_param_desc_t &getParamDesc(int Idx) {
static const kernel_param_desc_t &getParamDesc(int) {
static kernel_param_desc_t Dummy;
return Dummy;
}
Expand Down
3 changes: 2 additions & 1 deletion sycl/include/sycl/detail/spirv.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1028,6 +1028,7 @@ ControlBarrier(Group g, memory_scope FenceScope, memory_order Order) {
#if defined(__NVPTX__)
__nvvm_bar_warp_sync(detail::ExtractMask(detail::GetMask(g))[0]);
#else
(void)g;
// SPIR-V does not define an instruction to synchronize partial groups.
// However, most (possibly all?) of the current SPIR-V targets execute
// work-items in lockstep, so we can probably get away with a MemoryBarrier.
Expand Down Expand Up @@ -1057,7 +1058,7 @@ struct is_tangle_or_opportunistic_group<
template <__spv::GroupOperation Op, typename Group, typename T> \
inline typename std::enable_if_t< \
ext::oneapi::experimental::is_fixed_topology_group_v<Group>, T> \
Group##Instruction(Group G, T x) { \
Group##Instruction(Group, T x) { \
using ConvertedT = detail::ConvertToOpenCLType_t<T>; \
\
using OCLT = std::conditional_t< \
Expand Down
41 changes: 16 additions & 25 deletions sycl/include/sycl/ext/intel/experimental/pipes.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ class pipe : public pipe_base {
// Reading from pipe is lowered to SPIR-V instruction OpReadPipe via SPIR-V
// friendly LLVM IR.
template <typename _functionPropertiesT>
static _dataT read(bool &Success, _functionPropertiesT Properties) {
static _dataT read(bool &Success, _functionPropertiesT) {
#ifdef __SYCL_DEVICE_ONLY__
// Get latency control properties
using _latency_anchor_id_prop = typename detail::GetOrDefaultValT<
Expand Down Expand Up @@ -169,7 +169,6 @@ class pipe : public pipe_base {
return TempData;
#else
(void)Success;
(void)Properties;
throw sycl::exception(
sycl::make_error_code(sycl::errc::feature_not_supported),
"Device-side API are not supported on a host device. Please use "
Expand All @@ -184,8 +183,7 @@ class pipe : public pipe_base {
// Writing to pipe is lowered to SPIR-V instruction OpWritePipe via SPIR-V
// friendly LLVM IR.
template <typename _functionPropertiesT>
static void write(const _dataT &Data, bool &Success,
_functionPropertiesT Properties) {
static void write(const _dataT &Data, bool &Success, _functionPropertiesT) {
#ifdef __SYCL_DEVICE_ONLY__
// Get latency control properties
using _latency_anchor_id_prop = typename detail::GetOrDefaultValT<
Expand Down Expand Up @@ -219,7 +217,6 @@ class pipe : public pipe_base {
#else
(void)Success;
(void)Data;
(void)Properties;
throw sycl::exception(
sycl::make_error_code(sycl::errc::feature_not_supported),
"Device-side API are not supported on a host device. Please use "
Expand Down Expand Up @@ -282,7 +279,7 @@ class pipe : public pipe_base {
// Reading from pipe is lowered to SPIR-V instruction OpReadPipe via SPIR-V
// friendly LLVM IR.
template <typename _functionPropertiesT>
static _dataT read(_functionPropertiesT Properties) {
static _dataT read(_functionPropertiesT) {
#ifdef __SYCL_DEVICE_ONLY__
// Get latency control properties
using _latency_anchor_id_prop = typename detail::GetOrDefaultValT<
Expand Down Expand Up @@ -316,7 +313,6 @@ class pipe : public pipe_base {
_relative_cycle);
return TempData;
#else
(void)Properties;
throw sycl::exception(
sycl::make_error_code(sycl::errc::feature_not_supported),
"Device-side API are not supported on a host device. Please use "
Expand All @@ -329,7 +325,7 @@ class pipe : public pipe_base {
// Writing to pipe is lowered to SPIR-V instruction OpWritePipe via SPIR-V
// friendly LLVM IR.
template <typename _functionPropertiesT>
static void write(const _dataT &Data, _functionPropertiesT Properties) {
static void write(const _dataT &Data, _functionPropertiesT) {
#ifdef __SYCL_DEVICE_ONLY__
// Get latency control properties
using _latency_anchor_id_prop = typename detail::GetOrDefaultValT<
Expand Down Expand Up @@ -362,7 +358,6 @@ class pipe : public pipe_base {
_relative_cycle);
#else
(void)Data;
(void)Properties;
throw sycl::exception(
sycl::make_error_code(sycl::errc::feature_not_supported),
"Device-side API are not supported on a host device. Please use "
Expand Down Expand Up @@ -412,40 +407,36 @@ class pipe : public pipe_base {
// FPGA BE will recognize this function and extract its arguments.
// TODO: Pass latency control parameters via the __spirv_* builtin when ready.
template <typename _T>
static int32_t
__latency_control_nb_read_wrapper(__ocl_RPipeTy<_T> Pipe, _T *Data,
int32_t AnchorID, int32_t TargetAnchor,
int32_t Type, int32_t Cycle) {
static int32_t __latency_control_nb_read_wrapper(
__ocl_RPipeTy<_T> Pipe, _T *Data, int32_t /* AnchorID */,
int32_t /* TargetAnchor */, int32_t /* Type */, int32_t /* Cycle */) {
return __spirv_ReadPipe(Pipe, Data, m_Size, m_Alignment);
}

// FPGA BE will recognize this function and extract its arguments.
// TODO: Pass latency control parameters via the __spirv_* builtin when ready.
template <typename _T>
static int32_t
__latency_control_nb_write_wrapper(__ocl_WPipeTy<_T> Pipe, const _T *Data,
int32_t AnchorID, int32_t TargetAnchor,
int32_t Type, int32_t Cycle) {
static int32_t __latency_control_nb_write_wrapper(
__ocl_WPipeTy<_T> Pipe, const _T *Data, int32_t /* AnchorID */,
int32_t /* TargetAnchor */, int32_t /* Type */, int32_t /* Cycle */) {
return __spirv_WritePipe(Pipe, Data, m_Size, m_Alignment);
}

// FPGA BE will recognize this function and extract its arguments.
// TODO: Pass latency control parameters via the __spirv_* builtin when ready.
template <typename _T>
static void __latency_control_bl_read_wrapper(__ocl_RPipeTy<_T> Pipe,
_T *Data, int32_t AnchorID,
int32_t TargetAnchor,
int32_t Type, int32_t Cycle) {
static void __latency_control_bl_read_wrapper(
__ocl_RPipeTy<_T> Pipe, _T *Data, int32_t /* AnchorID */,
int32_t /* TargetAnchor */, int32_t /* Type */, int32_t /* Cycle */) {
return __spirv_ReadPipeBlockingINTEL(Pipe, Data, m_Size, m_Alignment);
}

// FPGA BE will recognize this function and extract its arguments.
// TODO: Pass latency control parameters via the __spirv_* builtin when ready.
template <typename _T>
static void
__latency_control_bl_write_wrapper(__ocl_WPipeTy<_T> Pipe, const _T *Data,
int32_t AnchorID, int32_t TargetAnchor,
int32_t Type, int32_t Cycle) {
static void __latency_control_bl_write_wrapper(
__ocl_WPipeTy<_T> Pipe, const _T *Data, int32_t /* AnchorID*/,
int32_t /* TargetAnchor */, int32_t /* Type */, int32_t /* Cycle */) {
return __spirv_WritePipeBlockingINTEL(Pipe, Data, m_Size, m_Alignment);
}
#endif // __SYCL_DEVICE_ONLY__
Expand Down
4 changes: 1 addition & 3 deletions sycl/include/sycl/ext/oneapi/matrix/matrix-intel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -489,15 +489,14 @@ template <
Use == sycl::ext::oneapi::experimental::matrix::use::b,
bool> = true>
inline __SYCL_ALWAYS_INLINE void
joint_matrix_store(Group sg,
joint_matrix_store(Group,
sycl::ext::oneapi::experimental::matrix::joint_matrix<
Group, Tp, Use, NumRows, NumCols, Layout> &src,
multi_ptr<T, Space, IsDecorated> dst, size_t stride) {
#if defined(__SYCL_DEVICE_ONLY__)
static_assert(Space != access::address_space::private_space,
"Joint Matrix doesn't support store to private memory!");
#if defined(__NVPTX__)
std::ignore = sg;
std::ignore = src;
std::ignore = dst;
std::ignore = stride;
Expand All @@ -520,7 +519,6 @@ joint_matrix_store(Group sg,
sycl::ext::oneapi::experimental::matrix::spv_scope_traits<Group>::value);
#endif // defined(__NVPTX__)
#else
std::ignore = sg;
std::ignore = src;
std::ignore = dst;
std::ignore = stride;
Expand Down
Loading