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

Limit vec alignment to 64 bytes #448

Merged
merged 2 commits into from
Sep 14, 2023

Commits on Jul 25, 2023

  1. Limit vec alignment to 64 bytes

    We currently require `vec` to be aligned according to its total storage
    size.  For example, a `vec<uint32_t, 8>` must be aligned on a 32 byte
    boundary (32 = sizeof(uint32_t) * 8).  This comes from OpenCL, which
    has the same requirement.  The largest required alignment is for
    `vec<double, 16>`, which is typically 128 bytes.
    
    However, this is problematic in SYCL because we want to support a
    variety of host compilers.  The MSVC compiler has a limit of 64 byte
    alignment for function parameters.  Therefore, the SYCL alignment
    requirements makes it impossible to pass a `vec<double, 16>` as a
    function parameter when compiling with MSVC.  This is particularly
    problematic because many of the SYCL "builtin" math function take
    `vec` as a parameter type.
    
    We therefore propose weakening the alignment requirement to make it
    possible to support MSVC.  Of course, implementations are still allowed
    to align `vec` more highly if this results in more efficient code.
    
    We considered removing the special alignment requirements entirely for
    `vec` and leaving this as an implementation detail.  However, existing
    code may depend on this alignment, so we opted for the most
    conservative change that still allows MSVC to work.  Therefore, we
    propose capping the required alignment to 64 bytes.
    gmlueck committed Jul 25, 2023
    Configuration menu
    Copy the full SHA
    cbccbe6 View commit details
    Browse the repository at this point in the history

Commits on Sep 8, 2023

  1. Add non-normative note

    Add a non-normative note explaining why the guaranteed alignment is
    limited to 64 bytes.
    gmlueck committed Sep 8, 2023
    Configuration menu
    Copy the full SHA
    8d41edc View commit details
    Browse the repository at this point in the history