[pstl] Setup the _PSTL_VERSION macro like _LIBCPP_VERSION, and add release notes

Reviewers: rodgert, MikeDvorskiy

Subscribers: mgorny, jkorous, dexonsmith, libcxx-commits

Tags: #libc

Differential Revision: https://reviews.llvm.org/D60464

llvm-svn: 358193
This commit is contained in:
Louis Dionne 2019-04-11 17:08:55 +00:00
parent 8d083c5e0b
commit ab38599bb1
4 changed files with 68 additions and 8 deletions

View File

@ -9,12 +9,13 @@ cmake_minimum_required(VERSION 3.4.3)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
set(PARALLELSTL_VERSION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/include/pstl/internal/pstl_config.h")
file(STRINGS "${PARALLELSTL_VERSION_FILE}" PARALLELSTL_VERSION_SOURCE REGEX "#define PSTL_VERSION .*$")
string(REGEX REPLACE "#define PSTL_VERSION (.*)$" "\\1" PARALLELSTL_VERSION_SOURCE "${PARALLELSTL_VERSION_SOURCE}")
math(EXPR VERSION_MAJOR "${PARALLELSTL_VERSION_SOURCE} / 100")
math(EXPR VERSION_MINOR "${PARALLELSTL_VERSION_SOURCE} % 100")
file(STRINGS "${PARALLELSTL_VERSION_FILE}" PARALLELSTL_VERSION_SOURCE REGEX "#define _PSTL_VERSION .*$")
string(REGEX REPLACE "#define _PSTL_VERSION (.*)$" "\\1" PARALLELSTL_VERSION_SOURCE "${PARALLELSTL_VERSION_SOURCE}")
math(EXPR VERSION_MAJOR "(${PARALLELSTL_VERSION_SOURCE} / 1000)")
math(EXPR VERSION_MINOR "((${PARALLELSTL_VERSION_SOURCE} % 1000) / 10)")
math(EXPR VERSION_PATCH "(${PARALLELSTL_VERSION_SOURCE} % 10)")
project(ParallelSTL VERSION ${VERSION_MAJOR}.${VERSION_MINOR} LANGUAGES CXX)
project(ParallelSTL VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH} LANGUAGES CXX)
option(PARALLELSTL_USE_PARALLEL_POLICIES "Enable parallel policies" OFF)
set(PARALLELSTL_BACKEND "tbb" CACHE STRING "Threading backend; defaults to TBB")

View File

@ -0,0 +1,40 @@
========================================
PSTL 9.0.0 (In-Progress) Release Notes
========================================
.. contents::
:local:
:depth: 2
Written by the `PSTL Team <https://pstl.llvm.org>`_
.. warning::
These are in-progress notes for the upcoming pstl 9 release.
Release notes for previous releases can be found on
`the Download Page <https://releases.llvm.org/download.html>`_.
Introduction
============
This document contains the release notes for the PSTL parallel algorithms
library, part of the LLVM Compiler Infrastructure, release 9.0.0. Here we
describe the status of the library in some detail, including major improvements
from the previous release and new feature work. For the general LLVM release
notes, see `the LLVM documentation <https://llvm.org/docs/ReleaseNotes.html>`_.
All LLVM releases may be downloaded from the `LLVM releases web site
<https://llvm.org/releases/>`_.
Note that if you are reading this file from a source checkout or the main PSTL
web page, this document applies to the *next* release, not the current one.
To see the release notes for a specific release, please see the `releases
page <https://llvm.org/releases/>`_.
What's New in PSTL 9.0.0?
=========================
New Features
------------
API Changes
-----------

View File

@ -10,9 +10,11 @@
#ifndef _PSTL_CONFIG_H
#define _PSTL_CONFIG_H
#define PSTL_VERSION 203
#define PSTL_VERSION_MAJOR (PSTL_VERSION / 100)
#define PSTL_VERSION_MINOR (PSTL_VERSION - PSTL_VERSION_MAJOR * 100)
// The version is XYYZ, where X is major, YY is minor, and Z is patch (i.e. X.YY.Z)
#define _PSTL_VERSION 9000
#define _PSTL_VERSION_MAJOR (_PSTL_VERSION / 1000)
#define _PSTL_VERSION_MINOR ((_PSTL_VERSION % 1000) / 10)
#define _PSTL_VERSION_PATCH (_PSTL_VERSION % 10)
// Check the user-defined macro for parallel policies
#if defined(PSTL_USE_PARALLEL_POLICIES)

View File

@ -0,0 +1,17 @@
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#include <pstl/internal/pstl_config.h>
static_assert(_PSTL_VERSION == 9000);
static_assert(_PSTL_VERSION_MAJOR == 9);
static_assert(_PSTL_VERSION_MINOR == 00);
static_assert(_PSTL_VERSION_PATCH == 0);
int main() { }