Skip to content

Commit 2248716

Browse files
committed
Merge remote-tracking branch 'clara-parabricks/dev' into omosafi/support-calendar-versioning
2 parents 24a08b5 + 3393212 commit 2248716

35 files changed

+262
-111
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,6 @@
3333
[submodule "3rdparty/htslib"]
3434
path = 3rdparty/htslib
3535
url = https://github.com/samtools/htslib.git
36+
[submodule "3rdparty/libcudacxx"]
37+
path = 3rdparty/libcudacxx
38+
url = https://github.com/NVIDIA/libcudacxx

3rdparty/libcudacxx

Submodule libcudacxx added at d0bafdb

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,10 @@ else()
6868
set_property(GLOBAL PROPERTY gw_library_type STATIC)
6969
endif()
7070

71-
include(cmake/CXX.cmake)
7271
include(cmake/CUDA.cmake)
73-
include(cmake/Doxygen.cmake)
7472
include(cmake/3rdparty.cmake)
73+
include(cmake/CXX.cmake) # Must occur after 3rdparty modules are added
74+
include(cmake/Doxygen.cmake)
7575
include(cmake/Tests.cmake)
7676
include(cmake/Benchmarks.cmake)
7777
include(cmake/Format.cmake)

cmake/3rdparty.cmake

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ add_library(cub INTERFACE IMPORTED)
4242
#cmake before 3.11, use the following for now:
4343
set_property(TARGET cub APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${CUB_DIR}")
4444

45+
set(LIBCUDACXX_DIR ${PROJECT_SOURCE_DIR}/3rdparty/libcudacxx CACHE STRING "Path to libcu++ repo.")
46+
add_library(libcudacxx INTERFACE IMPORTED)
47+
set_property(TARGET libcudacxx APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${LIBCUDACXX_DIR}/include")
48+
4549
set(KSEQPP_DIR ${PROJECT_SOURCE_DIR}/3rdparty/kseqpp/src CACHE STRING
4650
"Path to kseqpp repo")
4751

cmake/CXX.cmake

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,6 @@ set(CMAKE_CXX_STANDARD 17)
2121

2222
#Add OpenMP
2323
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp")
24+
25+
# Add common copmiler checks
26+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -Wall -Wextra")

cmake/Format.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ function(gw_enable_formatting_targets)
8686
endforeach()
8787

8888
add_custom_target(format DEPENDS ${format_list} COMMENT "Format source files")
89-
add_custom_target(check-format DEPENDS ${format_check_list} COMMENT "Check format of source files")
89+
add_custom_target(check-format ALL DEPENDS ${format_check_list} COMMENT "Check format of source files")
9090
else()
9191
message(STATUS "clang-format not found. Auto-formatting disabled.")
9292
endif()

common/base/include/claraparabricks/genomeworks/utils/device_buffer.hpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ class buffer
105105
buffer(buffer&& rhs)
106106
: data_(std::exchange(rhs.data_, nullptr))
107107
, size_(std::exchange(rhs.size_, 0))
108-
, streams_(rhs.streams_)
108+
, streams_(std::exchange(rhs.streams_, {}))
109109
, allocator_(rhs.allocator_)
110110
{
111111
}
@@ -116,9 +116,13 @@ class buffer
116116
/// \return refrence to this buffer.
117117
buffer& operator=(buffer&& rhs)
118118
{
119+
if (nullptr != data_)
120+
{
121+
allocator_.deallocate(data_, size_);
122+
}
119123
data_ = std::exchange(rhs.data_, nullptr);
120124
size_ = std::exchange(rhs.size_, 0);
121-
streams_ = rhs.streams_;
125+
streams_ = std::exchange(rhs.streams_, {});
122126
allocator_ = rhs.allocator_;
123127
return *this;
124128
}

common/base/include/claraparabricks/genomeworks/utils/genomeutils.hpp

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -143,16 +143,12 @@ inline std::vector<std::string> generate_random_sequences(std::string const& bac
143143

144144
inline void reverse_complement(const char* src, const int32_t length, char* dest)
145145
{
146+
// lookup for substitution: A -> T; C -> G; T -> A; G -> C.
147+
constexpr char lookup[] = {'T', 'G', 'A', 'C'};
146148
for (int32_t pos = 0; pos < length; pos++)
147149
{
148-
switch (char nucleotide = src[length - 1 - pos])
149-
{
150-
case 'A': dest[pos] = 'T'; break;
151-
case 'T': dest[pos] = 'A'; break;
152-
case 'C': dest[pos] = 'G'; break;
153-
case 'G': dest[pos] = 'C'; break;
154-
default: dest[pos] = nucleotide;
155-
}
150+
const unsigned char nucleotide = src[length - 1 - pos];
151+
dest[pos] = lookup[(nucleotide >> 1) & 0x3];
156152
}
157153
}
158154

common/base/include/claraparabricks/genomeworks/utils/limits.cuh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ namespace claraparabricks
2626
namespace genomeworks
2727
{
2828
#ifdef GW_CUDA_BEFORE_10_1
29+
#pragma GCC diagnostic push
30+
#pragma GCC diagnostic ignored "-Wignored-qualifiers"
2931
template <typename T>
3032
struct numeric_limits
3133
{
@@ -44,6 +46,7 @@ struct numeric_limits<int32_t>
4446
GW_CONSTEXPR static __device__ int32_t max() { return INT32_MAX; }
4547
GW_CONSTEXPR static __device__ int32_t min() { return INT32_MIN; }
4648
};
49+
#pragma GCC diagnostic pop
4750
#else
4851
using std::numeric_limits;
4952
#endif

common/base/include/claraparabricks/genomeworks/utils/pinned_host_vector.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@
1717
#pragma once
1818

1919
#include <vector>
20+
#pragma GCC diagnostic push
21+
#pragma GCC diagnostic ignored "-Wunused-parameter"
2022
#include <thrust/system/cuda/experimental/pinned_allocator.h>
23+
#pragma GCC diagnostic pop
2124

2225
namespace claraparabricks
2326
{

0 commit comments

Comments
 (0)