Skip to content

Commit

Permalink
Don't use too many iostream
Browse files Browse the repository at this point in the history
  • Loading branch information
jfalcou committed Nov 29, 2024
1 parent c9e7684 commit 17b2a8a
Show file tree
Hide file tree
Showing 20 changed files with 826 additions and 543 deletions.
2 changes: 1 addition & 1 deletion cmake/compiler.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
##======================================================================================================================
add_library(spy_tests INTERFACE)

target_compile_features ( spy_tests INTERFACE cxx_std_17 )
target_compile_features ( spy_tests INTERFACE cxx_std_20 )

if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
if(CMAKE_CXX_COMPILER_FRONTEND_VARIANT STREQUAL "MSVC")
Expand Down
2 changes: 1 addition & 1 deletion doc/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<script type="text/javascript">
DoxygenAwesomeParagraphLink.init()
DoxygenAwesomeFragmentCopyButton.init()
SendToGodbolt.init("spy","clang1600","-O3 -std=c++17 -DNEDBUG")
SendToGodbolt.init("spy","clang1600","-O3 -std=c++20 -DNEDBUG")
</script>
$treeview
$search
Expand Down
2 changes: 1 addition & 1 deletion doc/index.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
//! [Boost.Predef](https://www.boost.org/doc/libs/release/doc/html/predef.html) provides a sanitized
//! interface on top of those but still live in a world where the preprocessor is king.
//!
//! SPY is a C++17 (and onward) library that gathers similar information and provides a `constexpr`
//! SPY is a C++20 (and onward) library that gathers similar information and provides a `constexpr`
//! compatible interface to access those information, thus making their exploitation within `constexpr`
//! context possible.
//!
Expand Down
268 changes: 268 additions & 0 deletions doc/spy.tag
Original file line number Diff line number Diff line change
@@ -0,0 +1,268 @@
<?xml version='1.0' encoding='UTF-8' standalone='yes' ?>
<tagfile doxygen_version="1.9.8" doxygen_gitid="c2fe5c3e4986974eb2a97608b24086683502f07f">
<compound kind="namespace">
<name>literal</name>
<filename>namespaceliteral.html</filename>
</compound>
<compound kind="namespace">
<name>spy</name>
<filename>namespacespy.html</filename>
<member kind="variable">
<type>constexpr arch_type</type>
<name>architecture</name>
<anchorfile>group__api_gaad5f2aa34188a02b894a0d8c7e402d6e.html</anchorfile>
<anchor>gaad5f2aa34188a02b894a0d8c7e402d6e</anchor>
<arglist></arglist>
</member>
<member kind="variable">
<type>constexpr compiler_type</type>
<name>compiler</name>
<anchorfile>group__api_ga2d96c18fea5b9a06ac37487ab570599d.html</anchorfile>
<anchor>ga2d96c18fea5b9a06ac37487ab570599d</anchor>
<arglist></arglist>
</member>
<member kind="variable">
<type>constexpr auto</type>
<name>data_model</name>
<anchorfile>group__api_gaa091fe192a7f9d0d164cf7546083200d.html</anchorfile>
<anchor>gaa091fe192a7f9d0d164cf7546083200d</anchor>
<arglist></arglist>
</member>
<member kind="variable">
<type>constexpr auto</type>
<name>libc</name>
<anchorfile>group__api_ga03dc3f2a9b02b025902f9df3b2db53ab.html</anchorfile>
<anchor>ga03dc3f2a9b02b025902f9df3b2db53ab</anchor>
<arglist></arglist>
</member>
<member kind="variable">
<type>constexpr os_type</type>
<name>operating_system</name>
<anchorfile>group__api_gadb7c5be967e00cff21ae5b98cc12a7dc.html</anchorfile>
<anchor>gadb7c5be967e00cff21ae5b98cc12a7dc</anchor>
<arglist></arglist>
</member>
<member kind="variable">
<type>constexpr auto</type>
<name>simd_instruction_set</name>
<anchorfile>group__api_ga45f64b82d4939d55865b0e6a311b2dde.html</anchorfile>
<anchor>ga45f64b82d4939d55865b0e6a311b2dde</anchor>
<arglist></arglist>
</member>
<member kind="variable">
<type>constexpr auto</type>
<name>stdlib</name>
<anchorfile>group__api_gafe99b815db524eacf659ba8348ca2e0d.html</anchorfile>
<anchor>gafe99b815db524eacf659ba8348ca2e0d</anchor>
<arglist></arglist>
</member>
</compound>
<compound kind="namespace">
<name>supports</name>
<filename>namespacesupports.html</filename>
</compound>
<compound kind="group">
<name>api</name>
<title>Main API</title>
<filename>group__api.html</filename>
<member kind="variable">
<type>constexpr bool</type>
<name>spy::supports::address_sanitizers_status</name>
<anchorfile>group__api_ga37e2c07363dadf1eb40e89a9a91f8121.html</anchorfile>
<anchor>ga37e2c07363dadf1eb40e89a9a91f8121</anchor>
<arglist></arglist>
</member>
<member kind="variable">
<type>constexpr arch_type</type>
<name>spy::architecture</name>
<anchorfile>group__api_gaad5f2aa34188a02b894a0d8c7e402d6e.html</anchorfile>
<anchor>gaad5f2aa34188a02b894a0d8c7e402d6e</anchor>
<arglist></arglist>
</member>
<member kind="variable">
<type>constexpr compiler_type</type>
<name>spy::compiler</name>
<anchorfile>group__api_ga2d96c18fea5b9a06ac37487ab570599d.html</anchorfile>
<anchor>ga2d96c18fea5b9a06ac37487ab570599d</anchor>
<arglist></arglist>
</member>
<member kind="variable">
<type>constexpr auto</type>
<name>spy::supports::cuda</name>
<anchorfile>group__api_gaad706954aedb6aaf6ff1a9858a971e00.html</anchorfile>
<anchor>gaad706954aedb6aaf6ff1a9858a971e00</anchor>
<arglist></arglist>
</member>
<member kind="variable">
<type>constexpr auto</type>
<name>spy::data_model</name>
<anchorfile>group__api_gaa091fe192a7f9d0d164cf7546083200d.html</anchorfile>
<anchor>gaa091fe192a7f9d0d164cf7546083200d</anchor>
<arglist></arglist>
</member>
<member kind="variable">
<type>constexpr auto</type>
<name>spy::libc</name>
<anchorfile>group__api_ga03dc3f2a9b02b025902f9df3b2db53ab.html</anchorfile>
<anchor>ga03dc3f2a9b02b025902f9df3b2db53ab</anchor>
<arglist></arglist>
</member>
<member kind="variable">
<type>constexpr os_type</type>
<name>spy::operating_system</name>
<anchorfile>group__api_gadb7c5be967e00cff21ae5b98cc12a7dc.html</anchorfile>
<anchor>gadb7c5be967e00cff21ae5b98cc12a7dc</anchor>
<arglist></arglist>
</member>
<member kind="variable">
<type>constexpr auto</type>
<name>spy::supports::posix_</name>
<anchorfile>group__api_ga63eef44bc05ea6f77f278ba5b394ada8.html</anchorfile>
<anchor>ga63eef44bc05ea6f77f278ba5b394ada8</anchor>
<arglist></arglist>
</member>
<member kind="variable">
<type>constexpr bool</type>
<name>spy::supports::sanitizers_status</name>
<anchorfile>group__api_ga28313e4f9673ea0f5d0ca44ffd1a967a.html</anchorfile>
<anchor>ga28313e4f9673ea0f5d0ca44ffd1a967a</anchor>
<arglist></arglist>
</member>
<member kind="variable">
<type>constexpr auto</type>
<name>spy::simd_instruction_set</name>
<anchorfile>group__api_ga45f64b82d4939d55865b0e6a311b2dde.html</anchorfile>
<anchor>ga45f64b82d4939d55865b0e6a311b2dde</anchor>
<arglist></arglist>
</member>
<member kind="variable">
<type>constexpr auto</type>
<name>spy::stdlib</name>
<anchorfile>group__api_gafe99b815db524eacf659ba8348ca2e0d.html</anchorfile>
<anchor>gafe99b815db524eacf659ba8348ca2e0d</anchor>
<arglist></arglist>
</member>
<member kind="variable">
<type>constexpr auto</type>
<name>spy::supports::sycl</name>
<anchorfile>group__api_ga03e4a3ae6533a43cdf9bcbf1317707cd.html</anchorfile>
<anchor>ga03e4a3ae6533a43cdf9bcbf1317707cd</anchor>
<arglist></arglist>
</member>
<member kind="variable">
<type>constexpr bool</type>
<name>spy::supports::thread_sanitizers_status</name>
<anchorfile>group__api_ga16591d3ea9aaa049682bfbedd519dc43.html</anchorfile>
<anchor>ga16591d3ea9aaa049682bfbedd519dc43</anchor>
<arglist></arglist>
</member>
<member kind="function">
<type>constexpr auto</type>
<name>spy::literal::operator&quot;&quot;_clang</name>
<anchorfile>group__api.html</anchorfile>
<anchor>gab3e0f11a5ec1b2963564755b84630970</anchor>
<arglist>()</arglist>
</member>
<member kind="function">
<type>constexpr auto</type>
<name>spy::literal::operator&quot;&quot;_cloud</name>
<anchorfile>group__api.html</anchorfile>
<anchor>ga1dc236e3cae2ef3c7ec23d45659b7b30</anchor>
<arglist>()</arglist>
</member>
<member kind="function">
<type>constexpr auto</type>
<name>spy::literal::operator&quot;&quot;_dpcpp</name>
<anchorfile>group__api.html</anchorfile>
<anchor>gab38166c11c2a99b2257e00630db206ec</anchor>
<arglist>()</arglist>
</member>
<member kind="function">
<type>constexpr auto</type>
<name>spy::literal::operator&quot;&quot;_em</name>
<anchorfile>group__api.html</anchorfile>
<anchor>ga8b0155c33f6f54c0d1d2dd498417c536</anchor>
<arglist>()</arglist>
</member>
<member kind="function">
<type>constexpr auto</type>
<name>spy::literal::operator&quot;&quot;_gcc</name>
<anchorfile>group__api.html</anchorfile>
<anchor>ga542b6a98ac5e95f906da14325a2064be</anchor>
<arglist>()</arglist>
</member>
<member kind="function">
<type>constexpr auto</type>
<name>spy::literal::operator&quot;&quot;_gnu</name>
<anchorfile>group__api.html</anchorfile>
<anchor>ga01fac6d9d1025344d16c3ab4fee137c8</anchor>
<arglist>()</arglist>
</member>
<member kind="function">
<type>constexpr auto</type>
<name>spy::literal::operator&quot;&quot;_intel</name>
<anchorfile>group__api.html</anchorfile>
<anchor>ga17b7828b022e763e749aebf056d24195</anchor>
<arglist>()</arglist>
</member>
<member kind="function">
<type>constexpr auto</type>
<name>spy::literal::operator&quot;&quot;_msvc</name>
<anchorfile>group__api.html</anchorfile>
<anchor>gaafdbca6599d9792e579da8041b5addcd</anchor>
<arglist>()</arglist>
</member>
<member kind="function">
<type>constexpr auto</type>
<name>spy::literal::operator&quot;&quot;_nvcc</name>
<anchorfile>group__api.html</anchorfile>
<anchor>ga39f9d138ef1adb4b5c12f4279878f1fc</anchor>
<arglist>()</arglist>
</member>
<member kind="function">
<type>constexpr auto</type>
<name>spy::literal::operator&quot;&quot;_uc</name>
<anchorfile>group__api.html</anchorfile>
<anchor>ga0c3666ca0bb5f551cc0103e355a28569</anchor>
<arglist>()</arglist>
</member>
<member kind="function">
<type>constexpr auto</type>
<name>spy::literal::operator&quot;&quot;_vms</name>
<anchorfile>group__api.html</anchorfile>
<anchor>ga772746f665f6dd13b9a6c8bd19564dab</anchor>
<arglist>()</arglist>
</member>
<member kind="function">
<type>constexpr auto</type>
<name>spy::literal::operator&quot;&quot;_zos</name>
<anchorfile>group__api.html</anchorfile>
<anchor>ga3c0e24636d16a543f4bf2ed64875eaeb</anchor>
<arglist>()</arglist>
</member>
</compound>
<compound kind="page">
<name>changelog</name>
<title>Change Log</title>
<filename>changelog.html</filename>
</compound>
<compound kind="page">
<name>licence</name>
<title>Licence</title>
<filename>licence.html</filename>
</compound>
<compound kind="page">
<name>setup</name>
<title>Setup</title>
<filename>setup.html</filename>
<docanchor file="setup.html" title="Install from the source">setup-source</docanchor>
<docanchor file="setup.html" title="Standalone setup">setup-standalone</docanchor>
<docanchor file="setup.html" title="CMake FetchContent">setup-fetchcontent</docanchor>
<docanchor file="setup.html" title="Setup with CPM">setup-cpm</docanchor>
</compound>
<compound kind="page">
<name>index</name>
<title>The C++ Information Broker</title>
<filename>index.html</filename>
</compound>
</tagfile>
7 changes: 4 additions & 3 deletions include/spy/accelerator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
*/
//==================================================================================================
#pragma once
#include <ostream>

namespace spy::supports
{
template<int M, int N, int P> struct sycl_t
{
explicit constexpr operator bool() const noexcept { return M>0 && N>0; }

friend std::ostream& operator<<(std::ostream& os, sycl_t)
template<_::stream OS>
friend OS& operator<<(OS& os, sycl_t)
{
os << "SYCL v" << M << '.' << N;
if(P>0) os << '.' << P;
Expand All @@ -38,7 +38,8 @@ namespace spy::supports
{
explicit constexpr operator bool() const noexcept { return M>0 && N>0; }

friend std::ostream& operator<<(std::ostream& os, cuda_t)
template<_::stream OS>
friend OS& operator<<(OS& os, cuda_t)
{
os << "NVCC CUDA v" << M << '.' << N;
if(P>0) os << '.' << P;
Expand Down
Loading

0 comments on commit 17b2a8a

Please sign in to comment.