Skip to content

Commit

Permalink
Merge branch 'branch-24.12' of https://github.com/rapidsai/kvikio int…
Browse files Browse the repository at this point in the history
…o remote-io
  • Loading branch information
madsbk committed Oct 7, 2024
2 parents 4ed88a2 + e64c363 commit cc7b291
Show file tree
Hide file tree
Showing 8 changed files with 59 additions and 23 deletions.
41 changes: 38 additions & 3 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ concurrency:
jobs:
pr-builder:
needs:
- changed-files
- checks
- conda-cpp-build
- conda-cpp-tests
Expand All @@ -24,6 +25,37 @@ jobs:
- wheel-python-tests
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/[email protected]
if: always()
with:
needs: ${{ toJSON(needs) }}
changed-files:
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/[email protected]
with:
files_yaml: |
test_cpp:
- '**'
- '!.devcontainer/**'
- '!.pre-commit-config.yaml'
- '!CONTRIBUTING.md'
- '!README.md'
- '!docs/**'
- '!notebooks/**'
- '!python/**'
test_notebooks:
- '**'
- '!.devcontainer/**'
- '!.pre-commit-config.yaml'
- '!CONTRIBUTING.md'
- '!README.md'
test_python:
- '**'
- '!.devcontainer/**'
- '!.pre-commit-config.yaml'
- '!CONTRIBUTING.md'
- '!README.md'
- '!docs/**'
- '!notebooks/**'
checks:
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/[email protected]
Expand All @@ -34,9 +66,10 @@ jobs:
with:
build_type: pull-request
conda-cpp-tests:
needs: conda-cpp-build
needs: [conda-cpp-build, changed-files]
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/[email protected]
if: fromJSON(needs.changed-files.outputs.changed_file_groups).test_cpp
with:
build_type: pull-request
conda-python-build:
Expand All @@ -46,9 +79,10 @@ jobs:
with:
build_type: pull-request
conda-python-tests:
needs: conda-python-build
needs: [conda-python-build, changed-files]
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/[email protected]
if: fromJSON(needs.changed-files.outputs.changed_file_groups).test_python
with:
build_type: pull-request
docs-build:
Expand Down Expand Up @@ -86,9 +120,10 @@ jobs:
build_type: pull-request
script: ci/build_wheel_python.sh
wheel-python-tests:
needs: wheel-python-build
needs: [wheel-python-build, changed-files]
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/[email protected]
if: fromJSON(needs.changed-files.outputs.changed_file_groups).test_python
with:
build_type: pull-request
script: ci/test_wheel.sh
2 changes: 1 addition & 1 deletion cpp/include/kvikio/bounce_buffer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ class AllocRetain {
return _clear();
}

static AllocRetain& instance()
KVIKIO_EXPORT static AllocRetain& instance()
{
static AllocRetain _instance;
return _instance;
Expand Down
2 changes: 1 addition & 1 deletion cpp/include/kvikio/defaults.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ class defaults {
}
}

static defaults* instance()
KVIKIO_EXPORT static defaults* instance()
{
static defaults _instance;
return &_instance;
Expand Down
2 changes: 1 addition & 1 deletion cpp/include/kvikio/posix_io.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class StreamsByThread {
// cuDevicePrimaryCtxReset() or cudaDeviceReset() before program termination.
~StreamsByThread() = default;

static CUstream get(CUcontext ctx, std::thread::id thd_id)
KVIKIO_EXPORT static CUstream get(CUcontext ctx, std::thread::id thd_id)
{
static StreamsByThread _instance;

Expand Down
2 changes: 1 addition & 1 deletion cpp/include/kvikio/shim/cuda.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class cudaAPI {
cudaAPI(cudaAPI const&) = delete;
void operator=(cudaAPI const&) = delete;

static cudaAPI& instance()
KVIKIO_EXPORT static cudaAPI& instance()
{
static cudaAPI _instance;
return _instance;
Expand Down
2 changes: 1 addition & 1 deletion cpp/include/kvikio/shim/cufile.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ class cuFileAPI {
cuFileAPI(cuFileAPI const&&) = delete;
void operator=(cuFileAPI const&&) = delete;

static cuFileAPI& instance()
KVIKIO_EXPORT static cuFileAPI& instance()
{
static cuFileAPI _instance;
return _instance;
Expand Down
17 changes: 16 additions & 1 deletion cpp/include/kvikio/shim/utils.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021-2023, 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 @@ -23,6 +23,21 @@

namespace kvikio {

// Macros used for defining symbol visibility.
// Since KvikIO is header-only, we rely on the linker to disambiguate inline functions
// and static methods that have (or return) static references. To do this, the relevant
// function/method must have `__attribute__((visibility("default")))`. If not, then if
// KvikIO is used in two different DSOs, the function will appear twice, and there will
// be two static objects.
// See <https://gcc.gnu.org/wiki/Visibility> and <https://github.com/rapidsai/kvikio/issues/442>.
#if (defined(__GNUC__) || defined(__clang__)) && !defined(__MINGW32__) && !defined(__MINGW64__)
#define KVIKIO_EXPORT __attribute__((visibility("default")))
#define KVIKIO_HIDDEN __attribute__((visibility("hidden")))
#else
#define KVIKIO_EXPORT
#define KVIKIO_HIDDEN
#endif

#define KVIKIO_STRINGIFY_DETAIL(x) #x
#define KVIKIO_STRINGIFY(x) KVIKIO_STRINGIFY_DETAIL(x)

Expand Down
14 changes: 0 additions & 14 deletions cpp/include/kvikio/utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,6 @@
#include <kvikio/error.hpp>
#include <kvikio/shim/cuda.hpp>

// Macros used for defining symbol visibility, only GLIBC is supported.
// Since KvikIO is header-only, we rely on the linker to disambiguate inline functions
// that have (or return) static references. To do this, the relevant function must have
// `__attribute__((visibility("default")))`. If not, then if KvikIO is used in two
// different DSOs, the function will appear twice, and there will be two static objects.
// See <https://github.com/rapidsai/kvikio/issues/442>.
#if (defined(__GNUC__) || defined(__clang__)) && !defined(__MINGW32__) && !defined(__MINGW64__)
#define KVIKIO_EXPORT __attribute__((visibility("default")))
#define KVIKIO_HIDDEN __attribute__((visibility("hidden")))
#else
#define KVIKIO_EXPORT
#define KVIKIO_HIDDEN
#endif

namespace kvikio {

// cuFile defines a page size to 4 KiB
Expand Down

0 comments on commit cc7b291

Please sign in to comment.