From 81c85487d9ddd8572619a2aa81964c44626a61e1 Mon Sep 17 00:00:00 2001 From: Eyal Rozenberg Date: Sat, 27 Aug 2022 22:33:17 +0300 Subject: [PATCH] Preliminary work before addressing #385: `nvrtc` -> `rtc` rename: * `nvrtc.hpp` * `nvrtc` directory * `nvrtc` `CMakeLists.txt` target All renamed to account for how, soon, we'll have more than one kind of real-time compilation. --- CMakeLists.txt | 4 ++-- examples/CMakeLists.txt | 8 ++++---- examples/modified_cuda_samples/clock_nvrtc/clock.cpp | 2 +- .../vectorAdd_nvrtc/vectorAdd_nvrtc.cpp | 2 +- .../other/inclusion_in_two_translation_units/main.cpp | 2 +- .../inclusion_in_two_translation_units/second_tu.cpp | 2 +- examples/other/jitify/jitify.cpp | 2 +- examples/rtc_common.hpp | 2 +- src/cuda/{nvrtc.hpp => rtc.hpp} | 10 +++++----- src/cuda/{nvrtc => rtc}/compilation_options.hpp | 0 src/cuda/{nvrtc => rtc}/compilation_output.hpp | 6 +++--- src/cuda/{nvrtc => rtc}/detail/marshalled_options.hpp | 2 +- src/cuda/{nvrtc => rtc}/detail/string_view.hpp | 0 src/cuda/{nvrtc => rtc}/error.hpp | 2 +- src/cuda/{nvrtc => rtc}/name_caching_program.hpp | 2 +- src/cuda/{nvrtc => rtc}/program.hpp | 8 ++++---- src/cuda/{nvrtc => rtc}/types.hpp | 2 +- src/cuda/{nvrtc => rtc}/versions.hpp | 2 +- 18 files changed, 29 insertions(+), 29 deletions(-) rename src/cuda/{nvrtc.hpp => rtc.hpp} (72%) rename src/cuda/{nvrtc => rtc}/compilation_options.hpp (100%) rename src/cuda/{nvrtc => rtc}/compilation_output.hpp (99%) rename src/cuda/{nvrtc => rtc}/detail/marshalled_options.hpp (98%) rename src/cuda/{nvrtc => rtc}/detail/string_view.hpp (100%) rename src/cuda/{nvrtc => rtc}/error.hpp (99%) rename src/cuda/{nvrtc => rtc}/name_caching_program.hpp (99%) rename src/cuda/{nvrtc => rtc}/program.hpp (98%) rename src/cuda/{nvrtc => rtc}/types.hpp (96%) rename src/cuda/{nvrtc => rtc}/versions.hpp (95%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3c987801..796fe6c9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -36,7 +36,7 @@ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "lib/") # Our library targets # ------------------- -set(targets runtime-and-driver nvtx nvrtc) +set(targets runtime-and-driver nvtx rtc) set(prefixed-targets "") foreach(wrapper_lib ${targets}) @@ -66,7 +66,7 @@ foreach(wrapper_lib ${targets}) OUTPUT_NAME ${wrapper_lib} ) endforeach() -target_link_libraries(caw_nvrtc INTERFACE cuda-api-wrappers::runtime-and-driver CUDA::nvrtc) +target_link_libraries(caw_rtc INTERFACE cuda-api-wrappers::runtime-and-driver CUDA::nvrtc) target_link_libraries(caw_nvtx INTERFACE cuda-api-wrappers::runtime-and-driver Threads::Threads CUDA::nvToolsExt ${CMAKE_DL_LIBS}) # Note: This is a bit like a poor man's configure.h file; diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 71d0463f..82609619 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -35,11 +35,11 @@ add_executable(vectorAdd modified_cuda_samples/vectorAdd/vectorAdd.cu) add_executable(vectorAddMapped modified_cuda_samples/vectorAddMapped/vectorAddMapped.cu) add_executable(vectorAddManaged modified_cuda_samples/vectorAddManaged/vectorAddManaged.cu) add_executable(vectorAdd_nvrtc modified_cuda_samples/vectorAdd_nvrtc/vectorAdd_nvrtc.cpp) -target_link_libraries(vectorAdd_nvrtc cuda-api-wrappers::nvrtc) +target_link_libraries(vectorAdd_nvrtc cuda-api-wrappers::rtc) if(CUDAToolkit_VERSION VERSION_GREATER_EQUAL "11.3") # Needs direct cubin access for NVRTC programs add_executable(clock_nvrtc modified_cuda_samples/clock_nvrtc/clock.cpp) - target_link_libraries(clock_nvrtc cuda-api-wrappers::nvrtc) + target_link_libraries(clock_nvrtc cuda-api-wrappers::rtc) endif() add_executable(simpleDrvRuntimePTX modified_cuda_samples/simpleDrvRuntimePTX/simpleDrvRuntimePTX.cpp) add_executable(inlinePTX modified_cuda_samples/inlinePTX/inlinePTX.cu) @@ -112,7 +112,7 @@ add_executable(vectorAdd_profiled other/vectorAdd_profiled.cu) target_link_libraries(vectorAdd_profiled cuda-api-wrappers::nvtx) add_executable(manipulate_current_device other/manipulate_current_device.cu) add_executable(inclusion_in_two_translation_units other/inclusion_in_two_translation_units/main.cpp other/inclusion_in_two_translation_units/second_tu.cpp) -target_link_libraries(inclusion_in_two_translation_units cuda-api-wrappers::nvrtc cuda-api-wrappers::nvtx) +target_link_libraries(inclusion_in_two_translation_units cuda-api-wrappers::rtc cuda-api-wrappers::nvtx) add_executable(runtime_api_header_collection other/runtime_api_header_collection.cpp) add_executable(jitify other/jitify/jitify.cpp) set(jitify_headers_target_dir ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/example_headers) @@ -125,7 +125,7 @@ foreach(hdr ${jitify_headers}) POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${hdr} ${jitify_headers_target_dir}) endforeach() -target_link_libraries(jitify cuda-api-wrappers::nvrtc stdc++fs) +target_link_libraries(jitify cuda-api-wrappers::rtc stdc++fs) if(NOT "${CMAKE_CUDA_COMPILER_ID}" STREQUAL "Clang") diff --git a/examples/modified_cuda_samples/clock_nvrtc/clock.cpp b/examples/modified_cuda_samples/clock_nvrtc/clock.cpp index 411ce72a..8e322a4c 100644 --- a/examples/modified_cuda_samples/clock_nvrtc/clock.cpp +++ b/examples/modified_cuda_samples/clock_nvrtc/clock.cpp @@ -26,7 +26,7 @@ #include "../../rtc_common.hpp" #include -#include +#include namespace clock_kernel { diff --git a/examples/modified_cuda_samples/vectorAdd_nvrtc/vectorAdd_nvrtc.cpp b/examples/modified_cuda_samples/vectorAdd_nvrtc/vectorAdd_nvrtc.cpp index 6ade5a75..5e2c1859 100644 --- a/examples/modified_cuda_samples/vectorAdd_nvrtc/vectorAdd_nvrtc.cpp +++ b/examples/modified_cuda_samples/vectorAdd_nvrtc/vectorAdd_nvrtc.cpp @@ -13,7 +13,7 @@ * used instead of regular host and device memory. */ -#include +#include #include #include diff --git a/examples/other/inclusion_in_two_translation_units/main.cpp b/examples/other/inclusion_in_two_translation_units/main.cpp index e14f3316..a13d72b0 100644 --- a/examples/other/inclusion_in_two_translation_units/main.cpp +++ b/examples/other/inclusion_in_two_translation_units/main.cpp @@ -1,6 +1,6 @@ #include #include -#include +#include #include #include diff --git a/examples/other/inclusion_in_two_translation_units/second_tu.cpp b/examples/other/inclusion_in_two_translation_units/second_tu.cpp index 756908b1..b7954c21 100644 --- a/examples/other/inclusion_in_two_translation_units/second_tu.cpp +++ b/examples/other/inclusion_in_two_translation_units/second_tu.cpp @@ -1,6 +1,6 @@ #include #include -#include +#include cuda::device::id_t get_current_device_id() { diff --git a/examples/other/jitify/jitify.cpp b/examples/other/jitify/jitify.cpp index ad0cfdd0..d45a9645 100644 --- a/examples/other/jitify/jitify.cpp +++ b/examples/other/jitify/jitify.cpp @@ -39,7 +39,7 @@ #include -#include +#include #include "type_name.hpp" diff --git a/examples/rtc_common.hpp b/examples/rtc_common.hpp index f66e98fd..b2ace0b3 100644 --- a/examples/rtc_common.hpp +++ b/examples/rtc_common.hpp @@ -9,7 +9,7 @@ #include #include -#include +#include #include diff --git a/src/cuda/nvrtc.hpp b/src/cuda/rtc.hpp similarity index 72% rename from src/cuda/nvrtc.hpp rename to src/cuda/rtc.hpp index cacf844c..6855866f 100644 --- a/src/cuda/nvrtc.hpp +++ b/src/cuda/rtc.hpp @@ -13,10 +13,10 @@ #error "The CUDA API headers can only be compiled with C++11 or a later version of the C++ language standard" #endif -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #endif // CUDA_NVRTC_WRAPPERS_HPP_ diff --git a/src/cuda/nvrtc/compilation_options.hpp b/src/cuda/rtc/compilation_options.hpp similarity index 100% rename from src/cuda/nvrtc/compilation_options.hpp rename to src/cuda/rtc/compilation_options.hpp diff --git a/src/cuda/nvrtc/compilation_output.hpp b/src/cuda/rtc/compilation_output.hpp similarity index 99% rename from src/cuda/nvrtc/compilation_output.hpp rename to src/cuda/rtc/compilation_output.hpp index a68fadb4..0bc505c1 100644 --- a/src/cuda/nvrtc/compilation_output.hpp +++ b/src/cuda/rtc/compilation_output.hpp @@ -7,9 +7,9 @@ #ifndef CUDA_API_WRAPPERS_NVRTC_OUTPUT_HPP_ #define CUDA_API_WRAPPERS_NVRTC_OUTPUT_HPP_ -#include -#include -#include +#include +#include +#include #include #include diff --git a/src/cuda/nvrtc/detail/marshalled_options.hpp b/src/cuda/rtc/detail/marshalled_options.hpp similarity index 98% rename from src/cuda/nvrtc/detail/marshalled_options.hpp rename to src/cuda/rtc/detail/marshalled_options.hpp index ca22f49e..c6224bd6 100644 --- a/src/cuda/nvrtc/detail/marshalled_options.hpp +++ b/src/cuda/rtc/detail/marshalled_options.hpp @@ -1,7 +1,7 @@ #ifndef SRC_CUDA_API_DETAIL_MARSHALLED_OPTIONS_HPP_ #define SRC_CUDA_API_DETAIL_MARSHALLED_OPTIONS_HPP_ -#include +#include #include #include diff --git a/src/cuda/nvrtc/detail/string_view.hpp b/src/cuda/rtc/detail/string_view.hpp similarity index 100% rename from src/cuda/nvrtc/detail/string_view.hpp rename to src/cuda/rtc/detail/string_view.hpp diff --git a/src/cuda/nvrtc/error.hpp b/src/cuda/rtc/error.hpp similarity index 99% rename from src/cuda/nvrtc/error.hpp rename to src/cuda/rtc/error.hpp index 70af2102..7c48dd23 100644 --- a/src/cuda/nvrtc/error.hpp +++ b/src/cuda/rtc/error.hpp @@ -9,7 +9,7 @@ #ifndef CUDA_API_WRAPPERS_NVRTC_ERROR_HPP_ #define CUDA_API_WRAPPERS_NVRTC_ERROR_HPP_ -#include +#include #include diff --git a/src/cuda/nvrtc/name_caching_program.hpp b/src/cuda/rtc/name_caching_program.hpp similarity index 99% rename from src/cuda/nvrtc/name_caching_program.hpp rename to src/cuda/rtc/name_caching_program.hpp index 6a690acc..e02ecf83 100644 --- a/src/cuda/nvrtc/name_caching_program.hpp +++ b/src/cuda/rtc/name_caching_program.hpp @@ -7,7 +7,7 @@ #ifndef CUDA_API_WRAPPERS_NVRTC_NAME_CACHING_PROGRAM_HPP_ #define CUDA_API_WRAPPERS_NVRTC_NAME_CACHING_PROGRAM_HPP_ -#include +#include #include #include diff --git a/src/cuda/nvrtc/program.hpp b/src/cuda/rtc/program.hpp similarity index 98% rename from src/cuda/nvrtc/program.hpp rename to src/cuda/rtc/program.hpp index 1927fecb..c021e7a5 100644 --- a/src/cuda/nvrtc/program.hpp +++ b/src/cuda/rtc/program.hpp @@ -7,10 +7,10 @@ #ifndef CUDA_API_WRAPPERS_NVRTC_PROGRAM_HPP_ #define CUDA_API_WRAPPERS_NVRTC_PROGRAM_HPP_ -#include -#include -#include -#include +#include +#include +#include +#include #include #include diff --git a/src/cuda/nvrtc/types.hpp b/src/cuda/rtc/types.hpp similarity index 96% rename from src/cuda/nvrtc/types.hpp rename to src/cuda/rtc/types.hpp index ba7d3c0e..778f7272 100644 --- a/src/cuda/nvrtc/types.hpp +++ b/src/cuda/rtc/types.hpp @@ -21,7 +21,7 @@ using string_view = ::std::string_view; // namespace filesystem = ::std::filesystem; } #else -#include +#include namespace cuda { using string_view = bpstd::string_view; } diff --git a/src/cuda/nvrtc/versions.hpp b/src/cuda/rtc/versions.hpp similarity index 95% rename from src/cuda/nvrtc/versions.hpp rename to src/cuda/rtc/versions.hpp index 1a8e5d7e..9fa02cd9 100644 --- a/src/cuda/nvrtc/versions.hpp +++ b/src/cuda/rtc/versions.hpp @@ -8,7 +8,7 @@ #ifndef CUDA_API_WRAPPERS_NVRTC_VERSIONS_HPP_ #define CUDA_API_WRAPPERS_NVRTC_VERSIONS_HPP_ -#include +#include #include namespace cuda {