CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
72 lines
2.3 KiB
C++
72 lines
2.3 KiB
C++
/*
|
|
* Copyright (c) Advanced Micro Devices, Inc., or its affiliates.
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*/
|
|
|
|
#pragma once
|
|
// We haven't checked which filesystem to include yet
|
|
#ifndef INCLUDE_STD_FILESYSTEM_EXPERIMENTAL
|
|
// Check for feature test macro for <filesystem>
|
|
#if defined(__cpp_lib_filesystem)
|
|
#define INCLUDE_STD_FILESYSTEM_EXPERIMENTAL 0
|
|
// Check for feature test macro for <experimental/filesystem>
|
|
#elif defined(__cpp_lib_experimental_filesystem)
|
|
#define INCLUDE_STD_FILESYSTEM_EXPERIMENTAL 1
|
|
// We can't check if headers exist...
|
|
// Let's assume experimental to be safe
|
|
#elif !defined(__has_include)
|
|
#define INCLUDE_STD_FILESYSTEM_EXPERIMENTAL 1
|
|
// Check if the header "<filesystem>" exists
|
|
#elif __has_include(<filesystem>)
|
|
// If we're compiling on Visual Studio and are not compiling with C++17,
|
|
// we need to use experimental
|
|
#ifdef _MSC_VER
|
|
// Check and include header that defines "_HAS_CXX17"
|
|
#if __has_include(<yvals_core.h>)
|
|
#include <yvals_core.h>
|
|
|
|
// Check for enabled C++17 support
|
|
#if defined(_HAS_CXX17) && _HAS_CXX17
|
|
// We're using C++17, so let's use the normal version
|
|
#define INCLUDE_STD_FILESYSTEM_EXPERIMENTAL 0
|
|
#endif
|
|
|
|
#endif
|
|
|
|
// If the marco isn't defined yet, that means any of the other
|
|
// VS specific checks failed, so we need to use experimental
|
|
#ifndef INCLUDE_STD_FILESYSTEM_EXPERIMENTAL
|
|
#define INCLUDE_STD_FILESYSTEM_EXPERIMENTAL 1
|
|
#endif
|
|
|
|
// Not on Visual Studio. Let's use the normal version
|
|
#else // #ifdef _MSC_VER
|
|
#define INCLUDE_STD_FILESYSTEM_EXPERIMENTAL 0
|
|
#endif
|
|
|
|
// Check if the header "<filesystem>" exists
|
|
#elif __has_include(<experimental/filesystem>)
|
|
#define INCLUDE_STD_FILESYSTEM_EXPERIMENTAL 1
|
|
|
|
// Fail if neither header is available with a nice error message
|
|
#else
|
|
#error Could not find system header "<filesystem>" ||
|
|
"<experimental/filesystem>"
|
|
#endif
|
|
|
|
// We priously determined that we need the exprimental version
|
|
#if INCLUDE_STD_FILESYSTEM_EXPERIMENTAL
|
|
// Include it
|
|
#define _SILENCE_EXPERIMENTAL_FILESYSTEM_DEPRECATION_WARNING 1;
|
|
#include <experimental/filesystem>
|
|
// We need the alias from std::experimental::filesystem to std::filesystem
|
|
namespace fs = std::experimental::filesystem;
|
|
// We have a decent compiler and can use the normal version
|
|
#else
|
|
// Include it
|
|
#include <filesystem>
|
|
namespace fs = std::filesystem;
|
|
#endif
|
|
|
|
#endif // #ifndef INCLUDE_STD_FILESYSTEM_EXPERIMENTAL
|