Skip to content

Aling nd_range with SYCL 2020 #22737

Description

@KornevNikita

Describe the bug

All functions are missing noexcept:

  __SYCL2020_DEPRECATED("offsets are deprecated in SYCL2020")
  nd_range(range<Dimensions> globalSize, range<Dimensions> localSize,
           id<Dimensions> offset)
      : globalSize(globalSize), localSize(localSize), offset(offset) {}

  nd_range(range<Dimensions> globalSize, range<Dimensions> localSize)
      : globalSize(globalSize), localSize(localSize), offset(id<Dimensions>()) {
  }

  range<Dimensions> get_global_range() const { return globalSize; }

  range<Dimensions> get_local_range() const { return localSize; }

  range<Dimensions> get_group_range() const { return globalSize / localSize; }

Operators == and != should be implemented as hidden friends, see e.g. https://github.com/intel/llvm/blob/sycl/sycl/include/sycl/queue.hpp#L385

All changes should be guarded to avoid breaking ABI:

#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
size_t func() const {
#else
size_t func() const noexcept {
#endif // __INTEL_PREVIEW_BREAKING_CHANGES

To reproduce

  1. Include a code snippet that is as short as possible
  2. Specify the command which should be used to compile the program
  3. Specify the command which should be used to launch the program
  4. Indicate what is wrong and what was expected

Environment

  • OS: [e.g Windows/Linux]
  • Target device and vendor: [e.g. Intel GPU]
  • DPC++ version: [e.g. commit hash or output of clang++ --version]
  • Dependencies version: [e.g. the output of sycl-ls --verbose]

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions