KhronosGroup / KhronosGroup/SYCL-Docs

USM allocators doesn't define a maximum alignment guaranty

Open
#1,049 4 comments 0 reactions 0 assignees View on GitHub
Agenda clarification
Dominant language
JavaScript
Stars
158
Forks
80
Avg merge
7d 6h
Merged PRs (30d)
5

Description

### Specification Version

SYCL 2020 (Revision 12)

### Section Number(s)

4.8.3 https://registry.khronos.org/SYCL/specs/sycl-2020/html/sycl-2020.html#_usm_allocations

### Issue Description

USM allocations define minimum alignment guarantees but as far as I can see no maximum alignment is defined. And none of the aligned allocation variants can raise an exception based on an over-alignement.
Impacted APIs: `aligned_alloc_device`, `aligned_alloc_host`, `aligned_alloc_shared`, `aligned_alloc`.

This causes an issue if the backend used is OpenCL as both SVM and Intel USM define restrictions:
- With [SVM](https://registry.khronos.org/OpenCL/specs/unified/refpages/man/html/clSVMAlloc.html#_parameters) `It must be a power of two up to the largest data type supported by the OpenCL device`
- With [Intel USM](https://registry.khronos.org/OpenCL/extensions/intel/cl_intel_unified_shared_memory.html#_allocating_and_freeing_unified_shared_memory) variants of `It must be a power of two and must be equal to or smaller than the size of the largest data type supported by`

AFAIK, [Unified SVM](https://github.com/bashbaug/OpenCL-Docs/blob/1b2356d649d49991966c7efab27aaa2a24c75672/extensions/cl_khr_unified_svm.asciidoc) maximum alignment is still to unresolved (item 18).

### Code Example (Optional)

_No response_

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with SYCL 2020 section 4.8.3 and the definitions of aligned_alloc_device, aligned_alloc_host, aligned_alloc_shared, and aligned_alloc. Compare the cited OpenCL SVM and Intel USM alignment restrictions; done means the specification clearly resolves the maximum alignment guarantee and behavior for over-aligned requests.

Written by the indexing model from the issue text.

Assessment

Domain
documentation
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.