From dc3b0c90c3a9441be068c573b3860de437d7620d Mon Sep 17 00:00:00 2001 From: Matt Borland Date: Thu, 9 Jul 2026 09:31:25 -0400 Subject: [PATCH 1/9] Add SYCL macro --- include/boost/charconv/detail/config.hpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/include/boost/charconv/detail/config.hpp b/include/boost/charconv/detail/config.hpp index 3ed01d75..ec389f81 100644 --- a/include/boost/charconv/detail/config.hpp +++ b/include/boost/charconv/detail/config.hpp @@ -19,8 +19,10 @@ # define BOOST_CHARCONV_DEBUG_ASSERT(expr) #endif -// Use 128-bit integers and suppress warnings for using extensions -#if defined(BOOST_HAS_INT128) && !(defined(BOOST_CHARCONV_ENABLE_CUDA) && defined(__CUDACC__)) +// Use 128-bit integers and suppress warnings for using extensions. +// The CUDA and SYCL device paths do not use the builtin 128-bit integer (the SYCL spir64 +// target has none, and the CUDA path is kept portable), so the emulated uint128 is used there. +#if defined(BOOST_HAS_INT128) && !(defined(BOOST_CHARCONV_ENABLE_CUDA) && defined(__CUDACC__)) && !defined(BOOST_CHARCONV_ENABLE_SYCL) # define BOOST_CHARCONV_HAS_INT128 # define BOOST_CHARCONV_INT128_MAX static_cast((static_cast(1) << 127) - 1) # define BOOST_CHARCONV_INT128_MIN (-BOOST_CHARCONV_INT128_MAX - 1) @@ -205,8 +207,12 @@ static_assert(std::is_same::value, "__float128 should b #endif +// Device function markers. CUDA uses __host__ __device__; SYCL uses SYCL_EXTERNAL and is +// opt-in via BOOST_CHARCONV_ENABLE_SYCL (define it, and include beforehand). #if defined(BOOST_CHARCONV_ENABLE_CUDA) && defined(__CUDACC__) # define BOOST_CHARCONV_HOST_DEVICE __host__ __device__ +#elif defined(BOOST_CHARCONV_ENABLE_SYCL) +# define BOOST_CHARCONV_HOST_DEVICE SYCL_EXTERNAL #else # define BOOST_CHARCONV_HOST_DEVICE #endif From c32e6de697a261505ac4eefce83d43cfd71a4ae6 Mon Sep 17 00:00:00 2001 From: Matt Borland Date: Thu, 9 Jul 2026 09:33:10 -0400 Subject: [PATCH 2/9] Use numeric_limits detection instead of type traits --- include/boost/charconv/detail/to_chars_integer_impl.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/boost/charconv/detail/to_chars_integer_impl.hpp b/include/boost/charconv/detail/to_chars_integer_impl.hpp index 79066d82..9852e485 100644 --- a/include/boost/charconv/detail/to_chars_integer_impl.hpp +++ b/include/boost/charconv/detail/to_chars_integer_impl.hpp @@ -343,8 +343,8 @@ BOOST_CHARCONV_HOST_DEVICE BOOST_CHARCONV_CONSTEXPR to_chars_result to_chars_int Unsigned_Integer unsigned_value {}; const auto unsigned_base = static_cast(base); - - BOOST_IF_CONSTEXPR (std::is_signed::value) + + BOOST_IF_CONSTEXPR (std::numeric_limits::is_signed) { if (value < static_cast(0)) { From d4f207c6b8fd08bbc745730f439466bf1930d8e5 Mon Sep 17 00:00:00 2001 From: Matt Borland Date: Thu, 9 Jul 2026 09:33:27 -0400 Subject: [PATCH 3/9] Add sycl test harness --- test/sycl_charconv_test.hpp | 202 ++++++++++++++++++++++++++++++++++++ 1 file changed, 202 insertions(+) create mode 100644 test/sycl_charconv_test.hpp diff --git a/test/sycl_charconv_test.hpp b/test/sycl_charconv_test.hpp new file mode 100644 index 00000000..967cd821 --- /dev/null +++ b/test/sycl_charconv_test.hpp @@ -0,0 +1,202 @@ +// Copyright 2026 Matt Borland +// Distributed under the Boost Software License, Version 1.0. +// https://www.boost.org/LICENSE_1_0.txt +// +// Shared harness for the Boost.Charconv SYCL tests. Each test runs to_chars/from_chars +// element-wise on the SYCL device over random inputs and verifies the device results +// against a host recomputation of the same operation. + +#ifndef BOOST_CHARCONV_TEST_SYCL_CHARCONV_TEST_HPP +#define BOOST_CHARCONV_TEST_SYCL_CHARCONV_TEST_HPP + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace charconv_sycl_test { + +constexpr int num_elements {20000}; +// Large enough for the widest built-in integer in base 2 (64 digits) plus a sign. +constexpr int buf_size {128}; + +// to_chars: format each value on the device and compare against the host. +template +int test_to_chars(const int base = 10) +{ + sycl::queue q; + std::cout << "SYCL device: " << q.get_device().get_info() << "\n"; + + T* in {sycl::malloc_shared(num_elements, q)}; + char* out_str {sycl::malloc_shared(num_elements * buf_size, q)}; + int* out_len {sycl::malloc_shared(num_elements, q)}; + + std::mt19937_64 rng {42}; + for (int i {0}; i < num_elements; ++i) + { + in[i] = static_cast(rng()); + } + + q.submit([&](sycl::handler& h) + { + h.parallel_for(sycl::range<1>(num_elements), [=](sycl::id<1> idx) + { + const int i {static_cast(idx[0])}; + char* buf {out_str + i * buf_size}; + const auto r {boost::charconv::to_chars(buf, buf + buf_size, in[i], base)}; + out_len[i] = static_cast(r.ptr - buf); + }); + }).wait(); + + int failures {0}; + for (int i {0}; i < num_elements; ++i) + { + char buf[buf_size]; + const auto r {boost::charconv::to_chars(buf, buf + buf_size, in[i], base)}; + const int n {static_cast(r.ptr - buf)}; + if (out_len[i] != n || std::memcmp(out_str + i * buf_size, buf, static_cast(n)) != 0) + { + if (failures < 5) + { + std::cerr << "Mismatch at element " << i << " (base " << base << ")\n"; + } + ++failures; + } + } + + sycl::free(in, q); + sycl::free(out_str, q); + sycl::free(out_len, q); + + if (failures == 0) + { + std::cout << "Test PASSED\n"; + return EXIT_SUCCESS; + } + + std::cerr << "Test FAILED with " << failures << " mismatches\n"; + return EXIT_FAILURE; +} + +// from_chars: format each value on the host, parse it back on the device, verify round trip. +template +int test_from_chars(const int base = 10) +{ + sycl::queue q; + std::cout << "SYCL device: " << q.get_device().get_info() << "\n"; + + char* in_str {sycl::malloc_shared(num_elements * buf_size, q)}; + int* in_len {sycl::malloc_shared(num_elements, q)}; + T* out {sycl::malloc_shared(num_elements, q)}; + T* expected {sycl::malloc_shared(num_elements, q)}; + + std::mt19937_64 rng {42}; + for (int i {0}; i < num_elements; ++i) + { + expected[i] = static_cast(rng()); + char buf[buf_size]; + const auto r {boost::charconv::to_chars(buf, buf + buf_size, expected[i], base)}; + const int n {static_cast(r.ptr - buf)}; + std::memcpy(in_str + i * buf_size, buf, static_cast(n)); + in_len[i] = n; + } + + q.submit([&](sycl::handler& h) + { + h.parallel_for(sycl::range<1>(num_elements), [=](sycl::id<1> idx) + { + const int i {static_cast(idx[0])}; + const char* buf {in_str + i * buf_size}; + T value {}; + boost::charconv::from_chars(buf, buf + in_len[i], value, base); + out[i] = value; + }); + }).wait(); + + int failures {0}; + for (int i {0}; i < num_elements; ++i) + { + if (out[i] != expected[i]) + { + if (failures < 5) + { + std::cerr << "Mismatch at element " << i << " (base " << base << ")\n"; + } + ++failures; + } + } + + sycl::free(in_str, q); + sycl::free(in_len, q); + sycl::free(out, q); + sycl::free(expected, q); + + if (failures == 0) + { + std::cout << "Test PASSED\n"; + return EXIT_SUCCESS; + } + + std::cerr << "Test FAILED with " << failures << " mismatches\n"; + return EXIT_FAILURE; +} + +// num_digits: count digits on the device and compare against the host. +template +int test_num_digits() +{ + sycl::queue q; + std::cout << "SYCL device: " << q.get_device().get_info() << "\n"; + + T* in {sycl::malloc_shared(num_elements, q)}; + int* out {sycl::malloc_shared(num_elements, q)}; + + std::mt19937_64 rng {42}; + for (int i {0}; i < num_elements; ++i) + { + in[i] = static_cast(rng()); + } + + q.submit([&](sycl::handler& h) + { + h.parallel_for(sycl::range<1>(num_elements), [=](sycl::id<1> idx) + { + const int i {static_cast(idx[0])}; + out[i] = boost::charconv::detail::num_digits(in[i]); + }); + }).wait(); + + int failures {0}; + for (int i {0}; i < num_elements; ++i) + { + if (out[i] != boost::charconv::detail::num_digits(in[i])) + { + if (failures < 5) + { + std::cerr << "Mismatch at element " << i << "\n"; + } + ++failures; + } + } + + sycl::free(in, q); + sycl::free(out, q); + + if (failures == 0) + { + std::cout << "Test PASSED\n"; + return EXIT_SUCCESS; + } + + std::cerr << "Test FAILED with " << failures << " mismatches\n"; + return EXIT_FAILURE; +} + +} // namespace charconv_sycl_test + +#endif // BOOST_CHARCONV_TEST_SYCL_CHARCONV_TEST_HPP From ced70da112458b70e3cf95601d97a07d09c775b7 Mon Sep 17 00:00:00 2001 From: Matt Borland Date: Thu, 9 Jul 2026 09:33:41 -0400 Subject: [PATCH 4/9] Add SYCL tests --- test/test_from_chars_bases_char_sycl.cpp | 15 +++++++++++++++ test/test_from_chars_bases_int_sycl.cpp | 15 +++++++++++++++ test/test_from_chars_bases_long_long_sycl.cpp | 15 +++++++++++++++ test/test_from_chars_bases_long_sycl.cpp | 15 +++++++++++++++ test/test_from_chars_bases_short_sycl.cpp | 15 +++++++++++++++ test/test_from_chars_bases_signed_char_sycl.cpp | 15 +++++++++++++++ test/test_from_chars_bases_unsigned_char_sycl.cpp | 15 +++++++++++++++ test/test_from_chars_bases_unsigned_int_sycl.cpp | 15 +++++++++++++++ ...t_from_chars_bases_unsigned_long_long_sycl.cpp | 15 +++++++++++++++ test/test_from_chars_bases_unsigned_long_sycl.cpp | 15 +++++++++++++++ .../test_from_chars_bases_unsigned_short_sycl.cpp | 15 +++++++++++++++ test/test_from_chars_char_sycl.cpp | 10 ++++++++++ test/test_from_chars_int_sycl.cpp | 10 ++++++++++ test/test_from_chars_long_long_sycl.cpp | 10 ++++++++++ test/test_from_chars_long_sycl.cpp | 10 ++++++++++ test/test_from_chars_short_sycl.cpp | 10 ++++++++++ test/test_from_chars_signed_char_sycl.cpp | 10 ++++++++++ test/test_from_chars_unsigned_char_sycl.cpp | 10 ++++++++++ test/test_from_chars_unsigned_int_sycl.cpp | 10 ++++++++++ test/test_from_chars_unsigned_long_long_sycl.cpp | 10 ++++++++++ test/test_from_chars_unsigned_long_sycl.cpp | 10 ++++++++++ test/test_from_chars_unsigned_short_sycl.cpp | 10 ++++++++++ test/test_num_digits_uint32_sycl.cpp | 11 +++++++++++ test/test_num_digits_uint64_sycl.cpp | 11 +++++++++++ test/test_to_chars_bases_char_sycl.cpp | 15 +++++++++++++++ test/test_to_chars_bases_int_sycl.cpp | 15 +++++++++++++++ test/test_to_chars_bases_long_long_sycl.cpp | 15 +++++++++++++++ test/test_to_chars_bases_long_sycl.cpp | 15 +++++++++++++++ test/test_to_chars_bases_short_sycl.cpp | 15 +++++++++++++++ test/test_to_chars_bases_signed_char_sycl.cpp | 15 +++++++++++++++ test/test_to_chars_bases_unsigned_char_sycl.cpp | 15 +++++++++++++++ test/test_to_chars_bases_unsigned_int_sycl.cpp | 15 +++++++++++++++ ...est_to_chars_bases_unsigned_long_long_sycl.cpp | 15 +++++++++++++++ test/test_to_chars_bases_unsigned_long_sycl.cpp | 15 +++++++++++++++ test/test_to_chars_bases_unsigned_short_sycl.cpp | 15 +++++++++++++++ test/test_to_chars_char_sycl.cpp | 10 ++++++++++ test/test_to_chars_int_sycl.cpp | 10 ++++++++++ test/test_to_chars_long_long_sycl.cpp | 10 ++++++++++ test/test_to_chars_long_sycl.cpp | 10 ++++++++++ test/test_to_chars_short_sycl.cpp | 10 ++++++++++ test/test_to_chars_signed_char_sycl.cpp | 10 ++++++++++ test/test_to_chars_unsigned_char_sycl.cpp | 10 ++++++++++ test/test_to_chars_unsigned_int_sycl.cpp | 10 ++++++++++ test/test_to_chars_unsigned_long_long_sycl.cpp | 10 ++++++++++ test/test_to_chars_unsigned_long_sycl.cpp | 10 ++++++++++ test/test_to_chars_unsigned_short_sycl.cpp | 10 ++++++++++ 46 files changed, 572 insertions(+) create mode 100644 test/test_from_chars_bases_char_sycl.cpp create mode 100644 test/test_from_chars_bases_int_sycl.cpp create mode 100644 test/test_from_chars_bases_long_long_sycl.cpp create mode 100644 test/test_from_chars_bases_long_sycl.cpp create mode 100644 test/test_from_chars_bases_short_sycl.cpp create mode 100644 test/test_from_chars_bases_signed_char_sycl.cpp create mode 100644 test/test_from_chars_bases_unsigned_char_sycl.cpp create mode 100644 test/test_from_chars_bases_unsigned_int_sycl.cpp create mode 100644 test/test_from_chars_bases_unsigned_long_long_sycl.cpp create mode 100644 test/test_from_chars_bases_unsigned_long_sycl.cpp create mode 100644 test/test_from_chars_bases_unsigned_short_sycl.cpp create mode 100644 test/test_from_chars_char_sycl.cpp create mode 100644 test/test_from_chars_int_sycl.cpp create mode 100644 test/test_from_chars_long_long_sycl.cpp create mode 100644 test/test_from_chars_long_sycl.cpp create mode 100644 test/test_from_chars_short_sycl.cpp create mode 100644 test/test_from_chars_signed_char_sycl.cpp create mode 100644 test/test_from_chars_unsigned_char_sycl.cpp create mode 100644 test/test_from_chars_unsigned_int_sycl.cpp create mode 100644 test/test_from_chars_unsigned_long_long_sycl.cpp create mode 100644 test/test_from_chars_unsigned_long_sycl.cpp create mode 100644 test/test_from_chars_unsigned_short_sycl.cpp create mode 100644 test/test_num_digits_uint32_sycl.cpp create mode 100644 test/test_num_digits_uint64_sycl.cpp create mode 100644 test/test_to_chars_bases_char_sycl.cpp create mode 100644 test/test_to_chars_bases_int_sycl.cpp create mode 100644 test/test_to_chars_bases_long_long_sycl.cpp create mode 100644 test/test_to_chars_bases_long_sycl.cpp create mode 100644 test/test_to_chars_bases_short_sycl.cpp create mode 100644 test/test_to_chars_bases_signed_char_sycl.cpp create mode 100644 test/test_to_chars_bases_unsigned_char_sycl.cpp create mode 100644 test/test_to_chars_bases_unsigned_int_sycl.cpp create mode 100644 test/test_to_chars_bases_unsigned_long_long_sycl.cpp create mode 100644 test/test_to_chars_bases_unsigned_long_sycl.cpp create mode 100644 test/test_to_chars_bases_unsigned_short_sycl.cpp create mode 100644 test/test_to_chars_char_sycl.cpp create mode 100644 test/test_to_chars_int_sycl.cpp create mode 100644 test/test_to_chars_long_long_sycl.cpp create mode 100644 test/test_to_chars_long_sycl.cpp create mode 100644 test/test_to_chars_short_sycl.cpp create mode 100644 test/test_to_chars_signed_char_sycl.cpp create mode 100644 test/test_to_chars_unsigned_char_sycl.cpp create mode 100644 test/test_to_chars_unsigned_int_sycl.cpp create mode 100644 test/test_to_chars_unsigned_long_long_sycl.cpp create mode 100644 test/test_to_chars_unsigned_long_sycl.cpp create mode 100644 test/test_to_chars_unsigned_short_sycl.cpp diff --git a/test/test_from_chars_bases_char_sycl.cpp b/test/test_from_chars_bases_char_sycl.cpp new file mode 100644 index 00000000..528f5a35 --- /dev/null +++ b/test/test_from_chars_bases_char_sycl.cpp @@ -0,0 +1,15 @@ +// Copyright 2026 Matt Borland +// Distributed under the Boost Software License, Version 1.0. +// https://www.boost.org/LICENSE_1_0.txt + +#include "sycl_charconv_test.hpp" + +int main() +{ + int result {0}; + for (int base {2}; base <= 36; ++base) + { + result |= charconv_sycl_test::test_from_chars(base); + } + return result; +} diff --git a/test/test_from_chars_bases_int_sycl.cpp b/test/test_from_chars_bases_int_sycl.cpp new file mode 100644 index 00000000..37e2b9f4 --- /dev/null +++ b/test/test_from_chars_bases_int_sycl.cpp @@ -0,0 +1,15 @@ +// Copyright 2026 Matt Borland +// Distributed under the Boost Software License, Version 1.0. +// https://www.boost.org/LICENSE_1_0.txt + +#include "sycl_charconv_test.hpp" + +int main() +{ + int result {0}; + for (int base {2}; base <= 36; ++base) + { + result |= charconv_sycl_test::test_from_chars(base); + } + return result; +} diff --git a/test/test_from_chars_bases_long_long_sycl.cpp b/test/test_from_chars_bases_long_long_sycl.cpp new file mode 100644 index 00000000..dff4dda5 --- /dev/null +++ b/test/test_from_chars_bases_long_long_sycl.cpp @@ -0,0 +1,15 @@ +// Copyright 2026 Matt Borland +// Distributed under the Boost Software License, Version 1.0. +// https://www.boost.org/LICENSE_1_0.txt + +#include "sycl_charconv_test.hpp" + +int main() +{ + int result {0}; + for (int base {2}; base <= 36; ++base) + { + result |= charconv_sycl_test::test_from_chars(base); + } + return result; +} diff --git a/test/test_from_chars_bases_long_sycl.cpp b/test/test_from_chars_bases_long_sycl.cpp new file mode 100644 index 00000000..6e265b45 --- /dev/null +++ b/test/test_from_chars_bases_long_sycl.cpp @@ -0,0 +1,15 @@ +// Copyright 2026 Matt Borland +// Distributed under the Boost Software License, Version 1.0. +// https://www.boost.org/LICENSE_1_0.txt + +#include "sycl_charconv_test.hpp" + +int main() +{ + int result {0}; + for (int base {2}; base <= 36; ++base) + { + result |= charconv_sycl_test::test_from_chars(base); + } + return result; +} diff --git a/test/test_from_chars_bases_short_sycl.cpp b/test/test_from_chars_bases_short_sycl.cpp new file mode 100644 index 00000000..9e073632 --- /dev/null +++ b/test/test_from_chars_bases_short_sycl.cpp @@ -0,0 +1,15 @@ +// Copyright 2026 Matt Borland +// Distributed under the Boost Software License, Version 1.0. +// https://www.boost.org/LICENSE_1_0.txt + +#include "sycl_charconv_test.hpp" + +int main() +{ + int result {0}; + for (int base {2}; base <= 36; ++base) + { + result |= charconv_sycl_test::test_from_chars(base); + } + return result; +} diff --git a/test/test_from_chars_bases_signed_char_sycl.cpp b/test/test_from_chars_bases_signed_char_sycl.cpp new file mode 100644 index 00000000..473ce9ea --- /dev/null +++ b/test/test_from_chars_bases_signed_char_sycl.cpp @@ -0,0 +1,15 @@ +// Copyright 2026 Matt Borland +// Distributed under the Boost Software License, Version 1.0. +// https://www.boost.org/LICENSE_1_0.txt + +#include "sycl_charconv_test.hpp" + +int main() +{ + int result {0}; + for (int base {2}; base <= 36; ++base) + { + result |= charconv_sycl_test::test_from_chars(base); + } + return result; +} diff --git a/test/test_from_chars_bases_unsigned_char_sycl.cpp b/test/test_from_chars_bases_unsigned_char_sycl.cpp new file mode 100644 index 00000000..76267f7f --- /dev/null +++ b/test/test_from_chars_bases_unsigned_char_sycl.cpp @@ -0,0 +1,15 @@ +// Copyright 2026 Matt Borland +// Distributed under the Boost Software License, Version 1.0. +// https://www.boost.org/LICENSE_1_0.txt + +#include "sycl_charconv_test.hpp" + +int main() +{ + int result {0}; + for (int base {2}; base <= 36; ++base) + { + result |= charconv_sycl_test::test_from_chars(base); + } + return result; +} diff --git a/test/test_from_chars_bases_unsigned_int_sycl.cpp b/test/test_from_chars_bases_unsigned_int_sycl.cpp new file mode 100644 index 00000000..548609d6 --- /dev/null +++ b/test/test_from_chars_bases_unsigned_int_sycl.cpp @@ -0,0 +1,15 @@ +// Copyright 2026 Matt Borland +// Distributed under the Boost Software License, Version 1.0. +// https://www.boost.org/LICENSE_1_0.txt + +#include "sycl_charconv_test.hpp" + +int main() +{ + int result {0}; + for (int base {2}; base <= 36; ++base) + { + result |= charconv_sycl_test::test_from_chars(base); + } + return result; +} diff --git a/test/test_from_chars_bases_unsigned_long_long_sycl.cpp b/test/test_from_chars_bases_unsigned_long_long_sycl.cpp new file mode 100644 index 00000000..76f83916 --- /dev/null +++ b/test/test_from_chars_bases_unsigned_long_long_sycl.cpp @@ -0,0 +1,15 @@ +// Copyright 2026 Matt Borland +// Distributed under the Boost Software License, Version 1.0. +// https://www.boost.org/LICENSE_1_0.txt + +#include "sycl_charconv_test.hpp" + +int main() +{ + int result {0}; + for (int base {2}; base <= 36; ++base) + { + result |= charconv_sycl_test::test_from_chars(base); + } + return result; +} diff --git a/test/test_from_chars_bases_unsigned_long_sycl.cpp b/test/test_from_chars_bases_unsigned_long_sycl.cpp new file mode 100644 index 00000000..c343dd9a --- /dev/null +++ b/test/test_from_chars_bases_unsigned_long_sycl.cpp @@ -0,0 +1,15 @@ +// Copyright 2026 Matt Borland +// Distributed under the Boost Software License, Version 1.0. +// https://www.boost.org/LICENSE_1_0.txt + +#include "sycl_charconv_test.hpp" + +int main() +{ + int result {0}; + for (int base {2}; base <= 36; ++base) + { + result |= charconv_sycl_test::test_from_chars(base); + } + return result; +} diff --git a/test/test_from_chars_bases_unsigned_short_sycl.cpp b/test/test_from_chars_bases_unsigned_short_sycl.cpp new file mode 100644 index 00000000..699e9a66 --- /dev/null +++ b/test/test_from_chars_bases_unsigned_short_sycl.cpp @@ -0,0 +1,15 @@ +// Copyright 2026 Matt Borland +// Distributed under the Boost Software License, Version 1.0. +// https://www.boost.org/LICENSE_1_0.txt + +#include "sycl_charconv_test.hpp" + +int main() +{ + int result {0}; + for (int base {2}; base <= 36; ++base) + { + result |= charconv_sycl_test::test_from_chars(base); + } + return result; +} diff --git a/test/test_from_chars_char_sycl.cpp b/test/test_from_chars_char_sycl.cpp new file mode 100644 index 00000000..ce67d0ab --- /dev/null +++ b/test/test_from_chars_char_sycl.cpp @@ -0,0 +1,10 @@ +// Copyright 2026 Matt Borland +// Distributed under the Boost Software License, Version 1.0. +// https://www.boost.org/LICENSE_1_0.txt + +#include "sycl_charconv_test.hpp" + +int main() +{ + return charconv_sycl_test::test_from_chars(); +} diff --git a/test/test_from_chars_int_sycl.cpp b/test/test_from_chars_int_sycl.cpp new file mode 100644 index 00000000..49619436 --- /dev/null +++ b/test/test_from_chars_int_sycl.cpp @@ -0,0 +1,10 @@ +// Copyright 2026 Matt Borland +// Distributed under the Boost Software License, Version 1.0. +// https://www.boost.org/LICENSE_1_0.txt + +#include "sycl_charconv_test.hpp" + +int main() +{ + return charconv_sycl_test::test_from_chars(); +} diff --git a/test/test_from_chars_long_long_sycl.cpp b/test/test_from_chars_long_long_sycl.cpp new file mode 100644 index 00000000..28ecd381 --- /dev/null +++ b/test/test_from_chars_long_long_sycl.cpp @@ -0,0 +1,10 @@ +// Copyright 2026 Matt Borland +// Distributed under the Boost Software License, Version 1.0. +// https://www.boost.org/LICENSE_1_0.txt + +#include "sycl_charconv_test.hpp" + +int main() +{ + return charconv_sycl_test::test_from_chars(); +} diff --git a/test/test_from_chars_long_sycl.cpp b/test/test_from_chars_long_sycl.cpp new file mode 100644 index 00000000..15740a7f --- /dev/null +++ b/test/test_from_chars_long_sycl.cpp @@ -0,0 +1,10 @@ +// Copyright 2026 Matt Borland +// Distributed under the Boost Software License, Version 1.0. +// https://www.boost.org/LICENSE_1_0.txt + +#include "sycl_charconv_test.hpp" + +int main() +{ + return charconv_sycl_test::test_from_chars(); +} diff --git a/test/test_from_chars_short_sycl.cpp b/test/test_from_chars_short_sycl.cpp new file mode 100644 index 00000000..5b2db74f --- /dev/null +++ b/test/test_from_chars_short_sycl.cpp @@ -0,0 +1,10 @@ +// Copyright 2026 Matt Borland +// Distributed under the Boost Software License, Version 1.0. +// https://www.boost.org/LICENSE_1_0.txt + +#include "sycl_charconv_test.hpp" + +int main() +{ + return charconv_sycl_test::test_from_chars(); +} diff --git a/test/test_from_chars_signed_char_sycl.cpp b/test/test_from_chars_signed_char_sycl.cpp new file mode 100644 index 00000000..5bddcdf6 --- /dev/null +++ b/test/test_from_chars_signed_char_sycl.cpp @@ -0,0 +1,10 @@ +// Copyright 2026 Matt Borland +// Distributed under the Boost Software License, Version 1.0. +// https://www.boost.org/LICENSE_1_0.txt + +#include "sycl_charconv_test.hpp" + +int main() +{ + return charconv_sycl_test::test_from_chars(); +} diff --git a/test/test_from_chars_unsigned_char_sycl.cpp b/test/test_from_chars_unsigned_char_sycl.cpp new file mode 100644 index 00000000..995af24b --- /dev/null +++ b/test/test_from_chars_unsigned_char_sycl.cpp @@ -0,0 +1,10 @@ +// Copyright 2026 Matt Borland +// Distributed under the Boost Software License, Version 1.0. +// https://www.boost.org/LICENSE_1_0.txt + +#include "sycl_charconv_test.hpp" + +int main() +{ + return charconv_sycl_test::test_from_chars(); +} diff --git a/test/test_from_chars_unsigned_int_sycl.cpp b/test/test_from_chars_unsigned_int_sycl.cpp new file mode 100644 index 00000000..6ddad488 --- /dev/null +++ b/test/test_from_chars_unsigned_int_sycl.cpp @@ -0,0 +1,10 @@ +// Copyright 2026 Matt Borland +// Distributed under the Boost Software License, Version 1.0. +// https://www.boost.org/LICENSE_1_0.txt + +#include "sycl_charconv_test.hpp" + +int main() +{ + return charconv_sycl_test::test_from_chars(); +} diff --git a/test/test_from_chars_unsigned_long_long_sycl.cpp b/test/test_from_chars_unsigned_long_long_sycl.cpp new file mode 100644 index 00000000..cde94584 --- /dev/null +++ b/test/test_from_chars_unsigned_long_long_sycl.cpp @@ -0,0 +1,10 @@ +// Copyright 2026 Matt Borland +// Distributed under the Boost Software License, Version 1.0. +// https://www.boost.org/LICENSE_1_0.txt + +#include "sycl_charconv_test.hpp" + +int main() +{ + return charconv_sycl_test::test_from_chars(); +} diff --git a/test/test_from_chars_unsigned_long_sycl.cpp b/test/test_from_chars_unsigned_long_sycl.cpp new file mode 100644 index 00000000..9df8b678 --- /dev/null +++ b/test/test_from_chars_unsigned_long_sycl.cpp @@ -0,0 +1,10 @@ +// Copyright 2026 Matt Borland +// Distributed under the Boost Software License, Version 1.0. +// https://www.boost.org/LICENSE_1_0.txt + +#include "sycl_charconv_test.hpp" + +int main() +{ + return charconv_sycl_test::test_from_chars(); +} diff --git a/test/test_from_chars_unsigned_short_sycl.cpp b/test/test_from_chars_unsigned_short_sycl.cpp new file mode 100644 index 00000000..16b87976 --- /dev/null +++ b/test/test_from_chars_unsigned_short_sycl.cpp @@ -0,0 +1,10 @@ +// Copyright 2026 Matt Borland +// Distributed under the Boost Software License, Version 1.0. +// https://www.boost.org/LICENSE_1_0.txt + +#include "sycl_charconv_test.hpp" + +int main() +{ + return charconv_sycl_test::test_from_chars(); +} diff --git a/test/test_num_digits_uint32_sycl.cpp b/test/test_num_digits_uint32_sycl.cpp new file mode 100644 index 00000000..8a30a5ed --- /dev/null +++ b/test/test_num_digits_uint32_sycl.cpp @@ -0,0 +1,11 @@ +// Copyright 2026 Matt Borland +// Distributed under the Boost Software License, Version 1.0. +// https://www.boost.org/LICENSE_1_0.txt + +#include "sycl_charconv_test.hpp" +#include + +int main() +{ + return charconv_sycl_test::test_num_digits(); +} diff --git a/test/test_num_digits_uint64_sycl.cpp b/test/test_num_digits_uint64_sycl.cpp new file mode 100644 index 00000000..66af279d --- /dev/null +++ b/test/test_num_digits_uint64_sycl.cpp @@ -0,0 +1,11 @@ +// Copyright 2026 Matt Borland +// Distributed under the Boost Software License, Version 1.0. +// https://www.boost.org/LICENSE_1_0.txt + +#include "sycl_charconv_test.hpp" +#include + +int main() +{ + return charconv_sycl_test::test_num_digits(); +} diff --git a/test/test_to_chars_bases_char_sycl.cpp b/test/test_to_chars_bases_char_sycl.cpp new file mode 100644 index 00000000..ebde8d6f --- /dev/null +++ b/test/test_to_chars_bases_char_sycl.cpp @@ -0,0 +1,15 @@ +// Copyright 2026 Matt Borland +// Distributed under the Boost Software License, Version 1.0. +// https://www.boost.org/LICENSE_1_0.txt + +#include "sycl_charconv_test.hpp" + +int main() +{ + int result {0}; + for (int base {2}; base <= 36; ++base) + { + result |= charconv_sycl_test::test_to_chars(base); + } + return result; +} diff --git a/test/test_to_chars_bases_int_sycl.cpp b/test/test_to_chars_bases_int_sycl.cpp new file mode 100644 index 00000000..5b393b83 --- /dev/null +++ b/test/test_to_chars_bases_int_sycl.cpp @@ -0,0 +1,15 @@ +// Copyright 2026 Matt Borland +// Distributed under the Boost Software License, Version 1.0. +// https://www.boost.org/LICENSE_1_0.txt + +#include "sycl_charconv_test.hpp" + +int main() +{ + int result {0}; + for (int base {2}; base <= 36; ++base) + { + result |= charconv_sycl_test::test_to_chars(base); + } + return result; +} diff --git a/test/test_to_chars_bases_long_long_sycl.cpp b/test/test_to_chars_bases_long_long_sycl.cpp new file mode 100644 index 00000000..73f15b26 --- /dev/null +++ b/test/test_to_chars_bases_long_long_sycl.cpp @@ -0,0 +1,15 @@ +// Copyright 2026 Matt Borland +// Distributed under the Boost Software License, Version 1.0. +// https://www.boost.org/LICENSE_1_0.txt + +#include "sycl_charconv_test.hpp" + +int main() +{ + int result {0}; + for (int base {2}; base <= 36; ++base) + { + result |= charconv_sycl_test::test_to_chars(base); + } + return result; +} diff --git a/test/test_to_chars_bases_long_sycl.cpp b/test/test_to_chars_bases_long_sycl.cpp new file mode 100644 index 00000000..20f5a966 --- /dev/null +++ b/test/test_to_chars_bases_long_sycl.cpp @@ -0,0 +1,15 @@ +// Copyright 2026 Matt Borland +// Distributed under the Boost Software License, Version 1.0. +// https://www.boost.org/LICENSE_1_0.txt + +#include "sycl_charconv_test.hpp" + +int main() +{ + int result {0}; + for (int base {2}; base <= 36; ++base) + { + result |= charconv_sycl_test::test_to_chars(base); + } + return result; +} diff --git a/test/test_to_chars_bases_short_sycl.cpp b/test/test_to_chars_bases_short_sycl.cpp new file mode 100644 index 00000000..a3830374 --- /dev/null +++ b/test/test_to_chars_bases_short_sycl.cpp @@ -0,0 +1,15 @@ +// Copyright 2026 Matt Borland +// Distributed under the Boost Software License, Version 1.0. +// https://www.boost.org/LICENSE_1_0.txt + +#include "sycl_charconv_test.hpp" + +int main() +{ + int result {0}; + for (int base {2}; base <= 36; ++base) + { + result |= charconv_sycl_test::test_to_chars(base); + } + return result; +} diff --git a/test/test_to_chars_bases_signed_char_sycl.cpp b/test/test_to_chars_bases_signed_char_sycl.cpp new file mode 100644 index 00000000..28f9883c --- /dev/null +++ b/test/test_to_chars_bases_signed_char_sycl.cpp @@ -0,0 +1,15 @@ +// Copyright 2026 Matt Borland +// Distributed under the Boost Software License, Version 1.0. +// https://www.boost.org/LICENSE_1_0.txt + +#include "sycl_charconv_test.hpp" + +int main() +{ + int result {0}; + for (int base {2}; base <= 36; ++base) + { + result |= charconv_sycl_test::test_to_chars(base); + } + return result; +} diff --git a/test/test_to_chars_bases_unsigned_char_sycl.cpp b/test/test_to_chars_bases_unsigned_char_sycl.cpp new file mode 100644 index 00000000..8fa71e84 --- /dev/null +++ b/test/test_to_chars_bases_unsigned_char_sycl.cpp @@ -0,0 +1,15 @@ +// Copyright 2026 Matt Borland +// Distributed under the Boost Software License, Version 1.0. +// https://www.boost.org/LICENSE_1_0.txt + +#include "sycl_charconv_test.hpp" + +int main() +{ + int result {0}; + for (int base {2}; base <= 36; ++base) + { + result |= charconv_sycl_test::test_to_chars(base); + } + return result; +} diff --git a/test/test_to_chars_bases_unsigned_int_sycl.cpp b/test/test_to_chars_bases_unsigned_int_sycl.cpp new file mode 100644 index 00000000..fb8f0cb8 --- /dev/null +++ b/test/test_to_chars_bases_unsigned_int_sycl.cpp @@ -0,0 +1,15 @@ +// Copyright 2026 Matt Borland +// Distributed under the Boost Software License, Version 1.0. +// https://www.boost.org/LICENSE_1_0.txt + +#include "sycl_charconv_test.hpp" + +int main() +{ + int result {0}; + for (int base {2}; base <= 36; ++base) + { + result |= charconv_sycl_test::test_to_chars(base); + } + return result; +} diff --git a/test/test_to_chars_bases_unsigned_long_long_sycl.cpp b/test/test_to_chars_bases_unsigned_long_long_sycl.cpp new file mode 100644 index 00000000..bb50f197 --- /dev/null +++ b/test/test_to_chars_bases_unsigned_long_long_sycl.cpp @@ -0,0 +1,15 @@ +// Copyright 2026 Matt Borland +// Distributed under the Boost Software License, Version 1.0. +// https://www.boost.org/LICENSE_1_0.txt + +#include "sycl_charconv_test.hpp" + +int main() +{ + int result {0}; + for (int base {2}; base <= 36; ++base) + { + result |= charconv_sycl_test::test_to_chars(base); + } + return result; +} diff --git a/test/test_to_chars_bases_unsigned_long_sycl.cpp b/test/test_to_chars_bases_unsigned_long_sycl.cpp new file mode 100644 index 00000000..93319a4c --- /dev/null +++ b/test/test_to_chars_bases_unsigned_long_sycl.cpp @@ -0,0 +1,15 @@ +// Copyright 2026 Matt Borland +// Distributed under the Boost Software License, Version 1.0. +// https://www.boost.org/LICENSE_1_0.txt + +#include "sycl_charconv_test.hpp" + +int main() +{ + int result {0}; + for (int base {2}; base <= 36; ++base) + { + result |= charconv_sycl_test::test_to_chars(base); + } + return result; +} diff --git a/test/test_to_chars_bases_unsigned_short_sycl.cpp b/test/test_to_chars_bases_unsigned_short_sycl.cpp new file mode 100644 index 00000000..924171cb --- /dev/null +++ b/test/test_to_chars_bases_unsigned_short_sycl.cpp @@ -0,0 +1,15 @@ +// Copyright 2026 Matt Borland +// Distributed under the Boost Software License, Version 1.0. +// https://www.boost.org/LICENSE_1_0.txt + +#include "sycl_charconv_test.hpp" + +int main() +{ + int result {0}; + for (int base {2}; base <= 36; ++base) + { + result |= charconv_sycl_test::test_to_chars(base); + } + return result; +} diff --git a/test/test_to_chars_char_sycl.cpp b/test/test_to_chars_char_sycl.cpp new file mode 100644 index 00000000..b2cb70bd --- /dev/null +++ b/test/test_to_chars_char_sycl.cpp @@ -0,0 +1,10 @@ +// Copyright 2026 Matt Borland +// Distributed under the Boost Software License, Version 1.0. +// https://www.boost.org/LICENSE_1_0.txt + +#include "sycl_charconv_test.hpp" + +int main() +{ + return charconv_sycl_test::test_to_chars(); +} diff --git a/test/test_to_chars_int_sycl.cpp b/test/test_to_chars_int_sycl.cpp new file mode 100644 index 00000000..fb02dc4e --- /dev/null +++ b/test/test_to_chars_int_sycl.cpp @@ -0,0 +1,10 @@ +// Copyright 2026 Matt Borland +// Distributed under the Boost Software License, Version 1.0. +// https://www.boost.org/LICENSE_1_0.txt + +#include "sycl_charconv_test.hpp" + +int main() +{ + return charconv_sycl_test::test_to_chars(); +} diff --git a/test/test_to_chars_long_long_sycl.cpp b/test/test_to_chars_long_long_sycl.cpp new file mode 100644 index 00000000..c86625bc --- /dev/null +++ b/test/test_to_chars_long_long_sycl.cpp @@ -0,0 +1,10 @@ +// Copyright 2026 Matt Borland +// Distributed under the Boost Software License, Version 1.0. +// https://www.boost.org/LICENSE_1_0.txt + +#include "sycl_charconv_test.hpp" + +int main() +{ + return charconv_sycl_test::test_to_chars(); +} diff --git a/test/test_to_chars_long_sycl.cpp b/test/test_to_chars_long_sycl.cpp new file mode 100644 index 00000000..e42e0bfd --- /dev/null +++ b/test/test_to_chars_long_sycl.cpp @@ -0,0 +1,10 @@ +// Copyright 2026 Matt Borland +// Distributed under the Boost Software License, Version 1.0. +// https://www.boost.org/LICENSE_1_0.txt + +#include "sycl_charconv_test.hpp" + +int main() +{ + return charconv_sycl_test::test_to_chars(); +} diff --git a/test/test_to_chars_short_sycl.cpp b/test/test_to_chars_short_sycl.cpp new file mode 100644 index 00000000..b18a5d2a --- /dev/null +++ b/test/test_to_chars_short_sycl.cpp @@ -0,0 +1,10 @@ +// Copyright 2026 Matt Borland +// Distributed under the Boost Software License, Version 1.0. +// https://www.boost.org/LICENSE_1_0.txt + +#include "sycl_charconv_test.hpp" + +int main() +{ + return charconv_sycl_test::test_to_chars(); +} diff --git a/test/test_to_chars_signed_char_sycl.cpp b/test/test_to_chars_signed_char_sycl.cpp new file mode 100644 index 00000000..67ee622d --- /dev/null +++ b/test/test_to_chars_signed_char_sycl.cpp @@ -0,0 +1,10 @@ +// Copyright 2026 Matt Borland +// Distributed under the Boost Software License, Version 1.0. +// https://www.boost.org/LICENSE_1_0.txt + +#include "sycl_charconv_test.hpp" + +int main() +{ + return charconv_sycl_test::test_to_chars(); +} diff --git a/test/test_to_chars_unsigned_char_sycl.cpp b/test/test_to_chars_unsigned_char_sycl.cpp new file mode 100644 index 00000000..99ab2177 --- /dev/null +++ b/test/test_to_chars_unsigned_char_sycl.cpp @@ -0,0 +1,10 @@ +// Copyright 2026 Matt Borland +// Distributed under the Boost Software License, Version 1.0. +// https://www.boost.org/LICENSE_1_0.txt + +#include "sycl_charconv_test.hpp" + +int main() +{ + return charconv_sycl_test::test_to_chars(); +} diff --git a/test/test_to_chars_unsigned_int_sycl.cpp b/test/test_to_chars_unsigned_int_sycl.cpp new file mode 100644 index 00000000..a96da471 --- /dev/null +++ b/test/test_to_chars_unsigned_int_sycl.cpp @@ -0,0 +1,10 @@ +// Copyright 2026 Matt Borland +// Distributed under the Boost Software License, Version 1.0. +// https://www.boost.org/LICENSE_1_0.txt + +#include "sycl_charconv_test.hpp" + +int main() +{ + return charconv_sycl_test::test_to_chars(); +} diff --git a/test/test_to_chars_unsigned_long_long_sycl.cpp b/test/test_to_chars_unsigned_long_long_sycl.cpp new file mode 100644 index 00000000..eff00428 --- /dev/null +++ b/test/test_to_chars_unsigned_long_long_sycl.cpp @@ -0,0 +1,10 @@ +// Copyright 2026 Matt Borland +// Distributed under the Boost Software License, Version 1.0. +// https://www.boost.org/LICENSE_1_0.txt + +#include "sycl_charconv_test.hpp" + +int main() +{ + return charconv_sycl_test::test_to_chars(); +} diff --git a/test/test_to_chars_unsigned_long_sycl.cpp b/test/test_to_chars_unsigned_long_sycl.cpp new file mode 100644 index 00000000..21ac7220 --- /dev/null +++ b/test/test_to_chars_unsigned_long_sycl.cpp @@ -0,0 +1,10 @@ +// Copyright 2026 Matt Borland +// Distributed under the Boost Software License, Version 1.0. +// https://www.boost.org/LICENSE_1_0.txt + +#include "sycl_charconv_test.hpp" + +int main() +{ + return charconv_sycl_test::test_to_chars(); +} diff --git a/test/test_to_chars_unsigned_short_sycl.cpp b/test/test_to_chars_unsigned_short_sycl.cpp new file mode 100644 index 00000000..bee7ac3d --- /dev/null +++ b/test/test_to_chars_unsigned_short_sycl.cpp @@ -0,0 +1,10 @@ +// Copyright 2026 Matt Borland +// Distributed under the Boost Software License, Version 1.0. +// https://www.boost.org/LICENSE_1_0.txt + +#include "sycl_charconv_test.hpp" + +int main() +{ + return charconv_sycl_test::test_to_chars(); +} From 3ca1338c3a198afabbe3e27c4ba7bcb4561157cf Mon Sep 17 00:00:00 2001 From: Matt Borland Date: Thu, 9 Jul 2026 09:34:15 -0400 Subject: [PATCH 5/9] Add SYCL jamfile matching the CUDA version --- test/sycl_jamfile | 61 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 test/sycl_jamfile diff --git a/test/sycl_jamfile b/test/sycl_jamfile new file mode 100644 index 00000000..0adaa46a --- /dev/null +++ b/test/sycl_jamfile @@ -0,0 +1,61 @@ +# Copyright 2026 Matt Borland +# Distributed under the Boost Software License, Version 1.0. +# https://www.boost.org/LICENSE_1_0.txt + +import testing ; +import ../../config/checks/config : requires ; + +project : requirements + [ requires cxx14_decltype_auto cxx14_generic_lambdas cxx14_return_type_deduction cxx14_variable_templates cxx14_constexpr ] + ; + +run test_to_chars_char_sycl.cpp ; +run test_to_chars_signed_char_sycl.cpp ; +run test_to_chars_unsigned_char_sycl.cpp ; +run test_to_chars_short_sycl.cpp ; +run test_to_chars_unsigned_short_sycl.cpp ; +run test_to_chars_int_sycl.cpp ; +run test_to_chars_unsigned_int_sycl.cpp ; +run test_to_chars_long_sycl.cpp ; +run test_to_chars_unsigned_long_sycl.cpp ; +run test_to_chars_long_long_sycl.cpp ; +run test_to_chars_unsigned_long_long_sycl.cpp ; + +run test_to_chars_bases_char_sycl.cpp ; +run test_to_chars_bases_signed_char_sycl.cpp ; +run test_to_chars_bases_unsigned_char_sycl.cpp ; +run test_to_chars_bases_short_sycl.cpp ; +run test_to_chars_bases_unsigned_short_sycl.cpp ; +run test_to_chars_bases_int_sycl.cpp ; +run test_to_chars_bases_unsigned_int_sycl.cpp ; +run test_to_chars_bases_long_sycl.cpp ; +run test_to_chars_bases_unsigned_long_sycl.cpp ; +run test_to_chars_bases_long_long_sycl.cpp ; +run test_to_chars_bases_unsigned_long_long_sycl.cpp ; + +run test_from_chars_char_sycl.cpp ; +run test_from_chars_signed_char_sycl.cpp ; +run test_from_chars_unsigned_char_sycl.cpp ; +run test_from_chars_short_sycl.cpp ; +run test_from_chars_unsigned_short_sycl.cpp ; +run test_from_chars_int_sycl.cpp ; +run test_from_chars_unsigned_int_sycl.cpp ; +run test_from_chars_long_sycl.cpp ; +run test_from_chars_unsigned_long_sycl.cpp ; +run test_from_chars_long_long_sycl.cpp ; +run test_from_chars_unsigned_long_long_sycl.cpp ; + +run test_from_chars_bases_char_sycl.cpp ; +run test_from_chars_bases_signed_char_sycl.cpp ; +run test_from_chars_bases_unsigned_char_sycl.cpp ; +run test_from_chars_bases_short_sycl.cpp ; +run test_from_chars_bases_unsigned_short_sycl.cpp ; +run test_from_chars_bases_int_sycl.cpp ; +run test_from_chars_bases_unsigned_int_sycl.cpp ; +run test_from_chars_bases_long_sycl.cpp ; +run test_from_chars_bases_unsigned_long_sycl.cpp ; +run test_from_chars_bases_long_long_sycl.cpp ; +run test_from_chars_bases_unsigned_long_long_sycl.cpp ; + +run test_num_digits_uint32_sycl.cpp ; +run test_num_digits_uint64_sycl.cpp ; From f51df671b78676a630e395da362509ed0e7d25df Mon Sep 17 00:00:00 2001 From: Matt Borland Date: Thu, 9 Jul 2026 09:34:27 -0400 Subject: [PATCH 6/9] Add SYCL testing path to CML --- test/CMakeLists.txt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 1bd497dd..4ce0496d 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -18,6 +18,15 @@ if(HAVE_BOOST_TEST) boost_test_jamfile(FILE cuda_jamfile LINK_LIBRARIES Boost::charconv Boost::core Boost::assert ${CUDA_LIBRARIES} COMPILE_DEFINITIONS BOOST_CHARCONV_ENABLE_CUDA=1 INCLUDE_DIRECTORIES ${CUDA_INCLUDE_DIRS} ) + elseif(BOOST_CHARCONV_ENABLE_SYCL) + + message(STATUS "Building Boost.charconv with SYCL") + + set(CMAKE_CXX_COMPILER "icpx") + set(CMAKE_C_COMPILER "icx") + + boost_test_jamfile(FILE sycl_jamfile LINK_LIBRARIES Boost::charconv Boost::core Boost::assert sycl COMPILE_DEFINITIONS BOOST_CHARCONV_ENABLE_SYCL=1 COMPILE_OPTIONS -fsycl ) + else() # https://crascit.com/2015/03/28/enabling-cxx11-in-cmake/ From 10225f628b3131fd689f730f38b5a90bfce5e723 Mon Sep 17 00:00:00 2001 From: Matt Borland Date: Thu, 9 Jul 2026 09:34:40 -0400 Subject: [PATCH 7/9] Add SYCL CI run mirroring boost.math --- .github/workflows/ci.yml | 63 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a9f88a23..bac17118 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -740,3 +740,66 @@ jobs: # run: | # cd ../boost-root/__build__ # ctest --output-on-failure --no-tests=error + + sycl-cmake-test: + strategy: + fail-fast: false + + runs-on: ubuntu-latest + + steps: + - name: Intel Apt repository + timeout-minutes: 1 + run: | + wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB + sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB + rm GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB + echo "deb https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list + sudo apt-get update + - name: Install Intel oneAPI compilers + timeout-minutes: 5 + run: sudo apt-get install -y intel-oneapi-compiler-fortran intel-oneapi-compiler-dpcpp-cpp + + - name: Setup Intel oneAPI environment + run: | + source /opt/intel/oneapi/setvars.sh + printenv >> $GITHUB_ENV + + - uses: actions/checkout@v6 + + - name: Install Packages + run: | + sudo apt-get install -y cmake make + - name: Setup Boost + run: | + echo GITHUB_REPOSITORY: $GITHUB_REPOSITORY + LIBRARY=${GITHUB_REPOSITORY#*/} + echo LIBRARY: $LIBRARY + echo "LIBRARY=$LIBRARY" >> $GITHUB_ENV + echo GITHUB_BASE_REF: $GITHUB_BASE_REF + echo GITHUB_REF: $GITHUB_REF + REF=${GITHUB_BASE_REF:-$GITHUB_REF} + REF=${REF#refs/heads/} + echo REF: $REF + BOOST_BRANCH=develop && [ "$REF" == "master" ] && BOOST_BRANCH=master || true + echo BOOST_BRANCH: $BOOST_BRANCH + cd .. + git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root + cd boost-root + mkdir -p libs/$LIBRARY + cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY + git submodule update --init tools/boostdep + python3 tools/boostdep/depinst/depinst.py --git_args "--jobs 3" $LIBRARY + - name: Configure + run: | + cd ../boost-root + mkdir __build__ && cd __build__ + cmake -DBOOST_INCLUDE_LIBRARIES=$LIBRARY -DBUILD_TESTING=ON -DBOOST_CHARCONV_ENABLE_SYCL=ON -DCMAKE_CXX_COMPILER=icpx -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_STANDARD=17 .. + - name: Build tests + run: | + cd ../boost-root/__build__ + cmake --build . --target tests -j $(nproc) + - name: Run tests + run: | + cd ../boost-root/__build__ + ctest --output-on-failure --no-tests=error From 94ec741e41d6a0586327174017d65662e37fcd1b Mon Sep 17 00:00:00 2001 From: Matt Borland Date: Thu, 9 Jul 2026 09:34:51 -0400 Subject: [PATCH 8/9] Add SYCL documentation --- doc/charconv/api_reference.adoc | 1 + doc/charconv/build.adoc | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/doc/charconv/api_reference.adoc b/doc/charconv/api_reference.adoc index dfae7987..1a8f27ed 100644 --- a/doc/charconv/api_reference.adoc +++ b/doc/charconv/api_reference.adoc @@ -31,6 +31,7 @@ https://www.boost.org/LICENSE_1_0.txt == Macros - <> +- <> - <> - <> - <> diff --git a/doc/charconv/build.adoc b/doc/charconv/build.adoc index d9de8986..7c68176c 100644 --- a/doc/charconv/build.adoc +++ b/doc/charconv/build.adoc @@ -42,6 +42,14 @@ IMPORTANT: libquadmath is only available on supported platforms (e.g. Linux with This library has partial support for CUDA which can be enabled during compilation with `BOOST_CHARCONV_ENABLE_CUDA`. Functions with `BOOST_CHARCONV_HOST_DEVICE` in their signature can be run on both host and device, all others are strictly run on host. +[#enable_sycl_] +== SYCL Support + +This library also has partial support for SYCL, which can be enabled during compilation with `BOOST_CHARCONV_ENABLE_SYCL`. +Unlike CUDA it is fully opt-in: define the macro and include `` before any Boost.Charconv header so that `SYCL_EXTERNAL` is available. +The same functions carrying `BOOST_CHARCONV_HOST_DEVICE` can then be run on both host and device. +On the SYCL device the builtin 128-bit integer type is not used (the spir64 target has none), so the emulated 128-bit implementation is used instead. + == Dependencies This library depends on: Boost.Assert, Boost.Config, Boost.Core, and optionally libquadmath (see above). From efa3268745fc76aa1b82e41a5c765cfccac46e2f Mon Sep 17 00:00:00 2001 From: Matt Borland Date: Thu, 9 Jul 2026 10:06:12 -0400 Subject: [PATCH 9/9] Fix linking causing segfault --- test/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 4ce0496d..5fdb0ea3 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -25,6 +25,10 @@ if(HAVE_BOOST_TEST) set(CMAKE_CXX_COMPILER "icpx") set(CMAKE_C_COMPILER "icx") + # -fsycl must be on the link line too (it bundles the device image); COMPILE_OPTIONS + # only reaches the compile step, so add it to the linker flags as well. + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsycl") + boost_test_jamfile(FILE sycl_jamfile LINK_LIBRARIES Boost::charconv Boost::core Boost::assert sycl COMPILE_DEFINITIONS BOOST_CHARCONV_ENABLE_SYCL=1 COMPILE_OPTIONS -fsycl ) else()