Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
15 changes: 0 additions & 15 deletions .github/workflows/update-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,6 @@ jobs:
sed -i "s/^release = \".*\"/release = \"v${VERSION}\"/" docs/conf.py
sed -i "s/^version = \".*\"/version = \"${VERSION}\"/" pyproject.toml

IFS='.' read -ra VER <<< "$VERSION"
MAJOR=${VER[0]}
MINOR=${VER[1]}
PATCH=${VER[2]}

# Update CMakeLists.txt
sed -i "s/set(MSCCLPP_MAJOR \".*\")/set(MSCCLPP_MAJOR \"${MAJOR}\")/" CMakeLists.txt
sed -i "s/set(MSCCLPP_MINOR \".*\")/set(MSCCLPP_MINOR \"${MINOR}\")/" CMakeLists.txt
sed -i "s/set(MSCCLPP_PATCH \".*\")/set(MSCCLPP_PATCH \"${PATCH}\")/" CMakeLists.txt

# Update header files
sed -i "s/#define MSCCLPP_MAJOR .*/#define MSCCLPP_MAJOR ${MAJOR}/" include/mscclpp/core.hpp
sed -i "s/#define MSCCLPP_MINOR .*/#define MSCCLPP_MINOR ${MINOR}/" include/mscclpp/core.hpp
sed -i "s/#define MSCCLPP_PATCH .*/#define MSCCLPP_PATCH ${PATCH}/" include/mscclpp/core.hpp

- name: Commit and Push Changes
run: |
git config user.name "github-actions"
Expand Down
22 changes: 22 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,28 @@ endif()
set(MSCCLPP_SOVERSION ${MSCCLPP_MAJOR})
set(MSCCLPP_VERSION "${MSCCLPP_MAJOR}.${MSCCLPP_MINOR}.${MSCCLPP_PATCH}")

find_package(Git)
set(GIT_HASH "UNKNOWN")
if(Git_FOUND)
execute_process(
COMMAND "${GIT_EXECUTABLE}" rev-parse --short=12 HEAD
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
OUTPUT_VARIABLE _git_out
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if(NOT _git_out STREQUAL "")
set(GIT_HASH "${_git_out}")
endif()
else()
message(WARNING "Git not found, setting GIT_HASH to 'UNKNOWN'")
endif()

configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/include/mscclpp/version.hpp.in"
"${CMAKE_CURRENT_BINARY_DIR}/include/mscclpp/version.hpp"
@ONLY
)

cmake_minimum_required(VERSION 3.25)
project(mscclpp LANGUAGES CXX)

Expand Down
1 change: 1 addition & 0 deletions docs/programming_guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ This section provides advanced topics and best practices for using MSCCL++. It i
guide/advanced-connections
guide/cpp-examples
guide/mscclpp-dsl
guide/customized-algorithem-with-nccl-api
8 changes: 6 additions & 2 deletions include/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.

file(GLOB_RECURSE HEADERS CONFIGURE_DEPENDS *.hpp)
target_sources(mscclpp_obj PUBLIC FILE_SET HEADERS FILES ${HEADERS})
file(GLOB_RECURSE HEADERS CONFIGURE_DEPENDS *.hpp ${CMAKE_CURRENT_BINARY_DIR}/*.hpp)
target_sources(
mscclpp_obj PUBLIC FILE_SET HEADERS
BASE_DIRS ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}
FILES ${HEADERS}
)
6 changes: 1 addition & 5 deletions include/mscclpp/core.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,12 @@
#ifndef MSCCLPP_CORE_HPP_
#define MSCCLPP_CORE_HPP_

#define MSCCLPP_MAJOR 0
#define MSCCLPP_MINOR 7
#define MSCCLPP_PATCH 0
#define MSCCLPP_VERSION (MSCCLPP_MAJOR * 10000 + MSCCLPP_MINOR * 100 + MSCCLPP_PATCH)

#include <array>
#include <bitset>
#include <future>
#include <memory>
#include <mscclpp/errors.hpp>
#include <mscclpp/version.hpp>
#include <string>
#include <vector>

Expand Down
13 changes: 13 additions & 0 deletions include/mscclpp/version.hpp.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.

#ifndef MSCCLPP_VERSION_HPP_
#define MSCCLPP_VERSION_HPP_

#define MSCCLPP_MAJOR @MSCCLPP_MAJOR@
#define MSCCLPP_MINOR @MSCCLPP_MINOR@
#define MSCCLPP_PATCH @MSCCLPP_PATCH@
#define MSCCLPP_VERSION (MSCCLPP_MAJOR * 10000 + MSCCLPP_MINOR * 100 + MSCCLPP_PATCH)
#define MSCCLPP_GIT_COMMIT "@GIT_HASH@"

#endif // MSCCLPP_VERSION_HPP_
Loading