Skip to content
Merged
14 changes: 10 additions & 4 deletions cmake/AISCompilerOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,16 @@ function (ais_set_compiler_flags target)
endif()
set(compiler_id "${CMAKE_${language}_COMPILER_ID}")
set(compiler_version "${CMAKE_${language}_COMPILER_VERSION}")
if(compiler_id STREQUAL "GNU" OR compiler_id STREQUAL "NVIDIA")
get_ais_gnu_warning_flags(compiler_flags compiler_version)
elseif(compiler_id STREQUAL "Clang")
get_ais_clang_warning_flags(compiler_flags compiler_version)

# Only use default flags with include-what-you-use. Otherwise you'll
# clutter the output with a lot of "unrecognized flags" warnings if
# there's mismatch between IWYU's clang and the compiler you are using.
if(NOT AIS_USE_IWYU)
if(compiler_id STREQUAL "GNU" OR compiler_id STREQUAL "NVIDIA")
get_ais_gnu_warning_flags(compiler_flags compiler_version)
elseif(compiler_id STREQUAL "Clang")
get_ais_clang_warning_flags(compiler_flags compiler_version)
endif()
endif()
target_compile_options(${target} PRIVATE $<$<COMPILE_LANG_AND_ID:${language},${compiler_id}>:${compiler_flags}>)
if(BUILD_CODE_COVERAGE)
Expand Down
5 changes: 4 additions & 1 deletion hipfile/examples/aiscp/aiscp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,16 @@
* Note: Currently SOURCE's size must be > 0 and a multiple of 4096.
*/

#include <hip/hip_runtime.h>
#include <hipfile.h>
#include <hip/hip_runtime_api.h>

#include <cerrno>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>

/// @brief Open and register a file
Expand Down
9 changes: 3 additions & 6 deletions hipfile/include/hipfile.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,13 @@

#pragma once

#include <hipfile-types.h>
#include <hip/hip_runtime_api.h>

#include <sys/socket.h>
#include <sys/types.h>

#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>

#include <hipfile-types.h>
#include <sys/socket.h>
#include <sys/types.h>

#if defined(__GNUC__)
#define HIPFILE_API __attribute__((visibility("default")))
Expand Down
11 changes: 5 additions & 6 deletions hipfile/src/amd_detail/hipfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,16 @@
*/

#include "hipfile-rocfile.h"
#include "hipfile-types.h"
#include "hipfile.h"

#include "rocfile.h"

#include <hip/hip_runtime_api.h>

#include <sys/types.h>

#include <cerrno>
#include <climits>
#include <cstdint>
#include <cstdlib>
#include <limits>
#include <hip/hip_runtime_api.h>
#include <sys/types.h>
#include <vector>

using namespace std;
Expand Down
2 changes: 2 additions & 0 deletions hipfile/src/common/hipfile-common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

#include "hipfile.h"

#include <hip/hip_runtime_api.h>

