Skip to content

Incomplete SYCL 2020 math functions marray support #5991

Closed
@JackAKirk

Description

@JackAKirk

Table 161 of the SYCL 2020 spec revision 4 provides the following relevant descriptions:

floatn: float{n}, mfloat{n}, marray<{N},float>
genfloatf: float, floatn
genfloat: genfloatf, genfloatd, genfloath

where

{N} means any positive value of size_t type.

The spec then defines math functions such as:

genfloat acos (genfloat x)

which are implemented in intel/llvm as (https://github.com/intel/llvm/blob/sycl/sycl/include/CL/sycl/builtins.hpp):

// genfloat acos (genfloat x)
template <typename T>
detail::enable_if_t<detail::is_genfloat<T>::value, T> acos(T x) __NOEXC {
  return __sycl_std::__invoke_acos<T>(x);
}

Now if we follow the definition of genfloat type trait and sub traits eventually we get that the subset of marray types contained within genfloat is defined by marray_float_list as:

using marray_float_list =
    type_list<marray<float, 1>, marray<float, 2>, marray<float, 3>,
              marray<float, 4>, marray<float, 8>, marray<float, 16>>;

i.e. this covers the set {n} : (from the sycl spec)

where {n} means 2,3,4,8,16

which does not match the set from the sycl spec which covers {N} defined above.

This means that we should increase marray_float_list to cover the complete set {N}, unless there is a good reason that only the limited {n} is supported by the sycl Math functions (In which case the SYCL spec should be updated)?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions