Skip to content

BOOST_MATH_SYCL_ENABLED is inescapable #1322

@will-saunders-ukaea

Description

@will-saunders-ukaea

The macros at [1] assume that if SYCL_LANGUAGE_VERSION is defined then the user wants to use boost math with SYCL. However this macro is defined by the SYCL compiler even when it is compiling host only code.

  1. The user may only want to use boost::math on the host and never the device. For example consider test code which uses boost::math as an alternative implementation to test against.
  2. The user may use a intermediate library on the host which transitively includes boost::math.

These macros also assume that SYCL_EXTERNAL is defined [2]. However SYCL_EXTERNAL is optionally defined by the SYCL implementation if it is supported [3].

These macros define BOOST_MATH_NO_EXCEPTIONS which in turn triggers this bug [4]? This might be fixed as of 1.89.0?

Please can boost::math SYCL support be opt-in or at least opt-out?

Many thanks,
Will

[1]

#elif defined(SYCL_LANGUAGE_VERSION)

[2]
# define BOOST_MATH_SYCL_ENABLED SYCL_EXTERNAL

[3] https://registry.khronos.org/SYCL/specs/sycl-2020/html/sycl-2020.html#_preprocessor_directives_and_macros
[4] #1285

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions