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

[cudaextender] Add CUDA Extender module with Ungapped X-Drop extension #564

Merged
Show file tree
Hide file tree
Changes from 86 commits
Commits
Show all changes
107 commits
Select commit Hold shift + click to select a range
ba7a09c
[cudaungappedextender] Add skeleton for API and sample usage in segalign
atadkase Aug 21, 2020
950e305
[cudaungappedextender] fix copy-pasta
atadkase Aug 21, 2020
a8fd9e4
Add basic samples
atadkase Aug 22, 2020
75ae4ba
[cudaungappedextender] Add sample data
atadkase Aug 22, 2020
83748b4
[cudaungappedextender] Correct obviously wrong data types
atadkase Aug 22, 2020
ee2e3dd
[cudaue] Add return 0
atadkase Aug 22, 2020
e28449b
[cudaue] namespace scope change
atadkase Aug 22, 2020
a7a3f07
[cudaue] Free CUDA memory in device sample
atadkase Aug 24, 2020
03781e3
[cudaue] Fix comment
atadkase Aug 24, 2020
a940113
[cudaue] Primary formatting
atadkase Aug 24, 2020
0a71edf
[cudaungappedextender]Address comments
atadkase Aug 27, 2020
1e5a4fe
[cudaungappedextender] Change Anchors to Seeds and clang-format
atadkase Aug 27, 2020
550d0a9
[cudaungappedextender] update length
atadkase Aug 27, 2020
d863ca1
[cudaungappedextender] Change seedHits to seeds
atadkase Aug 27, 2020
93c8e39
[cudaungappedextender] const method
atadkase Aug 27, 2020
f86f618
Merge branch 'dev-v0.6.0' into atadkase/ungapped_extender_sample
atadkase Aug 27, 2020
15a6728
[cudaungappedextender] Address review comments - default values; rena…
atadkase Aug 31, 2020
6a1a185
[cudaungappedextender] Rename seed -> seed_pair; scored_segment -> sc…
atadkase Sep 1, 2020
5a91b43
[cudaungappedextender] propagate renaming changes
atadkase Sep 1, 2020
0e57503
[cudaextender] Rename ungappedextender to extender; Add skeleton for …
atadkase Sep 5, 2020
3a52056
[cudaextender] Make format
atadkase Sep 5, 2020
58d15be
[cudaextender] Add more files
atadkase Sep 9, 2020
e5e6a08
Merge remote-tracking branch 'clara-genomics/dev-v0.6.0' into atadkas…
atadkase Sep 9, 2020
4bb2e2a
[cudaextender] refactor find_hsps
atadkase Sep 9, 2020
2867834
[cudaextender] rename function
atadkase Sep 9, 2020
b77dc2e
[cudaextender] Working device_ptr sample
atadkase Sep 15, 2020
8321c7b
[cudaextender] debug changes
atadkase Sep 15, 2020
623711c
[cudaextender] Remove redundant comma
atadkase Sep 15, 2020
bdf32de
[cudaextender] correct casts
atadkase Sep 15, 2020
1376dd5
[cudaextender] Fix parser copy-pasta; Remove debug prints
atadkase Sep 16, 2020
017b58d
[cudaextender] replaced thrust with cub
atadkase Sep 17, 2020
468e345
[cudaextender] Clean API working sample
atadkase Sep 17, 2020
f9eb0ce
[cudaextender] Add host sample
atadkase Sep 18, 2020
881bb9d
[cudaextender] Drop typedefs; replace memcpy with device_copy
atadkase Sep 18, 2020
0e534d4
[cudaextender] drop h_ssp_ member var
atadkase Sep 18, 2020
6f380fd
[cudaextender] Replace pointer access with data()
atadkase Sep 18, 2020
569bfce
[cudaextender] Remove extra include; var declaration update;
atadkase Sep 18, 2020
91fdfe3
[cudaextender] Add flag for host_pointer_mode check
atadkase Sep 18, 2020
9719f43
[cudaextender] Remove local vars that store language defaults
atadkase Sep 18, 2020
28a4708
[cudaextender] Limit scope of vars in compress output
atadkase Sep 18, 2020
4093169
[cudaextender] constants and logs
atadkase Sep 18, 2020
173688f
[cudaextender] Scoped some vars locally
atadkase Sep 18, 2020
7f112c5
[cudaextender] Forgotten pragma
atadkase Sep 18, 2020
249f826
[cudaextender] More constants
atadkase Sep 18, 2020
35101b6
Merge remote-tracking branch 'clara-genomics/dev-v0.6.0' into atadkas…
atadkase Sep 18, 2020
f391ec2
[cudaextender] Fix hardcoded file location
atadkase Sep 18, 2020
d42f1ae
[cudaextender] Flip if/else
atadkase Sep 18, 2020
3822cb6
[cudaextender] merge ifs
atadkase Sep 18, 2020
b49d6d8
[cudaextender] Hoisted out common params from if/else
atadkase Sep 18, 2020
cd96e58
[cudaextender] simplified entropy calculation
atadkase Sep 18, 2020
bed9513
[cudaextender] C style casts to static cast
atadkase Sep 18, 2020
f212754
[cudaextender] switch case
atadkase Sep 18, 2020
0ae2342
[cudaextender] Replace with device buffer and caching allocator
atadkase Sep 21, 2020
45611e2
[cudaextender] Get rid of manual memory allocation for device_sample
atadkase Sep 21, 2020
f78a833
[cudaextender] Add host ptr API code with device buffer
atadkase Sep 21, 2020
e8b711b
[cudaextender] Fix output iterator of size check
atadkase Sep 21, 2020
16e38d6
[cudaextender] Enable host_ptr_sample
atadkase Sep 21, 2020
233871f
[cudaextender] update flag
atadkase Sep 21, 2020
ed824ae
[cudaextender] Copyright date fix
atadkase Sep 21, 2020
7f67c0c
[cudaextender] sorted some imports
atadkase Sep 21, 2020
d364205
[cudaextender] Code style fix
atadkase Sep 21, 2020
d77371b
[cudaextender] Rename ssps
atadkase Sep 21, 2020
b2fa6b2
[cudaextender] Move vars closer to use; Use intermediate local variab…
atadkase Sep 22, 2020
a29d64d
[cudaextender] replace warpSize with warp_size constexpr
atadkase Sep 22, 2020
9e9edf3
[ci] Robust copyright detection
atadkase Sep 22, 2020
4638ca8
[cudaextender] make format
atadkase Sep 22, 2020
71d035d
[cudaextender] More consts + device buffer for num_ssp
atadkase Sep 23, 2020
dd9eed9
[cudaextender] make format
atadkase Sep 23, 2020
af99fa4
Merge branch 'dev-v0.6.0' into atadkase/ungapped_extender_impl
atadkase Sep 23, 2020
8a9b631
[cudaextender] Partial docs
atadkase Sep 23, 2020
0733274
[cudaextender] Add end2end host ptr api test
atadkase Sep 23, 2020
9c61b8f
[cudaextender] Fix test ordering
atadkase Sep 23, 2020
a128f07
[cudaextender] Add equality operator
atadkase Sep 23, 2020
9eea963
[cudaextender] Make format
atadkase Sep 23, 2020
3596286
[cudaextender] Resolve file location conflict with cudapoa
atadkase Sep 23, 2020
32f2761
[cudaextender] Try removing cub includes
atadkase Sep 23, 2020
b49f266
[cudaextender] Replace cub include
atadkase Sep 23, 2020
57e4c19
[cudaextender] Add cub as a linked lib
atadkase Sep 23, 2020
641f6cd
[cudaextender] Add cudaextender file location
atadkase Sep 23, 2020
1939264
[cudaextender] Update external docs
atadkase Sep 23, 2020
faceee5
[cudaextender] Additional error types
atadkase Sep 23, 2020
af7aa06
[cudaextender] Make format
atadkase Sep 23, 2020
59d0846
[cudaextender] Refactor and newlines
atadkase Sep 23, 2020
e5828af
[cudaextender] Fix comments
atadkase Sep 23, 2020
56586ca
[cudaextender] Add error check to stream synchronize
atadkase Sep 23, 2020
c120c47
[cudaextender] Rename sub_mat as score_mat
atadkase Sep 23, 2020
6f08dd5
[cudaextender] char to int8_t and reformat
atadkase Sep 25, 2020
e558714
Merge branch 'dev-v0.6.0' into atadkase/ungapped_extender_impl
atadkase Sep 25, 2020
4cca27b
[cudaextender] Const removal; signature updates with ref removal; siz…
atadkase Sep 28, 2020
cfb1daa
[cudaextender] enum class
atadkase Sep 28, 2020
b64c018
[cudaextender] Add NUC2 as enum
atadkase Sep 28, 2020
1e258cf
[cudaextender] size_t->int64_t
atadkase Sep 28, 2020
4d93eb0
[cudaextender] Make format
atadkase Sep 28, 2020
bca8fe7
[cudaextender] Make protected
atadkase Sep 28, 2020
c705cd5
[cudaextender] Add attribution
atadkase Sep 28, 2020
abedff8
Revert "[cudaextender] Add NUC2 as enum"
atadkase Sep 28, 2020
4e54c99
Revert "[cudaextender] enum class"
atadkase Sep 28, 2020
c618f23
[cudaextender] Revert enum to constexpr globals
atadkase Sep 28, 2020
6528beb
[cudaextender] Add consts and make get_size() uniform
atadkase Sep 29, 2020
e011a73
[cudaextender] Replace length() with get_size(); Fix bug with query/t…
atadkase Sep 29, 2020
69604f1
[cudaextender] Add issues for hardcoded vars
atadkase Oct 1, 2020
3481796
[cudaextender] Add issues for kernel optimization and other kernel is…
atadkase Oct 1, 2020
8f41485
[cudaextender] make format
atadkase Oct 1, 2020
961c2a5
[cudaextender] Uniform comment names for host pointer API
atadkase Oct 1, 2020
86e71b1
[cudaextender] Remove TODO
atadkase Oct 1, 2020
e6ffd17
[cudaextender] Remove todo
atadkase Oct 1, 2020
7993dd2
[cudaextender] Make format
atadkase Oct 1, 2020
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
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ option(gw_enable_cudapoa_nw_print "Enable verbose prints within cudapoa NW kerne
option(gw_profiling "Compile a binary for profiling with NVTX markers." OFF)
option(gw_enable_caching_allocator "Enable caching allocator." ON)
option(gw_generate_docs "Generate Doxygen documentation" ON)
option(gw_cuda_gen_all_arch "ON: Generate optimized CUDA code for all architectures | OFF: for detected architectures only" ON)
option(gw_cuda_gen_all_arch "ON: Generate optimized CUDA code for all architectures | OFF: for detected architectures only" OFF)
atadkase marked this conversation as resolved.
Show resolved Hide resolved

# Must be included before others for options value validation
include(cmake/Utils.cmake)
Expand Down Expand Up @@ -83,6 +83,7 @@ add_subdirectory(common/io)
add_subdirectory(cudapoa)
add_subdirectory(cudamapper)
add_subdirectory(cudaaligner)
add_subdirectory(cudaextender)

# Add documentation generation.
validate_boolean(gw_generate_docs)
Expand Down
2 changes: 1 addition & 1 deletion ci/checks/check_copyright.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def copyright_present(f):
f - Path to file
"""
with io.open(f, "r", encoding="utf-8") as fh:
return re.search('Copyright 20[0-9]+-20[0-9]+', fh.read())
return re.search('Copyright (20[0-9][0-9]-)?20[0-9][0-9] NVIDIA CORPORATION', fh.read())


def parse_args():
Expand Down
77 changes: 77 additions & 0 deletions cudaextender/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
#
# Copyright 2020 NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
set(MODULE_NAME cudaextender)

# Process data subdirectory first
add_subdirectory(data)

GitVersion()

configure_file(${CMAKE_SOURCE_DIR}/common/base/src/version.cpp.in
${CMAKE_CURRENT_BINARY_DIR}/version.cpp)
ahehn-nv marked this conversation as resolved.
Show resolved Hide resolved

# Project specific NVCC flags, --expt-relaxed-constexpr is being added to allow using numeric_limits inside device kernels.
# Using in CUDA 10.1+ to avoid compilation issues with CUDA <= 10.0.
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} -std=c++14")
if (gw_cuda_after_10_0)
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} --expt-relaxed-constexpr")
endif ()
if (gw_cuda_gen_all_arch)
CUDA_SELECT_NVCC_ARCH_FLAGS(ARCH_FLAGS "Common")
else ()
CUDA_SELECT_NVCC_ARCH_FLAGS(ARCH_FLAGS "Auto")
endif ()
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} ${ARCH_FLAGS}")
message(STATUS "nvcc flags for ${PROJECT_NAME}: ${CUDA_NVCC_FLAGS}")

get_property(gw_library_type GLOBAL PROPERTY gw_library_type)
cuda_add_library(${MODULE_NAME} ${gw_library_type}
src/cudaextender.cpp
src/extender.cpp
src/ungapped_xdrop.cu
src/ungapped_xdrop_kernels.cu
${CMAKE_CURRENT_BINARY_DIR}/version.cpp)

target_link_libraries(${MODULE_NAME} gwbase gwio cub)

target_compile_options(${MODULE_NAME} PRIVATE -Werror -Wall -Wextra)
if (gw_optimize_for_native_cpu)
target_compile_options(${MODULE_NAME} PRIVATE -march=native)
endif ()

target_include_directories(${MODULE_NAME}
PUBLIC
$<INSTALL_INTERFACE:include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
)

add_doxygen_source_dir(${CMAKE_CURRENT_SOURCE_DIR}/include)

install(TARGETS ${MODULE_NAME}
COMPONENT gwlogging
EXPORT ${MODULE_NAME}
DESTINATION lib
INCLUDES DESTINATION include
)
install(DIRECTORY include/ DESTINATION include)
install(EXPORT ${MODULE_NAME} DESTINATION cmake)

# Add other folders.
add_subdirectory(samples)
add_subdirectory(tests)

# Add auto formatting.
gw_enable_auto_formatting("${CMAKE_CURRENT_SOURCE_DIR}")
19 changes: 19 additions & 0 deletions cudaextender/data/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#
# Copyright 2020 NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
set(CUDAEXTENDER_DATA_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../data")
configure_file(cudaextender_file_location.hpp.in ${PROJECT_BINARY_DIR}/data/cudaextender_file_location.hpp @ONLY)

set_property(GLOBAL PROPERTY cudaextender_data_include_dir "${PROJECT_BINARY_DIR}/data")
18 changes: 18 additions & 0 deletions cudaextender/data/cudaextender_file_location.hpp.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
* Copyright 2020 NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once

#cmakedefine CUDAEXTENDER_DATA_DIR "@CUDAEXTENDER_DATA_DIR@"
Loading