Skip to content

Commit

Permalink
Fix memory_resource compilation in conda build (#4939)
Browse files Browse the repository at this point in the history
Update conda build to use C++17.
DALI assumes C++17 for build env, conda for some reason forced C++14.

Revert the code that conditionally includes memory_resource from experimental
if an older version of standard library is present (as happens in conda env).

Signed-off-by: Krzysztof Lecki <[email protected]>
  • Loading branch information
klecki authored and stiepan committed Jul 10, 2023
1 parent 8ba2bde commit 7fc2671
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
4 changes: 2 additions & 2 deletions conda/recipe/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ fi
ln -s $CC $BUILD_PREFIX/bin/gcc
ln -s $CXX $BUILD_PREFIX/bin/g++

# Force -std=c++14 in CXXFLAGS
export CXXFLAGS=${CXXFLAGS/-std=c++??/-std=c++14}
# Force -std=c++17 in CXXFLAGS
export CXXFLAGS=${CXXFLAGS/-std=c++??/-std=c++17}

# For some reason `aligned_alloc` is present when we use compiler version 5.4.x
# Adding NO_ALIGNED_ALLOC definition for cutt
Expand Down
11 changes: 5 additions & 6 deletions include/dali/core/mm/cuda_memory_resource.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,13 @@
#include <typeinfo>
#endif

// #if __has_include(<memory_resource>)
#if __has_include(<memory_resource>)
#include <memory_resource>
#define _DALI_STD_PMR_NS ::std::pmr
// #elif __has_include(<experimental/memory_resource>)
// #include <experimental/memory_resource>
// #define _DALI_STD_PMR_NS ::std::experimental::pmr
// #endif // __has_include(<experimental/memory_resource>)

#elif __has_include(<experimental/memory_resource>)
#include <experimental/memory_resource>
#define _DALI_STD_PMR_NS ::std::experimental::pmr
#endif // __has_include(<experimental/memory_resource>)

// no-op-define,
#define _DALI_TEMPLATE_VIS
Expand Down

0 comments on commit 7fc2671

Please sign in to comment.