mirror of
https://github.com/NVIDIA/nvbench.git
synced 2026-03-14 20:27:24 +00:00
Use experimental/filesystem on GCC.
This commit is contained in:
@@ -63,6 +63,11 @@ else()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# GCC-specific flags
|
||||
if (CMAKE_CXX_COMPILER_ID STREQUAL GNU)
|
||||
target_link_libraries(nvbench.build_interface INTERFACE stdc++fs)
|
||||
endif()
|
||||
|
||||
# CUDA-specific flags
|
||||
target_compile_options(nvbench.build_interface INTERFACE
|
||||
$<$<COMPILE_LANG_AND_ID:CUDA,NVIDIA>:-Xcudafe=--display_error_number>
|
||||
|
||||
@@ -35,7 +35,6 @@
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
#include <cstdint>
|
||||
#include <filesystem>
|
||||
#include <fstream>
|
||||
#include <iterator>
|
||||
#include <ostream>
|
||||
@@ -44,6 +43,12 @@
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#ifdef __GNUC__
|
||||
#include <experimental/filesystem>
|
||||
#else
|
||||
#include <filesystem>
|
||||
#endif
|
||||
|
||||
#if NVBENCH_CPP_DIALECT >= 2020
|
||||
#include <bit>
|
||||
#endif
|
||||
@@ -94,7 +99,7 @@ void write_named_values(JsonNode &node, const nvbench::named_values &values)
|
||||
break;
|
||||
|
||||
default:
|
||||
NVBENCH_THROW(std::runtime_error, "Unrecognized value type.");
|
||||
NVBENCH_THROW(std::runtime_error, "{}", "Unrecognized value type.");
|
||||
} // end switch (value type)
|
||||
} // end foreach value name
|
||||
}
|
||||
@@ -136,7 +141,11 @@ void json_printer::do_process_bulk_data_float64(
|
||||
|
||||
if (hint == "sample_times")
|
||||
{
|
||||
#ifdef __GNUC__
|
||||
namespace fs = std::experimental::filesystem;
|
||||
#else
|
||||
namespace fs = std::filesystem;
|
||||
#endif
|
||||
|
||||
nvbench::cpu_timer timer;
|
||||
timer.start();
|
||||
|
||||
Reference in New Issue
Block a user