Skip to content

Commit

Permalink
Preliminary work before addressing #385: nvrtc -> rtc rename:
Browse files Browse the repository at this point in the history
* `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.
  • Loading branch information
eyalroz committed Oct 8, 2022
1 parent 0ce420d commit 9aad2f5
Show file tree
Hide file tree
Showing 18 changed files with 29 additions and 29 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand Down Expand Up @@ -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;
Expand Down
8 changes: 4 additions & 4 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand All @@ -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")

Expand Down
2 changes: 1 addition & 1 deletion examples/modified_cuda_samples/clock_nvrtc/clock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#include "../../rtc_common.hpp"

#include <cuda/api.hpp>
#include <cuda/nvrtc.hpp>
#include <cuda/rtc.hpp>

namespace clock_kernel {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* used instead of regular host and device memory.
*/

#include <cuda/nvrtc.hpp>
#include <cuda/rtc.hpp>
#include <cuda/api.hpp>

#include <iostream>
Expand Down
2 changes: 1 addition & 1 deletion examples/other/inclusion_in_two_translation_units/main.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <cuda/api.hpp>
#include <cuda/nvtx.hpp>
#include <cuda/nvrtc.hpp>
#include <cuda/rtc.hpp>

#include <cstdlib>
#include <iostream>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <cuda/api.hpp>
#include <cuda/nvtx.hpp>
#include <cuda/nvrtc.hpp>
#include <cuda/rtc.hpp>

cuda::device::id_t get_current_device_id()
{
Expand Down
2 changes: 1 addition & 1 deletion examples/other/jitify/jitify.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@


#include <cuda/api.hpp>
#include <cuda/nvrtc.hpp>
#include <cuda/rtc.hpp>

#include "type_name.hpp"

Expand Down
2 changes: 1 addition & 1 deletion examples/rtc_common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include <string>
#include <iostream>

#include <cuda/nvrtc.hpp>
#include <cuda/rtc.hpp>

#include <iostream>

Expand Down
10 changes: 5 additions & 5 deletions src/cuda/nvrtc.hpp → src/cuda/rtc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <cuda/nvrtc/error.hpp>
#include <cuda/nvrtc/compilation_options.hpp>
#include <cuda/nvrtc/versions.hpp>
#include <cuda/nvrtc/compilation_output.hpp>
#include <cuda/nvrtc/program.hpp>
#include <cuda/rtc/error.hpp>
#include <cuda/rtc/compilation_options.hpp>
#include <cuda/rtc/versions.hpp>
#include <cuda/rtc/compilation_output.hpp>
#include <cuda/rtc/program.hpp>

#endif // CUDA_NVRTC_WRAPPERS_HPP_
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
#ifndef CUDA_API_WRAPPERS_NVRTC_OUTPUT_HPP_
#define CUDA_API_WRAPPERS_NVRTC_OUTPUT_HPP_

#include <cuda/nvrtc/compilation_options.hpp>
#include <cuda/nvrtc/error.hpp>
#include <cuda/nvrtc/types.hpp>
#include <cuda/rtc/compilation_options.hpp>
#include <cuda/rtc/error.hpp>
#include <cuda/rtc/types.hpp>
#include <cuda/api.hpp>

#include <vector>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef SRC_CUDA_API_DETAIL_MARSHALLED_OPTIONS_HPP_
#define SRC_CUDA_API_DETAIL_MARSHALLED_OPTIONS_HPP_

#include <cuda/nvrtc/types.hpp>
#include <cuda/rtc/types.hpp>

#include <cstdlib>
#include <vector>
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/cuda/nvrtc/error.hpp → src/cuda/rtc/error.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#ifndef CUDA_API_WRAPPERS_NVRTC_ERROR_HPP_
#define CUDA_API_WRAPPERS_NVRTC_ERROR_HPP_

#include <cuda/nvrtc/types.hpp>
#include <cuda/rtc/types.hpp>

#include <cuda_runtime_api.h>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#ifndef CUDA_API_WRAPPERS_NVRTC_NAME_CACHING_PROGRAM_HPP_
#define CUDA_API_WRAPPERS_NVRTC_NAME_CACHING_PROGRAM_HPP_

#include <cuda/nvrtc/program.hpp>
#include <cuda/rtc/program.hpp>

#include <algorithm>
#include <cstring>
Expand Down
8 changes: 4 additions & 4 deletions src/cuda/nvrtc/program.hpp → src/cuda/rtc/program.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
#ifndef CUDA_API_WRAPPERS_NVRTC_PROGRAM_HPP_
#define CUDA_API_WRAPPERS_NVRTC_PROGRAM_HPP_

#include <cuda/nvrtc/compilation_options.hpp>
#include <cuda/nvrtc/compilation_output.hpp>
#include <cuda/nvrtc/error.hpp>
#include <cuda/nvrtc/types.hpp>
#include <cuda/rtc/compilation_options.hpp>
#include <cuda/rtc/compilation_output.hpp>
#include <cuda/rtc/error.hpp>
#include <cuda/rtc/types.hpp>
#include <cuda/api.hpp>

#include <vector>
Expand Down
2 changes: 1 addition & 1 deletion src/cuda/nvrtc/types.hpp → src/cuda/rtc/types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ using string_view = ::std::string_view;
// namespace filesystem = ::std::filesystem;
}
#else
#include <cuda/nvrtc/detail/string_view.hpp>
#include <cuda/rtc/detail/string_view.hpp>
namespace cuda {
using string_view = bpstd::string_view;
}
Expand Down
2 changes: 1 addition & 1 deletion src/cuda/nvrtc/versions.hpp → src/cuda/rtc/versions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#ifndef CUDA_API_WRAPPERS_NVRTC_VERSIONS_HPP_
#define CUDA_API_WRAPPERS_NVRTC_VERSIONS_HPP_

#include <cuda/nvrtc/error.hpp>
#include <cuda/rtc/error.hpp>
#include <cuda/api/versions.hpp>

namespace cuda {
Expand Down

0 comments on commit 9aad2f5

Please sign in to comment.