diff --git a/cmake/cuda/determine_thrust_paths.cmake b/cmake/cuda/determine_thrust_paths.cmake index 5857d6b4f..cc50de471 100644 --- a/cmake/cuda/determine_thrust_paths.cmake +++ b/cmake/cuda/determine_thrust_paths.cmake @@ -4,7 +4,17 @@ function(stdgpu_determine_thrust_paths STDGPU_OUTPUT_THRUST_PATHS) find_package(CUDAToolkit QUIET) - set(${STDGPU_OUTPUT_THRUST_PATHS} "${CUDAToolkit_INCLUDE_DIRS}") + if(CUDAToolkit_VERSION VERSION_GREATER_EQUAL 13 AND CMAKE_VERSION VERSION_LESS 3.31.9) + set(STDGPU_CUDATOOLKIT_INCLUDE_DIRS "${CUDAToolkit_INCLUDE_DIRS}") + + foreach(dir IN LISTS CUDAToolkit_INCLUDE_DIRS) + list(APPEND STDGPU_CUDATOOLKIT_INCLUDE_DIRS "${dir}/cccl") + endforeach() + + set(${STDGPU_OUTPUT_THRUST_PATHS} "${STDGPU_CUDATOOLKIT_INCLUDE_DIRS}") + else() + set(${STDGPU_OUTPUT_THRUST_PATHS} "${CUDAToolkit_INCLUDE_DIRS}") + endif() # Make output variable visible set(${STDGPU_OUTPUT_THRUST_PATHS} ${${STDGPU_OUTPUT_THRUST_PATHS}} PARENT_SCOPE) diff --git a/src/stdgpu/cuda/impl/device.cpp b/src/stdgpu/cuda/impl/device.cpp index 03dd3bb4a..161ec3f19 100644 --- a/src/stdgpu/cuda/impl/device.cpp +++ b/src/stdgpu/cuda/impl/device.cpp @@ -50,8 +50,10 @@ namespace stdgpu::cuda void print_device_information() { + int device = 0; + cudaDeviceProp properties; - if (cudaGetDeviceProperties(&properties, 0) != cudaSuccess) + if (cudaGetDeviceProperties(&properties, device) != cudaSuccess) { printf("+---------------------------------------------------------+\n"); printf("| Invalid CUDA Device |\n"); @@ -66,6 +68,9 @@ print_device_information() std::size_t total_memory = 0; STDGPU_CUDA_SAFE_CALL(cudaMemGetInfo(&free_memory, &total_memory)); + int clock_rate = 0; + cudaDeviceGetAttribute(&clock_rate, cudaDevAttrClockRate, device); + std::string gpu_name = properties.name; const int gpu_name_total_width = 57; int gpu_name_size = static_cast(gpu_name.size()); @@ -77,7 +82,7 @@ print_device_information() printf("+---------------------------------------------------------+\n"); printf("| Compute Capability : %1d.%1d |\n", properties.major, properties.minor); printf("| Clock rate : %-6.0f MHz |\n", - static_cast(detail::kilo_to_mega_hertz(static_cast(properties.clockRate)))); + static_cast(detail::kilo_to_mega_hertz(static_cast(clock_rate)))); printf("| Global Memory : %-6.3f GiB / %-6.3f GiB |\n", static_cast(detail::byte_to_gibi_byte(static_cast(free_memory))), static_cast(detail::byte_to_gibi_byte(static_cast(total_memory)))); diff --git a/src/stdgpu/iterator.h b/src/stdgpu/iterator.h index 5a7d1b5b4..647901914 100644 --- a/src/stdgpu/iterator.h +++ b/src/stdgpu/iterator.h @@ -50,38 +50,6 @@ using device_ptr = thrust::pointer; template using host_ptr = thrust::pointer; -} // namespace stdgpu - -//! @cond Doxygen_Suppress -namespace std // NOLINT(cert-dcl58-cpp) -{ - -template -struct iterator_traits> // NOLINT(cert-dcl58-cpp) -{ - using difference_type = typename std::iterator_traits::difference_type; - using value_type = typename std::iterator_traits::value_type; - using pointer = typename std::iterator_traits::pointer; - using reference = typename std::iterator_traits::reference; - using iterator_category = typename stdgpu::device_ptr::iterator_category; -}; - -template -struct iterator_traits> // NOLINT(cert-dcl58-cpp) -{ - using difference_type = typename std::iterator_traits::difference_type; - using value_type = typename std::iterator_traits::value_type; - using pointer = typename std::iterator_traits::pointer; - using reference = typename std::iterator_traits::reference; - using iterator_category = typename stdgpu::host_ptr::iterator_category; -}; - -} // namespace std -//! @endcond - -namespace stdgpu -{ - /** * \ingroup iterator * \brief Constructs a device_ptr object