Skip to content

[SYCL] Handle massive warnings comming from DPCPP lib #1583

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
12 changes: 6 additions & 6 deletions sycl/include/CL/__spirv/spirv_ops.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -235,9 +235,9 @@ __spirv_ocl_prefetch(const __attribute__((opencl_global)) char *Ptr,

template <typename dataT>
__SYCL_CONVERGENT__ extern __ocl_event_t
OpGroupAsyncCopyGlobalToLocal(__spv::Scope::Flag Execution, dataT *Dest,
dataT *Src, size_t NumElements, size_t Stride,
__ocl_event_t E) noexcept {
OpGroupAsyncCopyGlobalToLocal(__spv::Scope::Flag, dataT *Dest, dataT *Src,
size_t NumElements, size_t Stride,
__ocl_event_t) noexcept {
for (size_t i = 0; i < NumElements; i++) {
Dest[i] = Src[i * Stride];
}
Expand All @@ -247,9 +247,9 @@ OpGroupAsyncCopyGlobalToLocal(__spv::Scope::Flag Execution, dataT *Dest,

template <typename dataT>
__SYCL_CONVERGENT__ extern __ocl_event_t
OpGroupAsyncCopyLocalToGlobal(__spv::Scope::Flag Execution, dataT *Dest,
dataT *Src, size_t NumElements, size_t Stride,
__ocl_event_t E) noexcept {
OpGroupAsyncCopyLocalToGlobal(__spv::Scope::Flag, dataT *Dest, dataT *Src,
size_t NumElements, size_t Stride,
__ocl_event_t) noexcept {
for (size_t i = 0; i < NumElements; i++) {
Dest[i * Stride] = Src[i];
}
Expand Down
15 changes: 12 additions & 3 deletions sycl/include/CL/sycl/accessor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,8 @@ class image_accessor
image_accessor(image<Dims, AllocatorT> &ImageRef, int ImageElementSize)
#ifdef __SYCL_DEVICE_ONLY__
{
(void)ImageRef;
(void)ImageElementSize;
// No implementation needed for device. The constructor is only called by
// host.
}
Expand Down Expand Up @@ -415,6 +417,9 @@ class image_accessor
handler &CommandGroupHandlerRef, int ImageElementSize)
#ifdef __SYCL_DEVICE_ONLY__
{
(void)ImageRef;
(void)CommandGroupHandlerRef;
(void)ImageElementSize;
// No implementation needed for device. The constructor is only called by
// host.
}
Expand Down Expand Up @@ -784,6 +789,7 @@ class accessor :
handler &CommandGroupHandler)
#ifdef __SYCL_DEVICE_ONLY__
: impl(id<AdjustedDim>(), range<1>{1}, BufferRef.get_range()) {
(void)CommandGroupHandler;
}
#else
: AccessorBaseHost(
Expand Down Expand Up @@ -824,6 +830,7 @@ class accessor :
handler &CommandGroupHandler)
#ifdef __SYCL_DEVICE_ONLY__
: impl(id<AdjustedDim>(), BufferRef.get_range(), BufferRef.get_range()) {
(void)CommandGroupHandler;
}
#else
: AccessorBaseHost(
Expand Down Expand Up @@ -867,6 +874,7 @@ class accessor :
id<Dimensions> AccessOffset = {})
#ifdef __SYCL_DEVICE_ONLY__
: impl(AccessOffset, AccessRange, BufferRef.get_range()) {
(void)CommandGroupHandler;
}
#else
: AccessorBaseHost(detail::convertToArrayOfN<3, 0>(AccessOffset),
Expand Down Expand Up @@ -1033,7 +1041,7 @@ class accessor<DataT, Dimensions, AccessMode, access::target::local,
const sycl::range<AdjustedDim> &getSize() const { return impl.MemRange; }

void __init(ConcreteASPtrType Ptr, range<AdjustedDim> AccessRange,
range<AdjustedDim> MemRange, id<AdjustedDim> Offset) {
range<AdjustedDim>, id<AdjustedDim>) {
MData = Ptr;
for (int I = 0; I < AdjustedDim; ++I)
getSize()[I] = AccessRange[I];
Expand Down Expand Up @@ -1075,7 +1083,7 @@ class accessor<DataT, Dimensions, AccessMode, access::target::local,
using const_reference = const DataT &;

template <int Dims = Dimensions, typename = detail::enable_if_t<Dims == 0>>
accessor(handler &CommandGroupHandler)
accessor(handler &)
#ifdef __SYCL_DEVICE_ONLY__
: impl(range<AdjustedDim>{1}) {
}
Expand All @@ -1085,7 +1093,7 @@ class accessor<DataT, Dimensions, AccessMode, access::target::local,
#endif

template <int Dims = Dimensions, typename = detail::enable_if_t<(Dims > 0)>>
accessor(range<Dimensions> AllocationSize, handler &CommandGroupHandler)
accessor(range<Dimensions> AllocationSize, handler &)
#ifdef __SYCL_DEVICE_ONLY__
: impl(AllocationSize) {
}
Expand Down Expand Up @@ -1271,6 +1279,7 @@ struct hash<cl::sycl::accessor<DataT, Dimensions, AccessMode, AccessTarget,
size_t operator()(const AccType &A) const {
#ifdef __SYCL_DEVICE_ONLY__
// Hash is not supported on DEVICE. Just return 0 here.
(void)A;
return 0;
#else
// getSyclObjImpl() here returns a pointer to either AccessorImplHost
Expand Down
24 changes: 12 additions & 12 deletions sycl/include/CL/sycl/atomic.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ namespace detail {
// into std::memory_order
// Only relaxed memory semantics are supported currently
static inline std::memory_order
getStdMemoryOrder(__spv::MemorySemanticsMask::Flag MS) {
getStdMemoryOrder(__spv::MemorySemanticsMask::Flag) {
return std::memory_order_relaxed;
}
static inline std::memory_order getStdMemoryOrder(::cl::sycl::memory_order MS) {
static inline std::memory_order getStdMemoryOrder(::cl::sycl::memory_order) {
return std::memory_order_relaxed;
}
} // namespace detail
Expand All @@ -86,55 +86,55 @@ static inline std::memory_order getStdMemoryOrder(::cl::sycl::memory_order MS) {
// std::atomic version of atomic SPIR-V builtins

template <typename T>
void __spirv_AtomicStore(std::atomic<T> *Ptr, __spv::Scope::Flag S,
void __spirv_AtomicStore(std::atomic<T> *Ptr, __spv::Scope::Flag,
__spv::MemorySemanticsMask::Flag MS, T V) {
Ptr->store(V, ::cl::sycl::detail::getStdMemoryOrder(MS));
}

template <typename T>
T __spirv_AtomicLoad(const std::atomic<T> *Ptr, __spv::Scope::Flag S,
T __spirv_AtomicLoad(const std::atomic<T> *Ptr, __spv::Scope::Flag,
__spv::MemorySemanticsMask::Flag MS) {
return Ptr->load(::cl::sycl::detail::getStdMemoryOrder(MS));
}

template <typename T>
T __spirv_AtomicExchange(std::atomic<T> *Ptr, __spv::Scope::Flag S,
T __spirv_AtomicExchange(std::atomic<T> *Ptr, __spv::Scope::Flag,
__spv::MemorySemanticsMask::Flag MS, T V) {
return Ptr->exchange(V, ::cl::sycl::detail::getStdMemoryOrder(MS));
}

template <typename T>
extern T __spirv_AtomicIAdd(std::atomic<T> *Ptr, __spv::Scope::Flag S,
extern T __spirv_AtomicIAdd(std::atomic<T> *Ptr, __spv::Scope::Flag,
__spv::MemorySemanticsMask::Flag MS, T V) {
return Ptr->fetch_add(V, ::cl::sycl::detail::getStdMemoryOrder(MS));
}

template <typename T>
extern T __spirv_AtomicISub(std::atomic<T> *Ptr, __spv::Scope::Flag S,
extern T __spirv_AtomicISub(std::atomic<T> *Ptr, __spv::Scope::Flag,
__spv::MemorySemanticsMask::Flag MS, T V) {
return Ptr->fetch_sub(V, ::cl::sycl::detail::getStdMemoryOrder(MS));
}

template <typename T>
extern T __spirv_AtomicAnd(std::atomic<T> *Ptr, __spv::Scope::Flag S,
extern T __spirv_AtomicAnd(std::atomic<T> *Ptr, __spv::Scope::Flag,
__spv::MemorySemanticsMask::Flag MS, T V) {
return Ptr->fetch_and(V, ::cl::sycl::detail::getStdMemoryOrder(MS));
}

template <typename T>
extern T __spirv_AtomicOr(std::atomic<T> *Ptr, __spv::Scope::Flag S,
extern T __spirv_AtomicOr(std::atomic<T> *Ptr, __spv::Scope::Flag,
__spv::MemorySemanticsMask::Flag MS, T V) {
return Ptr->fetch_or(V, ::cl::sycl::detail::getStdMemoryOrder(MS));
}

template <typename T>
extern T __spirv_AtomicXor(std::atomic<T> *Ptr, __spv::Scope::Flag S,
extern T __spirv_AtomicXor(std::atomic<T> *Ptr, __spv::Scope::Flag,
__spv::MemorySemanticsMask::Flag MS, T V) {
return Ptr->fetch_xor(V, ::cl::sycl::detail::getStdMemoryOrder(MS));
}

template <typename T>
extern T __spirv_AtomicMin(std::atomic<T> *Ptr, __spv::Scope::Flag S,
extern T __spirv_AtomicMin(std::atomic<T> *Ptr, __spv::Scope::Flag,
__spv::MemorySemanticsMask::Flag MS, T V) {
std::memory_order MemoryOrder = ::cl::sycl::detail::getStdMemoryOrder(MS);
T Val = Ptr->load(MemoryOrder);
Expand All @@ -147,7 +147,7 @@ extern T __spirv_AtomicMin(std::atomic<T> *Ptr, __spv::Scope::Flag S,
}

template <typename T>
extern T __spirv_AtomicMax(std::atomic<T> *Ptr, __spv::Scope::Flag S,
extern T __spirv_AtomicMax(std::atomic<T> *Ptr, __spv::Scope::Flag,
__spv::MemorySemanticsMask::Flag MS, T V) {
std::memory_order MemoryOrder = ::cl::sycl::detail::getStdMemoryOrder(MS);
T Val = Ptr->load(MemoryOrder);
Expand Down
3 changes: 1 addition & 2 deletions sycl/include/CL/sycl/buffer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -337,8 +337,7 @@ class buffer {
return outOfBounds;
}

bool isContiguousRegion(const id<1> &offset, const range<1> &newRange,
const range<1> &parentRange) {
bool isContiguousRegion(const id<1> &, const range<1> &, const range<1> &) {
// 1D sub buffer always has contiguous region
return true;
}
Expand Down
6 changes: 3 additions & 3 deletions sycl/include/CL/sycl/detail/aligned_allocator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,13 @@ template <typename T> class aligned_allocator {
}

// Release allocated memory
void deallocate(pointer Ptr, size_t size) {
void deallocate(pointer Ptr, size_t) {
if (Ptr)
detail::OSUtil::alignedFree(Ptr);
}

bool operator==(const aligned_allocator&) { return true; }
bool operator!=(const aligned_allocator& rhs) { return false; }
bool operator==(const aligned_allocator &) { return true; }
bool operator!=(const aligned_allocator &) { return false; }

void setAlignment(size_t Alignment) { MAlignment = Alignment; }

Expand Down
1 change: 1 addition & 0 deletions sycl/include/CL/sycl/detail/array.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ template <int dimensions = 1> class array {
PI_INVALID_VALUE);
}
#endif
(void)dimension;
}
};

Expand Down
3 changes: 1 addition & 2 deletions sycl/include/CL/sycl/detail/buffer_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ class __SYCL_EXPORT buffer_impl final : public SYCLMemObjT {
using typename BaseT::MemObjType;

public:
buffer_impl(size_t SizeInBytes, size_t RequiredAlign,
const property_list &Props,
buffer_impl(size_t SizeInBytes, size_t, const property_list &Props,
unique_ptr_class<SYCLMemObjAllocator> Allocator)
: BaseT(SizeInBytes, Props, std::move(Allocator)) {}

Expand Down
4 changes: 2 additions & 2 deletions sycl/include/CL/sycl/detail/cg.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ class HostKernel : public HostKernelBase {
// If local size for host is not set explicitly, let's adjust it to 1,
// so nd_range_error for zero local size is not thrown.
if (AdjustedRange.LocalSize[0] == 0)
for (int I = 0; I < AdjustedRange.Dims; ++I)
for (size_t I = 0; I < AdjustedRange.Dims; ++I)
AdjustedRange.LocalSize[I] = 1;
if (HPI)
HPI->start();
Expand All @@ -264,7 +264,7 @@ class HostKernel : public HostKernelBase {

template <class ArgT = KernelArgType>
typename std::enable_if<std::is_same<ArgT, void>::value>::type
runOnHost(const NDRDescT &NDRDesc) {
runOnHost(const NDRDescT &) {
MKernel();
}

Expand Down
3 changes: 1 addition & 2 deletions sycl/include/CL/sycl/detail/image_accessor_util.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,7 @@ convertToFloat4(vec<T, 4> Coords) {
// ptr.
template <typename T>
detail::enable_if_t<std::is_integral<T>::value, size_t>
getImageOffset(const T &Coords, const id<3> ImgPitch,
const uint8_t ElementSize) {
getImageOffset(const T &Coords, const id<3>, const uint8_t ElementSize) {
return Coords * ElementSize;
}

Expand Down
4 changes: 1 addition & 3 deletions sycl/include/CL/sycl/detail/image_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -242,9 +242,7 @@ class __SYCL_EXPORT image_impl final : public SYCLMemObjT {
});
}

template <typename T, typename... Args> bool checkAnyImpl(T Value) {
return false;
}
template <typename T, typename... Args> bool checkAnyImpl(T) { return false; }

template <typename ValT, typename VarT, typename... Args>
bool checkAnyImpl(ValT Value, VarT Variant, Args... Arguments) {
Expand Down
2 changes: 1 addition & 1 deletion sycl/include/CL/sycl/detail/kernel_desc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ template <class Name> struct SpecConstantInfo {
#ifndef __SYCL_UNNAMED_LAMBDA__
template <class KernelNameType> struct KernelInfo {
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
4 changes: 2 additions & 2 deletions sycl/include/CL/sycl/detail/pi.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -328,12 +328,12 @@ template <class To, class From> inline To cast(From value) {
}

// These conversions should use PI interop API.
template <> inline pi::PiProgram cast(cl_program interop) {
template <> inline pi::PiProgram cast(cl_program) {
RT::assertion(false, "pi::cast -> use piextProgramFromNative");
return {};
}

template <> inline pi::PiDevice cast(cl_device_id interop) {
template <> inline pi::PiDevice cast(cl_device_id) {
RT::assertion(false, "pi::cast -> use piextDeviceFromNative");
return {};
}
Expand Down
9 changes: 4 additions & 5 deletions sycl/include/CL/sycl/detail/stream_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -399,9 +399,8 @@ checkForInfNan(char *Buf, T Val) {

// Returns number of symbols written to the buffer
template <typename T>
inline EnableIfFP<T, unsigned> ScalarToStr(const T &Val, char *Buf,
unsigned Flags, int Width,
int Precision = -1) {
inline EnableIfFP<T, unsigned>
ScalarToStr(const T &Val, char *Buf, unsigned Flags, int, int Precision = -1) {
unsigned Offset = checkForInfNan(Buf, Val);
if (Offset)
return Offset;
Expand All @@ -428,8 +427,8 @@ inline EnableIfFP<T, unsigned> ScalarToStr(const T &Val, char *Buf,
// Returns number of symbols written to the buffer
template <typename T>
inline typename std::enable_if<std::is_integral<T>::value, unsigned>::type
ScalarToStr(const T &Val, char *Buf, unsigned Flags, int Width,
int Precision = -1) {
ScalarToStr(const T &Val, char *Buf, unsigned Flags, int, int Precision = -1) {
(void)Precision;
int Base = 10;

// append base manipulator
Expand Down
2 changes: 1 addition & 1 deletion sycl/include/CL/sycl/detail/sycl_mem_obj_allocator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class SYCLMemObjAllocatorHolder : public SYCLMemObjAllocator {

private:
template <typename T = AllocatorT>
EnableIfNonDefaultAllocator<T> setAlignImpl(std::size_t RequiredAlign) {
EnableIfNonDefaultAllocator<T> setAlignImpl(std::size_t) {
// Do nothing in case of user's allocator.
}

Expand Down
4 changes: 4 additions & 0 deletions sycl/include/CL/sycl/detail/sycl_mem_obj_t.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,10 @@ class __SYCL_EXPORT SYCLMemObjT : public SYCLMemObjI {

void *allocateMem(ContextImplPtr Context, bool InitFromUserData,
void *HostPtr, RT::PiEvent &InteropEvent) override {
(void)Context;
(void)InitFromUserData;
(void)HostPtr;
(void)InteropEvent;
throw runtime_error("Not implemented", PI_INVALID_OPERATION);
}

Expand Down
2 changes: 2 additions & 0 deletions sycl/include/CL/sycl/group.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ template <typename T, int Dimensions = 1> class private_memory {
// in the group:
Val.reset(new T[G.get_local_range().size()]);
#endif // __SYCL_DEVICE_ONLY__
(void)G;
}

// Access the instance for the current work-item
Expand All @@ -66,6 +67,7 @@ template <typename T, int Dimensions = 1> class private_memory {
size_t Ind = Id.get_physical_local().get_linear_id();
return Val.get()[Ind];
#else
(void)Id;
return Val;
#endif // __SYCL_DEVICE_ONLY__
}
Expand Down
Loading