From 914cce8d3b3917c053cd862a633c49a9d4f120e4 Mon Sep 17 00:00:00 2001 From: Eyal Rozenberg Date: Mon, 8 Apr 2024 21:47:55 +0300 Subject: [PATCH] Fixes #631: Getting rid of gratuitous compilation-option-printing functions and the `examples/rtc_common.hpp` header --- .../clock_nvrtc/clock.cpp | 2 - examples/other/jitify/jitify.cpp | 4 +- examples/rtc_common.hpp | 41 ------------------- 3 files changed, 1 insertion(+), 46 deletions(-) delete mode 100644 examples/rtc_common.hpp diff --git a/examples/modified_cuda_samples/clock_nvrtc/clock.cpp b/examples/modified_cuda_samples/clock_nvrtc/clock.cpp index 7bf80379..779c99c7 100644 --- a/examples/modified_cuda_samples/clock_nvrtc/clock.cpp +++ b/examples/modified_cuda_samples/clock_nvrtc/clock.cpp @@ -23,8 +23,6 @@ #include #include -#include "../../rtc_common.hpp" - #include #include diff --git a/examples/other/jitify/jitify.cpp b/examples/other/jitify/jitify.cpp index 9a0df971..4c3ab896 100644 --- a/examples/other/jitify/jitify.cpp +++ b/examples/other/jitify/jitify.cpp @@ -35,8 +35,6 @@ */ #include "../../common.hpp" -#include "../../rtc_common.hpp" - #include #include @@ -116,7 +114,7 @@ void handle_compilation_failure( { std::cerr << "Program compilation failed:\n"; auto compilation_log = compilation_output.log(); - std::cerr << "Compilation options were: " << compilation_options << '\n'; + std::cerr << "Compilation options were: " << cuda::rtc::render(compilation_options) << '\n'; if (not compilation_log.empty()) { std::cerr << "Compilation log:\n" diff --git a/examples/rtc_common.hpp b/examples/rtc_common.hpp deleted file mode 100644 index c5154b3e..00000000 --- a/examples/rtc_common.hpp +++ /dev/null @@ -1,41 +0,0 @@ -/** - * @file - * - * @brief Common header for CUDA API wrapper example programs which utilize NVRTC - */ -#ifndef EXAMPLES_RTC_COMMON_HPP_ -#define EXAMPLES_RTC_COMMON_HPP_ - -#include -#include - -#include - -#include - -template -std::ostream &operator<<(std::ostream &os, const cuda::rtc::compilation_options_t &opts) -{ - auto marshalled = cuda::rtc::marshal(opts); -// os << '(' << marshalled.option_ptrs().size() << ") compilation options: "; - bool first_option{true}; - for (auto opt: marshalled.option_ptrs()) { - if (first_option) { first_option = false; } - else { os << ' '; } - os << opt; - } - return os; -} - -template -inline void print_compilation_options(cuda::rtc::compilation_options_t compilation_options) -{ - auto marshalled = cuda::rtc::marshal(compilation_options); - std::cout << "Compiling with " << marshalled.option_ptrs().size() << " compilation options:\n"; - for (auto opt: marshalled.option_ptrs()) { - std::cout << "Option: " << opt << '\n'; - } -} - - -#endif // EXAMPLES_RTC_COMMON_HPP_