Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMake: Split handling of CUDA backend into separate files #11

Merged
merged 2 commits into from
Oct 28, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions doc/Doxyfile.in
Original file line number Diff line number Diff line change
Expand Up @@ -842,9 +842,8 @@ EXCLUDE_SYMLINKS = NO
# Note that the wildcards are matched against the file with absolute path, so to
# exclude all test directories for example use the pattern */test/*

EXCLUDE_PATTERNS = */impl/*.cuh \
*/impl/*.h \
*/impl/*.hpp
EXCLUDE_PATTERNS = */impl/* \
*/cuda/*

# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
# (namespaces, classes, functions, etc.) that should be excluded from the
Expand Down
8 changes: 4 additions & 4 deletions src/stdgpu/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,18 @@ configure_file("${STDGPU_INCLUDE_LOCAL_DIR}/stdgpu/config.h.in"

add_library(stdgpu STATIC)

add_subdirectory(cuda)

target_sources(stdgpu PRIVATE impl/bitset.cu
impl/iterator.cpp
impl/memory.cpp
impl/mutex.cu
impl/limits.cpp
impl/cuda/memory.cpp)
impl/limits.cpp)

target_include_directories(stdgpu PUBLIC
$<BUILD_INTERFACE:${STDGPU_INCLUDE_LOCAL_DIR}>
$<BUILD_INTERFACE:${STDGPU_CONFIG_BUILD_DIR}>
$<INSTALL_INTERFACE:${STDGPU_INCLUDE_INSTALL_DIR}>
${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES})
$<INSTALL_INTERFACE:${STDGPU_INCLUDE_INSTALL_DIR}>)

add_library(stdgpu::stdgpu ALIAS stdgpu)

Expand Down
5 changes: 5 additions & 0 deletions src/stdgpu/cuda/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

target_sources(stdgpu PRIVATE impl/memory.cpp)

target_include_directories(stdgpu PUBLIC
${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES})
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ atomicMax(float* address,



#include <stdgpu/impl/cuda/atomic_detail.cuh>
#include <stdgpu/cuda/impl/atomic_detail.cuh>



Expand Down
2 changes: 1 addition & 1 deletion src/stdgpu/impl/cuda/bit.cuh → src/stdgpu/cuda/bit.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ popcount(const unsigned long long int number);



#include <stdgpu/impl/cuda/bit_detail.cuh>
#include <stdgpu/cuda/impl/bit_detail.cuh>


#endif // STDGPU_CUDA_BIT_H
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* limitations under the License.
*/

#include <stdgpu/impl/cuda/memory.h>
#include <stdgpu/cuda/memory.h>

#include <cstdio>
#include <exception>
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/stdgpu/impl/atomic_detail.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#ifndef STDGPU_ATOMIC_DETAIL_H
#define STDGPU_ATOMIC_DETAIL_H

#include <stdgpu/impl/cuda/atomic.cuh>
#include <stdgpu/cuda/atomic.cuh>
#include <stdgpu/memory.h>
#include <stdgpu/platform.h>

Expand Down
2 changes: 1 addition & 1 deletion src/stdgpu/impl/bit_detail.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#define STDGPU_BIT_DETAIL_H

#if STDGPU_DEVICE_COMPILER == STDGPU_DEVICE_COMPILER_NVCC
#include <stdgpu/impl/cuda/bit.cuh>
#include <stdgpu/cuda/bit.cuh>
#endif
#include <stdgpu/contract.h>
#include <stdgpu/limits.h>
Expand Down
2 changes: 1 addition & 1 deletion src/stdgpu/impl/memory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include <map>
#include <mutex>

#include <stdgpu/impl/cuda/memory.h>
#include <stdgpu/cuda/memory.h>
#include <stdgpu/contract.h>


Expand Down
7 changes: 3 additions & 4 deletions test/stdgpu/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@

add_executable(teststdgpu main.cpp)

target_sources(teststdgpu PRIVATE cuda/atomic.cu
cuda/bit.cu
algorithm.cpp
add_subdirectory(cuda)

target_sources(teststdgpu PRIVATE algorithm.cpp
atomic.cu
bit.cpp
bitset.cu
Expand All @@ -21,7 +21,6 @@ target_sources(teststdgpu PRIVATE cuda/atomic.cu
vector.cu)

target_include_directories(teststdgpu PRIVATE
${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES}
"${CMAKE_CURRENT_SOURCE_DIR}/..") # test_utils

target_link_libraries(teststdgpu PRIVATE
Expand Down
3 changes: 3 additions & 0 deletions test/stdgpu/cuda/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

target_sources(teststdgpu PRIVATE atomic.cu
bit.cu)