Skip to content
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

Explicitly mark RMM headers with RMM_EXPORT #1654

Merged
Show file tree
Hide file tree
Changes from 5 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
6 changes: 4 additions & 2 deletions include/rmm/aligned.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@

#pragma once

#include <rmm/detail/export.hpp>

#include <cassert>
#include <cstddef>
#include <cstdint>

namespace rmm {
namespace RMM_NAMESPACE {

/**
* @addtogroup utilities
Expand Down Expand Up @@ -123,4 +125,4 @@ static constexpr std::size_t CUDA_ALLOCATION_ALIGNMENT{256};

/** @} */ // end of group

} // namespace rmm
} // namespace RMM_NAMESPACE
5 changes: 3 additions & 2 deletions include/rmm/cuda_device.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@

#include <rmm/aligned.hpp>
#include <rmm/detail/error.hpp>
#include <rmm/detail/export.hpp>

#include <cuda_runtime_api.h>

namespace rmm {
namespace RMM_NAMESPACE {

struct cuda_device_id;
inline cuda_device_id get_current_cuda_device();
Expand Down Expand Up @@ -175,4 +176,4 @@ struct cuda_set_device_raii {
};

/** @} */ // end of group
} // namespace rmm
} // namespace RMM_NAMESPACE
7 changes: 4 additions & 3 deletions include/rmm/cuda_stream.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, NVIDIA CORPORATION.
* Copyright (c) 2020-2024, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -18,14 +18,15 @@

#include <rmm/cuda_stream_view.hpp>
#include <rmm/detail/error.hpp>
#include <rmm/detail/export.hpp>
#include <rmm/detail/logging_assert.hpp>

#include <cuda_runtime_api.h>

#include <functional>
#include <memory>

namespace rmm {
namespace RMM_NAMESPACE {
/**
* @addtogroup cuda_streams
* @{
Expand Down Expand Up @@ -139,4 +140,4 @@ class cuda_stream {
};

/** @} */ // end of group
} // namespace rmm
} // namespace RMM_NAMESPACE
7 changes: 4 additions & 3 deletions include/rmm/cuda_stream_pool.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020-2021, NVIDIA CORPORATION.
* Copyright (c) 2020-2024, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -19,12 +19,13 @@
#include <rmm/cuda_stream.hpp>
#include <rmm/cuda_stream_view.hpp>
#include <rmm/detail/error.hpp>
#include <rmm/detail/export.hpp>

#include <atomic>
#include <cstddef>
#include <vector>

namespace rmm {
namespace RMM_NAMESPACE {
/**
* @addtogroup cuda_streams
* @{
Expand Down Expand Up @@ -102,4 +103,4 @@ class cuda_stream_pool {
};

/** @} */ // end of group
} // namespace rmm
} // namespace RMM_NAMESPACE
7 changes: 4 additions & 3 deletions include/rmm/cuda_stream_view.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020-2021, NVIDIA CORPORATION.
* Copyright (c) 2020-2024, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -17,6 +17,7 @@
#pragma once

#include <rmm/detail/error.hpp>
#include <rmm/detail/export.hpp>

#include <cuda/stream_ref>
#include <cuda_runtime_api.h>
Expand All @@ -25,7 +26,7 @@
#include <cstddef>
#include <cstdint>

namespace rmm {
namespace RMM_NAMESPACE {
/**
* @addtogroup cuda_streams
* @{
Expand Down Expand Up @@ -201,4 +202,4 @@ inline std::ostream& operator<<(std::ostream& os, cuda_stream_view stream)
}

/** @} */ // end of group
} // namespace rmm
} // namespace RMM_NAMESPACE
7 changes: 5 additions & 2 deletions include/rmm/detail/aligned.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,16 @@
#pragma once

#include <rmm/aligned.hpp>
#include <rmm/detail/export.hpp>

#include <cassert>
#include <cstddef>
#include <cstdint>
#include <memory>
#include <new>

