-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Cai Yudong <yudong.cai@zilliz.com>
- Loading branch information
Showing
675 changed files
with
22,551 additions
and
88,215 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
#============================================================================= | ||
# Copyright (c) 2021-2023, 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. | ||
#============================================================================= | ||
# | ||
# This is the preferred entry point for projects using rapids-cmake | ||
# | ||
|
||
# Allow users to control which version is used | ||
if(NOT rapids-cmake-version) | ||
# Define a default version if the user doesn't set one | ||
set(rapids-cmake-version 23.12) | ||
endif() | ||
|
||
# Allow users to control which GitHub repo is fetched | ||
if(NOT rapids-cmake-repo) | ||
# Define a default repo if the user doesn't set one | ||
set(rapids-cmake-repo rapidsai/rapids-cmake) | ||
endif() | ||
|
||
# Allow users to control which branch is fetched | ||
if(NOT rapids-cmake-branch) | ||
# Define a default branch if the user doesn't set one | ||
set(rapids-cmake-branch "branch-${rapids-cmake-version}") | ||
endif() | ||
|
||
# Allow users to control the exact URL passed to FetchContent | ||
if(NOT rapids-cmake-url) | ||
# Construct a default URL if the user doesn't set one | ||
set(rapids-cmake-url "https://github.com/${rapids-cmake-repo}/") | ||
# In order of specificity | ||
if(rapids-cmake-sha) | ||
# An exact git SHA takes precedence over anything | ||
string(APPEND rapids-cmake-url "archive/${rapids-cmake-sha}.zip") | ||
elseif(rapids-cmake-tag) | ||
# Followed by a git tag name | ||
string(APPEND rapids-cmake-url "archive/refs/tags/${rapids-cmake-tag}.zip") | ||
else() | ||
# Or if neither of the above two were defined, use a branch | ||
string(APPEND rapids-cmake-url "archive/refs/heads/${rapids-cmake-branch}.zip") | ||
endif() | ||
endif() | ||
|
||
if(POLICY CMP0135) | ||
cmake_policy(PUSH) | ||
cmake_policy(SET CMP0135 NEW) | ||
endif() | ||
include(FetchContent) | ||
FetchContent_Declare(rapids-cmake URL "${rapids-cmake-url}") | ||
if(POLICY CMP0135) | ||
cmake_policy(POP) | ||
endif() | ||
FetchContent_GetProperties(rapids-cmake) | ||
if(rapids-cmake_POPULATED) | ||
# Something else has already populated rapids-cmake, only thing | ||
# we need to do is setup the CMAKE_MODULE_PATH | ||
if(NOT "${rapids-cmake-dir}" IN_LIST CMAKE_MODULE_PATH) | ||
list(APPEND CMAKE_MODULE_PATH "${rapids-cmake-dir}") | ||
endif() | ||
else() | ||
FetchContent_MakeAvailable(rapids-cmake) | ||
endif() |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
# ============================================================================= | ||
# Copyright (c) 2021-2022, 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. | ||
# ============================================================================= | ||
|
||
function(find_and_configure_cutlass) | ||
set(oneValueArgs VERSION REPOSITORY PINNED_TAG) | ||
cmake_parse_arguments(PKG "${options}" "${oneValueArgs}" "${multiValueArgs}" | ||
${ARGN}) | ||
|
||
# if(RAFT_ENABLE_DIST_DEPENDENCIES OR RAFT_COMPILE_LIBRARIES) | ||
set(CUTLASS_ENABLE_HEADERS_ONLY | ||
ON | ||
CACHE BOOL "Enable only the header library") | ||
set(CUTLASS_NAMESPACE | ||
"raft_cutlass" | ||
CACHE STRING "Top level namespace of CUTLASS") | ||
set(CUTLASS_ENABLE_CUBLAS | ||
OFF | ||
CACHE BOOL "Disable CUTLASS to build with cuBLAS library.") | ||
|
||
if(CUDA_STATIC_RUNTIME) | ||
set(CUDART_LIBRARY | ||
"${CUDA_cudart_static_LIBRARY}" | ||
CACHE FILEPATH "fixing cutlass cmake code" FORCE) | ||
endif() | ||
|
||
rapids_cpm_find( | ||
NvidiaCutlass | ||
${PKG_VERSION} | ||
GLOBAL_TARGETS | ||
nvidia::cutlass::cutlass | ||
CPM_ARGS | ||
GIT_REPOSITORY | ||
${PKG_REPOSITORY} | ||
GIT_TAG | ||
${PKG_PINNED_TAG} | ||
GIT_SHALLOW | ||
TRUE | ||
OPTIONS | ||
"CUDAToolkit_ROOT ${CUDAToolkit_LIBRARY_DIR}") | ||
|
||
if(TARGET CUTLASS AND NOT TARGET nvidia::cutlass::cutlass) | ||
add_library(nvidia::cutlass::cutlass ALIAS CUTLASS) | ||
endif() | ||
|
||
if(NvidiaCutlass_ADDED) | ||
rapids_export( | ||
BUILD | ||
NvidiaCutlass | ||
EXPORT_SET | ||
NvidiaCutlass | ||
GLOBAL_TARGETS | ||
nvidia::cutlass::cutlass | ||
NAMESPACE | ||
nvidia::cutlass::) | ||
endif() | ||
# endif() | ||
|
||
# We generate the cutlass-config files when we built cutlass locally, so | ||
# always do `find_dependency` | ||
rapids_export_package(BUILD NvidiaCutlass raft-distance-exports | ||
GLOBAL_TARGETS nvidia::cutlass::cutlass) | ||
rapids_export_package(INSTALL NvidiaCutlass raft-distance-exports | ||
GLOBAL_TARGETS nvidia::cutlass::cutlass) | ||
rapids_export_package(BUILD NvidiaCutlass raft-nn-exports GLOBAL_TARGETS | ||
nvidia::cutlass::cutlass) | ||
rapids_export_package(INSTALL NvidiaCutlass raft-nn-exports GLOBAL_TARGETS | ||
nvidia::cutlass::cutlass) | ||
|
||
# Tell cmake where it can find the generated NvidiaCutlass-config.cmake we | ||
# wrote. | ||
include("${rapids-cmake-dir}/export/find_package_root.cmake") | ||
rapids_export_find_package_root( | ||
INSTALL NvidiaCutlass [=[${CMAKE_CURRENT_LIST_DIR}/../]=] | ||
raft-distance-exports) | ||
rapids_export_find_package_root( | ||
BUILD NvidiaCutlass [=[${CMAKE_CURRENT_LIST_DIR}]=] raft-distance-exports) | ||
include("${rapids-cmake-dir}/export/find_package_root.cmake") | ||
rapids_export_find_package_root( | ||
INSTALL NvidiaCutlass [=[${CMAKE_CURRENT_LIST_DIR}/../]=] raft-nn-exports) | ||
rapids_export_find_package_root( | ||
BUILD NvidiaCutlass [=[${CMAKE_CURRENT_LIST_DIR}]=] raft-nn-exports) | ||
endfunction() | ||
|
||
if(NOT RAFT_CUTLASS_GIT_TAG) | ||
set(RAFT_CUTLASS_GIT_TAG v2.9.1) | ||
endif() | ||
|
||
if(NOT RAFT_CUTLASS_GIT_REPOSITORY) | ||
set(RAFT_CUTLASS_GIT_REPOSITORY https://github.com/NVIDIA/cutlass.git) | ||
endif() | ||
|
||
find_and_configure_cutlass( | ||
VERSION 2.9.1 REPOSITORY ${RAFT_CUTLASS_GIT_REPOSITORY} PINNED_TAG | ||
${RAFT_CUTLASS_GIT_TAG}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.