const char *
hipFileOpStatusError(hipFileOpError_t status)
{
Expand Down
7 changes: 5 additions & 2 deletions hipfile/test/hipfile-rocfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,15 @@

#include "hipfile.h"
#include "hipfile-rocfile.h"
#include "test-common.h"

#include "hipfile-warnings.h"
#include "invalid-enum.h"
#include "rocfile.h"
#include "test-common.h"

#include <gtest/gtest.h>
#include <hip/hip_runtime_api.h>
#include <memory>
#include <stdexcept>

// Put tests inside the macros to suppress the global constructor
// warnings
Expand Down
6 changes: 1 addition & 5 deletions hipfile/test/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,11 @@
* SPDX-License-Identifier: MIT
*/

#include "test-common.h"

#include "hipfile-warnings.h"
#include "invalid-enum.h"

#include <gtest/gtest.h>
#include <hip/hip_runtime.h>

#include <ctime>
#include <memory>

using namespace std;

Expand Down
3 changes: 2 additions & 1 deletion hipfile/test/system/buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@
#include "test-common.h"
#include "test-shared-fixtures.h"

#include <cstdint>
#include <gtest/gtest.h>
#include <hip/hip_runtime_api.h>
#include <stdint.h>
#include <memory>

HIPFILE_WARN_NO_GLOBAL_CTOR_OFF

Expand Down
2 changes: 2 additions & 0 deletions hipfile/test/system/version.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
#include "hipfile-warnings.h"
#include "test-common.h"

#include <climits>
#include <gtest/gtest.h>
#include <memory>

HIPFILE_WARN_NO_GLOBAL_CTOR_OFF

Expand Down
5 changes: 3 additions & 2 deletions hipfile/test/test-hipfile-batch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,16 @@

#include "hipfile-warnings.h"

#include <hip/hip_runtime.h>
#include <hip/hip_runtime_api.h>

#include <cerrno>
#include <cstdarg>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <fcntl.h>
#include <unistd.h>
#include <sys/stat.h>
#include <sys/types.h>

#define MAX_BATCH_IO_OPS 16
#define MAX_BUFFER_SIZE 4096
Expand Down
5 changes: 3 additions & 2 deletions hipfile/test/test-hipfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,16 @@

#include "hipfile.h"

#include <hip/hip_runtime.h>
#include <hip/hip_runtime_api.h>

#include <cerrno>
#include <cinttypes>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <fcntl.h>
#include <unistd.h>
#include <sys/stat.h>
#include <sys/types.h>

void static print_drv_props(hipFileDriverProps_t hipfile_props)
{
Expand Down
8 changes: 2 additions & 6 deletions rocfile/include/rocfile.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,12 @@

#pragma once

#include <hipfile-types.h>
#include <hip/hip_runtime_api.h>

#include <sys/socket.h>
#include <sys/types.h>

#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>

#include <hipfile-types.h>
#include <sys/types.h>

#if defined(__GNUC__)
#define ROCFILE_API __attribute__((visibility("default")))
Expand Down
13 changes: 13 additions & 0 deletions rocfile/src/async.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,23 @@

#include "async.h"
#include "context.h"
#include "stream.h"
#include "sys.h"

#include <memory>
#include <stdexcept>
#include <syslog.h>
#include <utility>

namespace rocFile {
class IBuffer;
}
namespace rocFile {
class IFile;
}
namespace rocFile {
enum class IoType;
}

namespace rocFile {

Expand Down
18 changes: 14 additions & 4 deletions rocfile/src/async.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@
*/
#pragma once

#include "buffer.h"
#include "file.h"
#include "io.h"
#include "stream.h"
#include "hipfile-types.h"

#include <condition_variable>
#include <memory>
Expand All @@ -18,6 +15,19 @@
#include <variant>
#include <vector>

namespace rocFile {
class IBuffer;
}
namespace rocFile {
class IFile;
}
namespace rocFile {
class IStream;
}
namespace rocFile {
enum class IoType;
}

namespace rocFile {

class AsyncOp {
Expand Down
16 changes: 15 additions & 1 deletion rocfile/src/backend/asyncop-fallback.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,26 @@
* SPDX-License-Identifier: MIT
*/

#include "async.h"
#include "asyncop-fallback.h"
#include "buffer.h"
#include "context.h"
#include "hip.h"
#include "sys.h"

#include <syslog.h>
#include <memory>
#include <new>
#include <syslog.h>

namespace rocFile {
class IFile;
}
namespace rocFile {
class IStream;
}
namespace rocFile {
enum class IoType;
}

using namespace rocFile;

Expand Down
17 changes: 17 additions & 0 deletions rocfile/src/backend/asyncop-fallback.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,23 @@
#pragma once

#include "async.h"
#include "hipfile-types.h"

#include <memory>
#include <sys/types.h>

namespace rocFile {
class IBuffer;
}
namespace rocFile {
class IFile;
}
namespace rocFile {
class IStream;
}
namespace rocFile {
enum class IoType;
}

namespace rocFile {

Expand Down
14 changes: 12 additions & 2 deletions rocfile/src/backend/fallback.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,21 @@
* SPDX-License-Identifier: MIT
*/

#include "backend.h"
#include "buffer.h"
#include "context.h"
#include "fallback.h"
#include "rocfile.h"
#include "file.h"
#include "hip.h"
#include "io.h"
#include "sys.h"

#include <limits>
#include <algorithm>
#include <cerrno>
#include <cstdint>
#include <hip/hip_runtime_api.h>
#include <hip/driver_types.h>
#include <stdexcept>
#include <sys/mman.h>

using namespace rocFile;
Expand Down
16 changes: 14 additions & 2 deletions rocfile/src/backend/fallback.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,20 @@
#pragma once

#include "backend.h"
#include "file.h"
#include "io.h"
#include "hipfile-types.h"

#include <memory>
#include <sys/types.h>

namespace rocFile {
class IBuffer;
}
namespace rocFile {
class IFile;
}
namespace rocFile {
enum class IoType;
}

namespace rocFile {

Expand Down
8 changes: 5 additions & 3 deletions rocfile/src/batch/batch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,20 @@
*/

#include "batch.h"
#include "buffer.h"
#include "context.h"
#include "file.h"
#include "state.h"

#include "hipfile-warnings.h"
#include "rocfile.h"
#include "state.h"

#include <cstddef>
#include <memory>
#include <mutex>
#include <shared_mutex>
#include <sstream>
#include <string>
#include <unordered_map>
#include <utility>
#include <vector>

namespace rocFile {
Expand Down
Loading