Patch from github.

At the moment it is not possible to build ROCr with Clang. This is
a spurious limitation. The present PR addresses it by guarding GCC
only flags and by fixing some additional warnings that Clang triggers;
one of said warnings did outline a rather interesting issue with math
being done on void*s. - AlexVlx

Void ptr arithmetic had already been fixed in amd-master branch.

Change-Id: I5ee97e20b5c40b10dd73facecabe75f02ba46462
This commit is contained in:
Sean Keely
2019-04-18 19:18:31 -05:00
parent 0c6b9532d4
commit e89f9807f1
8 ha cambiato i file con 26 aggiunte e 21 eliminazioni
+4 -1
Vedi File
@@ -110,7 +110,10 @@ else ()
endif ()
## ------------------------- Linux Compiler and Linker options -------------------------
set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -fexceptions -fno-rtti -fvisibility=hidden -Wno-error=sign-compare -Wno-sign-compare -Wno-write-strings -Wno-conversion-null -fno-math-errno -fno-threadsafe-statics -fmerge-all-constants -fms-extensions -Wno-error=comment -Wno-comment -Wno-error=pointer-arith -Wno-pointer-arith -Wno-error=unused-variable -Wno-error=unused-but-set-variable -Wno-error=unused-function" )
set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -fexceptions -fno-rtti -fvisibility=hidden -Wno-error=sign-compare -Wno-sign-compare -Wno-write-strings -Wno-conversion-null -fno-math-errno -fno-threadsafe-statics -fmerge-all-constants -fms-extensions -Wno-error=comment -Wno-comment -Wno-error=pointer-arith -Wno-pointer-arith -Wno-error=unused-variable -Wno-error=unused-function" )
if ( CMAKE_COMPILER_IS_GNUCXX )
set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error=unused-but-set-variable")
endif ()
set ( DRVDEF "${CMAKE_CURRENT_SOURCE_DIR}/hsacore.so.def" )
@@ -10,7 +10,7 @@
## AMD Research and AMD HSA Software Development
##
## Advanced Micro Devices, Inc.
##
##
## www.amd.com
##
## Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -55,7 +55,9 @@ if(UNIX)
set(PS ":")
set(CMAKE_CXX_FLAGS "-Wall -std=c++11 ${EXTRA_CFLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpic")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,--unresolved-symbols=ignore-in-shared-libs")
if (CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,--unresolved-symbols=ignore-in-shared-libs")
endif ()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-strict-aliasing")
if ( CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m64 -msse -msse2" )
+1 -1
Vedi File
@@ -162,7 +162,7 @@ class HostQueue : public Queue {
void operator delete(void*, void*) {}
protected:
bool _IsA(Queue::rtti_t id) const { return id == &rtti_id_; }
bool _IsA(Queue::rtti_t id) const override { return id == &rtti_id_; }
private:
static int rtti_id_;
@@ -122,7 +122,7 @@ class QueueWrapper : public Queue {
void SetProfiling(bool enabled) override { wrapped->SetProfiling(enabled); }
protected:
void do_set_public_handle(hsa_queue_t* handle) {
void do_set_public_handle(hsa_queue_t* handle) override {
public_handle_ = handle;
wrapped->set_public_handle(wrapped.get(), handle);
}
@@ -243,12 +243,12 @@ class InterceptQueue : public QueueProxy, private LocalSignal, public DoorbellSi
/// @brief Update signal value using Relaxed semantics
///
/// @param value Value of signal to update with
void StoreRelaxed(hsa_signal_value_t value);
void StoreRelaxed(hsa_signal_value_t value) override;
/// @brief Update signal value using Release semantics
///
/// @param value Value of signal to update with
void StoreRelease(hsa_signal_value_t value) {
void StoreRelease(hsa_signal_value_t value) override {
std::atomic_thread_fence(std::memory_order_release);
StoreRelaxed(value);
}
@@ -257,7 +257,7 @@ class InterceptQueue : public QueueProxy, private LocalSignal, public DoorbellSi
static __forceinline bool IsType(core::Queue* queue) { return queue->IsType(&rtti_id_); }
protected:
bool _IsA(Queue::rtti_t id) const { return id == &rtti_id_; }
bool _IsA(Queue::rtti_t id) const override { return id == &rtti_id_; }
private:
static int rtti_id_;
@@ -2,24 +2,24 @@
//
// The University of Illinois/NCSA
// Open Source License (NCSA)
//
//
// Copyright (c) 2014-2015, Advanced Micro Devices, Inc. All rights reserved.
//
//
// Developed by:
//
//
// AMD Research and AMD HSA Software Development
//
//
// Advanced Micro Devices, Inc.
//
//
// www.amd.com
//
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal with the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following conditions:
//
//
// - Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimers.
// - Redistributions in binary form must reproduce the above copyright
@@ -29,7 +29,7 @@
// nor the names of its contributors may be used to endorse or promote
// products derived from this Software without specific prior written
// permission.
//
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
@@ -730,7 +730,7 @@ void BlitSdma<RingIndexTy, HwIndexMonotonic, SizeToCountOffset>::BuildCopyRectCo
Ex. range->x=71, assume max range is 16 elements: We can break at 64 giving tiles:
[0,63], [64-70] (width 64 & 7). 64 is covered by element 4 (16B) and 7 is covered by element 0
(1B). Exactly covering 71 requires using element 0.
Base addresses in each tile must be DWORD aligned, if not then the offset from an aligned address
must be represented in elements. This may reduce the size of the element, but since elements are
integer multiples of each other this is harmless.
@@ -63,7 +63,7 @@ static const uint16_t kBarrierHeader = (HSA_PACKET_TYPE_BARRIER_AND << HSA_PACKE
(HSA_FENCE_SCOPE_NONE << HSA_PACKET_HEADER_ACQUIRE_FENCE_SCOPE) |
(HSA_FENCE_SCOPE_NONE << HSA_PACKET_HEADER_RELEASE_FENCE_SCOPE);
static const hsa_barrier_and_packet_t kBarrierPacket = {kInvalidHeader, 0, 0, 0, 0, 0, 0, 0, 0, 0};
static const hsa_barrier_and_packet_t kBarrierPacket = {kInvalidHeader, 0, 0, {}, 0, {}};
int InterceptQueue::rtti_id_ = 0;
@@ -422,7 +422,7 @@ private:
/// @brief Not copy-assignable.
PrefixOption& operator =(const PrefixOption&);
bool ProcessTokens(std::list<std::string> &tokens);
bool ProcessTokens(std::list<std::string>& tokens) override;
std::string::size_type FindPrefix(const std::string& token) const;
+2 -2
Vedi File
@@ -115,9 +115,9 @@ protected:
, is_definition(_is_definition)
, address(_address) {}
virtual bool GetInfo(hsa_symbol_info32_t symbol_info, void *value);
virtual bool GetInfo(hsa_symbol_info32_t symbol_info, void* value) override;
private:
private:
SymbolImpl(const SymbolImpl &s);
SymbolImpl& operator=(const SymbolImpl &s);
};