Skip to content

Commit

Permalink
read env vars
Browse files Browse the repository at this point in the history
  • Loading branch information
vuule committed Dec 23, 2024
1 parent 45b40c5 commit cfaa891
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cpp/src/utilities/host_memory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
* limitations under the License.
*/

#include "io/utilities/getenv_or.hpp"

#include <cudf/detail/utilities/stream_pool.hpp>
#include <cudf/logger.hpp>
#include <cudf/utilities/error.hpp>
Expand Down Expand Up @@ -277,7 +279,7 @@ bool config_default_pinned_memory_resource(pinned_mr_options const& opts)
CUDF_EXPORT auto& kernel_pinned_copy_threshold()
{
// use cudaMemcpyAsync for all pinned copies
static std::atomic<size_t> threshold = 0;
static std::atomic<size_t> threshold = getenv_or("LIBCUDF_KERNEL_PINNED_COPY_THRESHOLD", 0);
return threshold;
}

Expand All @@ -291,7 +293,7 @@ size_t get_kernel_pinned_copy_threshold() { return kernel_pinned_copy_threshold(
CUDF_EXPORT auto& allocate_host_as_pinned_threshold()
{
// use pageable memory for all host allocations
static std::atomic<size_t> threshold = 0;
static std::atomic<size_t> threshold = getenv_or("LIBCUDF_ALLOCATE_HOST_AS_PINNED_THRESHOLD", 0);
return threshold;
}

Expand Down

0 comments on commit cfaa891

Please sign in to comment.