-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CMake] Add RCCL to TVM and TVM Runtime (#15624)
This PR introduces RCCL(ROCm Communication Collectives Library) in the cmake system.
- Loading branch information
1 parent
aa805f2
commit 909c8fa
Showing
5 changed files
with
78 additions
and
0 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
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
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
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,52 @@ | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you 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. | ||
# | ||
# Variables used by this module, they can change the default behaviour and need | ||
# to be set before calling find_package: | ||
# | ||
# This module defines | ||
# Rccl_FOUND, whether rccl has been found | ||
# RCCL_INCLUDE_DIR, directory containing header | ||
# RCCL_LIBRARY, directory containing rccl library | ||
# This module assumes that the user has already called find_package(rocm) | ||
|
||
macro(find_rccl use_rccl) | ||
if(${use_rccl} MATCHES ${IS_FALSE_PATTERN}) | ||
return() | ||
endif() | ||
if(${use_rccl} MATCHES ${IS_TRUE_PATTERN}) | ||
find_path(RCCL_INCLUDE_DIR NAMES rccl.h) | ||
find_library(RCCL_LIBRARY NAMES rccl) | ||
else() | ||
find_path(RCCL_INCLUDE_DIR NAMES rccl.h HINTS ${use_rccl} ${use_rccl}/include) | ||
find_library(RCCL_LIBRARY NAMES rccl HINTS ${use_rccl} ${use_rccl}/lib) | ||
endif() | ||
include(FindPackageHandleStandardArgs) | ||
find_package_handle_standard_args(Rccl DEFAULT_MSG RCCL_INCLUDE_DIR RCCL_LIBRARY) | ||
if (Rccl_FOUND) | ||
message(STATUS "Found RCCL_LIBRARY: ${RCCL_LIBRARY}") | ||
message(STATUS "Found RCCL_INCLUDE_DIR: ${RCCL_INCLUDE_DIR}") | ||
add_library(rccl SHARED IMPORTED) | ||
set_target_properties(rccl | ||
PROPERTIES | ||
INTERFACE_INCLUDE_DIRECTORIES "${RCCL_INCLUDE_DIR}" | ||
IMPORTED_LOCATION "${RCCL_LIBRARY}") | ||
else() | ||
message(STATUS "RCCL not found") | ||
endif() | ||
mark_as_advanced(RCCL_INCLUDE_DIR RCCL_LIBRARY) | ||
endmacro(find_rccl) |
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