namespace rmm::detail {
namespace RMM_NAMESPACE {
namespace detail {

/**
* @brief Allocates sufficient host-accessible memory to satisfy the requested size `bytes` with
Expand Down Expand Up @@ -112,4 +114,5 @@ void aligned_host_deallocate(void* ptr,

dealloc(original);
}
} // namespace rmm::detail
} // namespace detail
} // namespace RMM_NAMESPACE
9 changes: 6 additions & 3 deletions include/rmm/detail/dynamic_load_runtime.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022, NVIDIA CORPORATION.
* Copyright (c) 2022-2024, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -16,6 +16,7 @@
#pragma once

#include <rmm/cuda_device.hpp>
#include <rmm/detail/export.hpp>

#include <cuda_runtime_api.h>

Expand All @@ -24,7 +25,8 @@
#include <memory>
#include <optional>

namespace rmm::detail {
namespace RMM_NAMESPACE {
namespace detail {

/**
* @brief `dynamic_load_runtime` loads the cuda runtime library at runtime
Expand Down Expand Up @@ -185,4 +187,5 @@ struct async_alloc {
#endif

#undef RMM_CUDART_API_WRAPPER
} // namespace rmm::detail
} // namespace detail
} // namespace RMM_NAMESPACE
7 changes: 4 additions & 3 deletions include/rmm/detail/export.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021, NVIDIA CORPORATION.
* Copyright (c) 2021-2024, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -18,8 +18,9 @@

// Macros used for defining symbol visibility, only GLIBC is supported
#if (defined(__GNUC__) && !defined(__MINGW32__) && !defined(__MINGW64__))
#define RMM_EXPORT __attribute__((visibility("default")))
#define RMM_HIDDEN __attribute__((visibility("hidden")))
#define RMM_EXPORT __attribute__((visibility("default")))
#define RMM_HIDDEN __attribute__((visibility("hidden")))
#define RMM_NAMESPACE RMM_EXPORT rmm
#else
#define RMM_EXPORT
#define RMM_HIDDEN
Expand Down
9 changes: 6 additions & 3 deletions include/rmm/detail/stack_trace.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020-2021, NVIDIA CORPORATION.
* Copyright (c) 2020-2024, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -17,6 +17,7 @@
#pragma once

#include <rmm/detail/error.hpp>
#include <rmm/detail/export.hpp>

// execinfo is a linux-only library, so stack traces will only be available on
// linux systems.
Expand All @@ -36,7 +37,8 @@
#include <vector>
#endif

namespace rmm::detail {
namespace RMM_NAMESPACE {
namespace detail {

/**
* @brief stack_trace is a class that will capture a stack on instantiation for output later.
Expand Down Expand Up @@ -102,4 +104,5 @@ class stack_trace {
#endif // RMM_ENABLE_STACK_TRACES
};

} // namespace rmm::detail
} // namespace detail
} // namespace RMM_NAMESPACE
7 changes: 4 additions & 3 deletions include/rmm/device_buffer.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019-2022, NVIDIA CORPORATION.
* Copyright (c) 2019-2024, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -18,6 +18,7 @@
#include <rmm/cuda_device.hpp>
#include <rmm/cuda_stream_view.hpp>
#include <rmm/detail/error.hpp>
#include <rmm/detail/export.hpp>
#include <rmm/mr/device/per_device_resource.hpp>
#include <rmm/resource_ref.hpp>

Expand All @@ -29,7 +30,7 @@
#include <stdexcept>
#include <utility>

namespace rmm {
namespace RMM_NAMESPACE {
/**
* @addtogroup data_containers
* @{
Expand Down Expand Up @@ -479,4 +480,4 @@ class device_buffer {
};

/** @} */ // end of group
} // namespace rmm
} // namespace RMM_NAMESPACE
5 changes: 3 additions & 2 deletions include/rmm/device_scalar.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@
#pragma once

#include <rmm/cuda_stream_view.hpp>
#include <rmm/detail/export.hpp>
#include <rmm/device_uvector.hpp>
#include <rmm/mr/device/per_device_resource.hpp>
#include <rmm/resource_ref.hpp>

#include <type_traits>

namespace rmm {
namespace RMM_NAMESPACE {
/**
* @addtogroup data_containers
* @{
Expand Down Expand Up @@ -277,4 +278,4 @@ class device_scalar {
};

/** @} */ // end of group
} // namespace rmm
} // namespace RMM_NAMESPACE
7 changes: 4 additions & 3 deletions include/rmm/device_uvector.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020-2022, NVIDIA CORPORATION.
* Copyright (c) 2020-2024, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -19,6 +19,7 @@
#include <rmm/cuda_stream_view.hpp>
#include <rmm/detail/error.hpp>
#include <rmm/detail/exec_check_disable.hpp>
#include <rmm/detail/export.hpp>
#include <rmm/device_buffer.hpp>
#include <rmm/mr/device/per_device_resource.hpp>
#include <rmm/resource_ref.hpp>
Expand All @@ -28,7 +29,7 @@
#include <cstddef>
#include <vector>

namespace rmm {
namespace RMM_NAMESPACE {
/**
* @addtogroup data_containers
* @{
Expand Down Expand Up @@ -565,4 +566,4 @@ class device_uvector {
};

/** @} */ // end of group
} // namespace rmm
} // namespace RMM_NAMESPACE
7 changes: 4 additions & 3 deletions include/rmm/device_vector.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, NVIDIA CORPORATION.
* Copyright (c) 2020-2024, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -16,12 +16,13 @@

#pragma once

#include <rmm/detail/export.hpp>
#include <rmm/detail/thrust_namespace.h>
#include <rmm/mr/device/thrust_allocator_adaptor.hpp>

#include <thrust/device_vector.h>

namespace rmm {
namespace RMM_NAMESPACE {
/**
* @addtogroup thrust_integrations
* @{
Expand All @@ -35,4 +36,4 @@ template <typename T>
using device_vector = thrust::device_vector<T, rmm::mr::thrust_allocator<T>>;

/** @} */ // end of group
} // namespace rmm
} // namespace RMM_NAMESPACE
6 changes: 4 additions & 2 deletions include/rmm/error.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@

#pragma once

#include <rmm/detail/export.hpp>

#include <stdexcept>
#include <string>

namespace rmm {
namespace RMM_NAMESPACE {

/**
* @brief Exception thrown when logical precondition is violated.
Expand Down Expand Up @@ -109,4 +111,4 @@ class out_of_range : public std::out_of_range {
using std::out_of_range::out_of_range;
};

} // namespace rmm
} // namespace RMM_NAMESPACE
5 changes: 3 additions & 2 deletions include/rmm/exec_policy.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,15 @@
#pragma once

#include <rmm/cuda_stream_view.hpp>
#include <rmm/detail/export.hpp>
#include <rmm/detail/thrust_namespace.h>
#include <rmm/mr/device/thrust_allocator_adaptor.hpp>
#include <rmm/resource_ref.hpp>

#include <thrust/system/cuda/execution_policy.h>
#include <thrust/version.h>

namespace rmm {
namespace RMM_NAMESPACE {
/**
* @addtogroup thrust_integrations
* @{
Expand Down Expand Up @@ -97,4 +98,4 @@ using exec_policy_nosync =
#endif

/** @} */ // end of group
} // namespace rmm
} // namespace RMM_NAMESPACE
Loading
Loading