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

[SYCL][COMPAT] Add version & release process #14457

Merged
merged 10 commits into from
Jul 17, 2024
45 changes: 45 additions & 0 deletions sycl/doc/syclcompat/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,51 @@ This document presents the public API under the [Features](#features) section,
and provides a working [Sample code](#sample-code) using this library. Refer to
those to learn to use the library.

## Versioning

SYCLcompat adopts [semantic versioning](https://semver.org/)
(`major.minor.patch`) in a manner which aligns with oneAPI releases. Each oneAPI
product release has an associated SYCLcompat release. Between oneAPI releases,
there will be at most one `major` or `minor` bump. In other words, if a given
oneAPI release has SYCLcompat version `1.0.0`, the next release will have either
`1.1.0` or, if breaking changes have been made, `2.0.0`. This guarantee has
implications for code merged to the `sycl` branch, described below.

Between release cycles, ongoing updates to SYCLcompat (including possibly
breaking changes) are merged into DPC++ via PRs to the
[`sycl`](https://github.com/intel/llvm/tree/sycl) branch. If a PR introduces the
*first* breaking changes since the last release, that PR must bump to the next
`major` version. Otherwise, if the PR introduces *new functionality* and neither
the `major` nor `minor` have been bumped since the last release, it must bump to
the next `minor` release. If a PR introduces important bugfixes to existing
functionality, `patch` should be bumped, and there are no limits to how many
`patch` bumps can occur between release cycles.

### Release Process

Once all changes planned for a release have been merged, the release process is
defined as:

1. Check the `major.minor` version associated with the *previous* release.
2. Confirm the version bump process outlined above has been followed.
3. If no version bump has occurred since previous release, bump to next `minor`.
4. oneAPI release is delivered.
5. Tag the SYCLcompat release on DPC++ repo: `SYCLcompat-major.minor.0`.

### Deprecation Process/Breaking Changes

As outlined above, SYCLcompat may sometimes make API breaking changes, indicated
with a `major` version bump. Advanced notice (at least one major oneAPI release)
will be provided via a deprecation warning on the relevant APIs, indicating to
the user which alternative API should be used instead.

Note that SYCLcompat is currently in pre-release, and until version `1.0.0` we
do not consider our API to be stable, and may change it with shorter notice.

### Changelog

Since SYCLcompat releases are aligned with oneAPI product releases, the changelog for SYCLcompat is incorporated into [SYCL's Release Notes](https://github.com/intel/llvm/blob/sycl/sycl/ReleaseNotes.md).

## Features

### dim3
Expand Down
13 changes: 13 additions & 0 deletions sycl/include/syclcompat/defs.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,19 @@ template <int Arg> class syclcompat_kernel_scalar;
#define SYCLCOMPAT_EXPORT
#endif

// TODO: enumerate past versions?
#define SYCLCOMPAT_MAJOR_VERSION 0
#define SYCLCOMPAT_MINOR_VERSION 1
#define SYCLCOMPAT_PATCH_VERSION 0

#define SYCLCOMPAT_MAKE_VERSION(_major, _minor, _patch) \
((1E6 * SYCLCOMPAT_MAJOR_VERSION) + (1E3 * SYCLCOMPAT_MINOR_VERSION) + \
SYCLCOMPAT_PATCH_VERSION)

#define SYCLCOMPAT_VERSION \
SYCLCOMPAT_MAKE_VERSION(SYCLCOMPAT_MAJOR_VERSION, SYCLCOMPAT_MINOR_VERSION, \
SYCLCOMPAT_PATCH_VERSION)

namespace syclcompat {
enum error_code { SUCCESS = 0, BACKEND_ERROR = 1, DEFAULT_ERROR = 999 };
}
Expand Down
12 changes: 11 additions & 1 deletion sycl/test-e2e/syclcompat/defs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,19 @@ void test_check_error() {
SYCLCOMPAT_CHECK_ERROR(runtime_error_throw()));
}

void test_version() {
// Check the composition of the version int
assert(SYCLCOMPAT_MAKE_VERSION(1, 1, 1) == 1001001);
assert(SYCLCOMPAT_MAKE_VERSION(9, 0, 0) == 9000000);

// Check some inequalities
assert(SYCLCOMPAT_MAKE_VERSION(0, 1, 1) > SYCLCOMPAT_MAKE_VERSION(0, 1, 0));
assert(SYCLCOMPAT_MAKE_VERSION(1, 0, 0) > SYCLCOMPAT_MAKE_VERSION(0, 9, 0));
}

int main() {
test_align();
test_check_error();
joeatodd marked this conversation as resolved.
Show resolved Hide resolved

test_version();
return 0;
}
Loading