4#ifndef GREM_CORE_PROFILING_HPP
5#define GREM_CORE_PROFILING_HPP
11#ifdef GREM_USE_PROFILING
36#include <source_location>
39#ifdef GREM_USE_MULTITHREADING
83 : bits(static_cast<uint8_t>(format)) {}
99 [[nodiscard]]
constexpr bool empty() const noexcept {
123 return (bits & formats.bits) != 0;
135 return (bits & formats.bits) == formats.bits;
257#ifdef GREM_USE_PROFILING
263class StaticOrDynamicString {
266 [[nodiscard]]
static constexpr StaticOrDynamicString createStatic(
const char (&
string)[N])
noexcept {
267 StaticOrDynamicString result{};
272 [[nodiscard]]
static constexpr StaticOrDynamicString createStaticFromStringView(StringView
string)
noexcept {
273 StaticOrDynamicString result{};
278 [[nodiscard]]
static constexpr StaticOrDynamicString createDynamic(StringView
string) {
279 StaticOrDynamicString result{};
280 if (
string.size() <= SMALL_STRING_LENGTH) {
281 result.string.emplace<InplaceArrayList<char, SMALL_STRING_LENGTH>>(
string.begin(),
string.end());
283 result.string.emplace<
String>(string);
288 constexpr StaticOrDynamicString() noexcept = default;
290 constexpr operator StringView() const noexcept {
295 GREM_CASE(
const InplaceArrayList<char, SMALL_STRING_LENGTH>& smallString) {
296 return StringView{smallString.data(), smallString.size()};
306 static constexpr size_t SMALL_STRING_LENGTH = 256;
308 Variant<StringView, InplaceArrayList<char, SMALL_STRING_LENGTH>,
String>
string{};
311struct ProfilerBlock {
312 StaticOrDynamicString
string{};
313 StaticOrDynamicString shortString{};
319class ProfilerThread {
322 UniqueLock<Mutex> captureLock{};
323#ifdef GREM_USE_MULTITHREADING
326 size_t threadIndex = 0;
327 ThreadID parentThreadID{};
329 Span<const ProfilerBlock> blocks{};
332 [[nodiscard]]
static ProfilerThread& getInstance();
334 size_t blockLevel = 0;
336#ifdef GREM_USE_MULTITHREADING
337 void setThreadInfo(String newThreadName,
size_t newThreadIndex, ThreadID newParentThreadID) {
339 if (!newThreadName.empty()) {
340 if (pthread_setname_np(pthread_self(), newThreadName.c_str()) == ERANGE) {
341 pthread_setname_np(pthread_self(), newThreadName.substr(0, 15).c_str());
345 const ScopedLock
lock{mutex};
346 threadID = ThreadID::getCurrent();
347 threadName = std::move(newThreadName);
348 threadIndex = newThreadIndex;
349 parentThreadID = newParentThreadID;
353 void submitBlock(ProfilerBlock block) {
354 const ScopedLock
lock{mutex};
355 blocks.push_back(std::move(block));
358 void clearCapture() {
359 const ScopedLock
lock{mutex};
363 [[nodiscard]] CaptureLock lockCapture() {
364 UniqueLock
lock{mutex};
365#ifdef GREM_USE_MULTITHREADING
367 .captureLock = std::move(lock),
368 .threadID = threadID,
369 .threadName = threadName,
370 .threadIndex = threadIndex,
371 .parentThreadID = parentThreadID,
376 .captureLock = std::move(lock),
383 ArrayList<ProfilerBlock> blocks{};
385#ifdef GREM_USE_MULTITHREADING
388 std::size_t threadIndex = 0;
389 ThreadID parentThreadID{};
395 [[nodiscard]]
static Profiler& getInstance() {
396 static Profiler instance{};
401 const ScopedLock
lock{mutex};
402 if (framesToSaveCount == 0) {
403#ifdef GREM_USE_MULTITHREADING
404 for (
const UniquePointer<ProfilerThread>& profilerThread : profilerThreads) {
406 profilerThread->clearCapture();
409 profilerThread.clearCapture();
413 if (frameInProgress) {
414 frameStartTimes.push_back(Clock::now());
416 frameInProgress =
true;
417 captureStartTime = UTCTimestamp::now();
418 frameStartTimes = {Clock::now()};
419 frameEndTimes.clear();
424 const ScopedLock
lock{mutex};
425 if (framesToSaveCount > 0) {
426 frameEndTimes.push_back(Clock::now());
427 if (--framesToSaveCount == 0 && frameInProgress) {
428 GREM_ASSERT(!nextFrameOutputFilepathPrefix.empty());
431#ifdef GREM_USE_MULTITHREADING
432 ArrayList<ProfilerThread::CaptureLock> captures{};
433 for (
const UniquePointer<ProfilerThread>& profilerThread : profilerThreads) {
435 captures.push_back(profilerThread->lockCapture());
438 stableSortByAscending<&ProfilerThread::CaptureLock::threadIndex>(captures);
440 HashMap<ThreadID, Buffer<size_t>> children{};
442 Buffer<size_t> traversalStack{};
443 BitBuffer traversed(profilerThreads.size(),
false);
445 for (
size_t i = profilerThreads.size(); i-- > 0;) {
446 ProfilerThread::CaptureLock& capture = captures[i];
447 capture.threadIndex = 0;
448 if (capture.parentThreadID) {
449 children[capture.parentThreadID].push_back(i);
451 traversalStack.push_back(i);
455 size_t newThreadIndex = 0;
456 while (!traversalStack.empty()) {
457 const size_t captureIndex = traversalStack.back();
458 traversalStack.pop_back();
460 ProfilerThread::CaptureLock& capture = captures[captureIndex];
461 capture.threadIndex = newThreadIndex++;
463 if (
const auto it = children.find(capture.threadID); it != children.end()) {
464 for (
const size_t childIndex : it->second) {
465 if (BitBuffer::reference visited = traversed[childIndex]; !visited) {
467 traversalStack.push_back(childIndex);
473 stableSortByAscending<&ProfilerThread::CaptureLock::threadIndex>(captures);
475 const Array captures{profilerThread.lockCapture()};
478 NativeFilesystem filesystem{};
479 if (nextFrameOutputFormats.contains(ProfileFormat::BINARY)) {
480 saveAsBinary(filesystem, captures);
482 if (nextFrameOutputFormats.contains(ProfileFormat::JSON)) {
483 saveAsJSON(filesystem, captures);
485 if (nextFrameOutputFormats.contains(ProfileFormat::TRACE_EVENT_FORMAT)) {
486 saveAsTraceEventFormat(filesystem, captures);
490#ifdef GREM_USE_MULTITHREADING
491 for (
const UniquePointer<ProfilerThread>& profilerThread : profilerThreads) {
493 profilerThread->clearCapture();
496 profilerThread.clearCapture();
499 frameInProgress =
false;
502 frameInProgress =
false;
506 void saveFrames(
size_t frameCount, String outputFilepathPrefix, ProfileFormats outputFormats) {
508 const ScopedLock
lock{mutex};
509 nextFrameOutputFilepathPrefix = std::move(outputFilepathPrefix);
510 nextFrameOutputFormats = outputFormats;
511 framesToSaveCount = frameCount;
515 friend ProfilerThread;
517 Profiler() =
default;
519 void saveAsBinary(NativeFilesystem& filesystem, Span<const ProfilerThread::CaptureLock> captures)
const {
520 OutputFileHandle file = filesystem.openEmptyOutputFile(nextFrameOutputFilepathPrefix + captureStartTime.toISO8601({.timeSeparator =
'.'}) +
".bin");
522 static constexpr Array<char, 6> FORMAT_IDENTIFIER{
'\x67',
'\0',
'\x69',
'\xDD',
'P',
'F'};
523 static constexpr Pair<uint8_t> CURRENT_FORMAT_VERSION{uint8_t{0}, uint8_t{0}};
526 Array<char, FORMAT_IDENTIFIER.
size()> formatIdentifier;
527 uint8_t formatBackwardsCompatibilityBreakingVersion;
528 uint8_t formatExtensionVersion;
529 uint16_t timestampUTCYear;
530 uint8_t timestampUTCMonth;
531 uint8_t timestampUTCDay;
532 uint8_t timestampUTCHour;
533 uint8_t timestampUTCMinute;
534 uint8_t timestampUTCSecond;
535 uint8_t reserved0 = 0;
536 uint64_t reserved1 = 0;
537 uint64_t startTimeNanoseconds;
538 uint64_t endTimeNanoseconds;
539 Array<uint64_t, 2> reserved2{};
540 uint32_t threadCount;
541 Array<uint32_t, 5> reserved3{};
542 uint64_t threadDataOffset;
543 Array<uint64_t, 5> reserved4{};
547 .formatIdentifier = FORMAT_IDENTIFIER,
557 .endTimeNanoseconds =
convertHostEndianToLittleEndian(
static_cast<uint64_t
>(duration_cast<Nanoseconds>(frameEndTimes.back() - frameStartTimes.front()).count())),
561 file.write(
asBytes(Span{&header, 1}));
563 size_t byteOffset =
sizeof(Header);
564 static_assert(
sizeof(Header) %
alignof(uint64_t) == 0);
566 const Array<byte,
alignof(uint64_t) - 1> padding{};
568 for (
const ProfilerThread::CaptureLock& capture : captures) {
569#ifdef GREM_USE_MULTITHREADING
570 const StringView threadName = capture.threadName;
580 file.write(
asBytes(Span{&threadIndex, 1}));
581 file.write(
asBytes(Span{&blockCount, 1}));
582 file.write(
asBytes(Span{&threadNameLength, 1}));
583 file.write(
asBytes(Span{threadName}));
585 byteOffset +=
sizeof(uint32_t) * 3 + threadName.size();
586 const size_t captureHeaderEnd = byteOffset;
588 const size_t captureHeaderAlignmentBytes = byteOffset - captureHeaderEnd;
589 file.write(Span{padding}.first(captureHeaderAlignmentBytes));
591 for (
const ProfilerBlock& block : capture.blocks) {
593 const StringView shortString{block.shortString};
594 const uint64_t startTimeNanoseconds =
596 const uint64_t endTimeNanoseconds =
601 file.write(
asBytes(Span{&startTimeNanoseconds, 1}));
602 file.write(
asBytes(Span{&endTimeNanoseconds, 1}));
603 file.write(
asBytes(Span{&level, 1}));
604 file.write(
asBytes(Span{&stringLength, 1}));
605 file.write(
asBytes(Span{&shortStringLength, 1}));
606 file.write(
asBytes(Span{
string}));
607 file.write(
asBytes(Span{shortString}));
609 byteOffset +=
sizeof(uint64_t) * 2 +
sizeof(uint32_t) * 3 +
string.size() + shortString.size();
610 const size_t blockEnd = byteOffset;
612 const size_t blockAlignmentBytes = byteOffset - blockEnd;
613 file.write(Span{padding}.first(blockAlignmentBytes));
618 void saveAsJSON(NativeFilesystem& filesystem, Span<const ProfilerThread::CaptureLock> captures)
const {
620 for (
const ProfilerThread::CaptureLock& capture : captures) {
622 for (
const ProfilerBlock& block : capture.blocks) {
625 {
"shortString",
StringView{block.shortString}},
626 {
"level", block.level},
627 {
"startTimeNanoseconds", duration_cast<Nanoseconds>(block.startTime - frameStartTimes.front()).count()},
628 {
"endTimeNanoseconds", duration_cast<Nanoseconds>(block.endTime - frameStartTimes.front()).count()},
633#ifdef GREM_USE_MULTITHREADING
634 {
"threadName", capture.threadName},
635 {
"threadIndex", capture.threadIndex + 1},
637 {
"threadName",
"Main thread"},
640 {
"blocks", std::move(jsonBlocks)},
644 OutputFileHandle file = filesystem.openEmptyOutputFile(nextFrameOutputFilepathPrefix + captureStartTime.toISO8601({.timeSeparator =
'.'}) +
".json");
645 *
static_cast<NativeOutputFile*
>(file.get())
647 {
"timestamp", captureStartTime.toISO8601()},
648 {
"startTimeNanoseconds", 0},
649 {
"endTimeNanoseconds", duration_cast<Nanoseconds>(frameEndTimes.back() - frameStartTimes.front()).count()},
650 {
"threads", std::move(jsonThreads)},
655 void saveAsTraceEventFormat(Filesystem& filesystem, Span<const ProfilerThread::CaptureLock> captures)
const {
666 Buffer<Event> events{};
668 for (
const ProfilerThread::CaptureLock& capture : captures) {
669#ifdef GREM_USE_MULTITHREADING
670 if (!capture.threadName.empty()) {
672 {
"name",
"thread_name"},
681 {
"name",
"thread_sort_index"},
689 for (
const ProfilerBlock& block : capture.blocks) {
690 events.push_back(Event{.string = block.string, .shortString = block.shortString, .phase =
'B', .threadID = threadID, .timestamp = block.startTime});
691 events.push_back(Event{.string = block.string, .shortString = block.shortString, .phase =
'E', .threadID = threadID, .timestamp = block.endTime});
695 for (
const TimePoint startTime : frameStartTimes) {
696 events.push_back(Event{.string =
"Frame Start", .shortString{}, .phase =
'i', .threadID = 1, .timestamp = startTime});
698 for (
const TimePoint endTime : frameEndTimes) {
699 events.push_back(Event{.string =
"Frame End", .shortString{}, .phase =
'i', .threadID = 1, .timestamp = endTime});
702 stableSortByAscending<&Event::timestamp>(events);
704 for (
const Event& event : events) {
706 {
"name", (
event.shortString.empty()) ?
event.string :
event.shortString},
708 {
"ph",
String{
event.phase}},
709 {
"ts", duration_cast<
DurationBase<double,
Ratio<1, 1'000'000>>>(
event.timestamp - frameStartTimes.front()).count()},
711 {
"tid",
event.threadID},
713 if (!event.shortString.empty()) {
714 jsonEvent[
"args"] =
json::Object{{
"fullName",
event.string}};
716 if (event.phase ==
'i') {
717 jsonEvent[
"s"] =
"p";
722 OutputFileHandle file = filesystem.openEmptyOutputFile(nextFrameOutputFilepathPrefix + captureStartTime.toISO8601({.timeSeparator =
'.'}) +
"_trace_event_format.json");
723 *
static_cast<NativeOutputFile*
>(file.get()) <<
json::Object{{
"traceEvents", std::move(jsonTraceEvents)}} <<
"\r\n";
726#ifdef GREM_USE_MULTITHREADING
727 [[nodiscard]] ProfilerThread& addThread() {
728 const ScopedLock
lock{mutex};
729 return *profilerThreads.emplace_back(UniquePointer<ProfilerThread>::create());
732 ArrayList<UniquePointer<ProfilerThread>> profilerThreads{};
734 ProfilerThread profilerThread{};
737 bool frameInProgress =
false;
738 UTCTimestamp captureStartTime{};
739 Buffer<TimePoint> frameStartTimes{};
740 Buffer<TimePoint> frameEndTimes{};
741 String nextFrameOutputFilepathPrefix{};
742 ProfileFormats nextFrameOutputFormats{};
743 size_t framesToSaveCount = 0;
746inline ProfilerThread& ProfilerThread::getInstance() {
747#ifdef GREM_USE_MULTITHREADING
748 thread_local ProfilerThread& instance = Profiler::getInstance().addThread();
751 return Profiler::getInstance().profilerThread;
757 explicit BlockProfiler(StaticOrDynamicString
string, StaticOrDynamicString shortString)
758 : string(std::
move(string))
759 , shortString(std::
move(shortString)) {
760 ++ProfilerThread::getInstance().blockLevel;
770 BlockProfiler(
const BlockProfiler&) =
delete;
771 BlockProfiler(BlockProfiler&&) =
delete;
772 BlockProfiler& operator=(
const BlockProfiler&) =
delete;
773 BlockProfiler& operator=(BlockProfiler&&) =
delete;
781 ProfilerThread& profilerThread = ProfilerThread::getInstance();
782 const size_t level = --profilerThread.blockLevel;
783 profilerThread.submitBlock(ProfilerBlock{
784 .string = std::move(
string),
785 .shortString = std::move(shortString),
787 .startTime = startTime,
793 StaticOrDynamicString string;
794 StaticOrDynamicString shortString;
796 bool stopped =
false;
799class BlockProfilerStopper {
801 explicit BlockProfilerStopper(BlockProfiler& blockProfiler) {
802 blockProfiler.stop();
807 StringView unqualifiedFunctionName = fullFunctionName;
808 if (unqualifiedFunctionName.ends_with(
')')) {
810 unqualifiedFunctionName.remove_suffix(1);
811 while (!unqualifiedFunctionName.empty()) {
812 if (unqualifiedFunctionName.back() ==
')') {
814 }
else if (unqualifiedFunctionName.back() ==
'(') {
816 unqualifiedFunctionName.remove_suffix(1);
820 unqualifiedFunctionName.remove_suffix(1);
823 if (
const size_t lastNameSpecifierPosition = unqualifiedFunctionName.rfind(
"::"); lastNameSpecifierPosition != StringView::npos) {
824 unqualifiedFunctionName = unqualifiedFunctionName.substr(lastNameSpecifierPosition + 2);
826 if (!unqualifiedFunctionName.empty() &&
827 allOf(unqualifiedFunctionName, [](
const char ch) ->
bool {
return (ch >=
'a' && ch <=
'z') || (ch >=
'A' && ch <=
'Z') || (ch >=
'0' && ch <=
'9') || ch ==
'_'; })) {
828 return unqualifiedFunctionName;
830 return fullFunctionName;
834 if (
const size_t functionNameOffset = fullFunctionName.find(shortFunctionName); functionNameOffset != StringView::npos) {
835 fullFunctionName = fullFunctionName.substr(0, functionNameOffset + shortFunctionName.size());
836 if (functionNameOffset > 2 && fullFunctionName[functionNameOffset - 1] ==
':' && fullFunctionName[functionNameOffset - 2] ==
':') {
837 size_t typeNameOffset = functionNameOffset - 2;
839 while (typeNameOffset > 0) {
840 const char previousCharacter = fullFunctionName[typeNameOffset - 1];
841 if (level == 0 &&
contains(
" \t(){}[]'`:", previousCharacter)) {
844 if (previousCharacter ==
'>') {
846 }
else if (previousCharacter ==
'<') {
855 if (typeNameOffset == functionNameOffset - 2) {
856 typeNameOffset = functionNameOffset;
858 return fullFunctionName.substr(typeNameOffset);
861 return shortFunctionName;
868#ifdef GREM_USE_MULTITHREADING
869#define GREM_PROFILER_SET_THREAD_INFO(threadName, threadIndex, parentThreadID) (grem::detail::ProfilerThread::getInstance().setThreadInfo(threadName, threadIndex, parentThreadID))
871#define GREM_PROFILER_SET_THREAD_INFO(threadName, threadIndex, parentThreadID) ((void)0)
873#define GREM_PRIVATE_PROFILING_CONCAT(a, b) a##b
874#define GREM_PRIVATE_PROFILING_CONCAT_INDIRECT(a, b) GREM_PRIVATE_PROFILING_CONCAT(a, b)
875#define GREM_PROFILER_BEGIN_FRAME() (grem::detail::Profiler::getInstance().beginFrame())
876#define GREM_PROFILER_END_FRAME() (grem::detail::Profiler::getInstance().endFrame())
877#define GREM_PROFILER_SAVE_NEXT_N_FRAMES(frameCount, outputFilepathPrefix, outputFormats) \
878 (grem::detail::Profiler::getInstance().saveFrames(frameCount, outputFilepathPrefix, outputFormats))
879#define GREM_PROFILER_SAVE_NEXT_FRAME(outputFilepathPrefix, outputFormats) GREM_PROFILER_SAVE_NEXT_N_FRAMES(1, outputFilepathPrefix, outputFormats)
880#define GREM_PROFILE_BLOCK(staticString) \
881 const grem::detail::BlockProfiler GREM_PRIVATE_PROFILING_CONCAT_INDIRECT(GREM_private_blockProfiler, __LINE__) { \
882 grem::detail::StaticOrDynamicString::createStaticFromStringView(std::source_location::current().function_name()), \
883 grem::detail::StaticOrDynamicString::createStatic(staticString) \
885#define GREM_PROFILE_BLOCK_DYNAMIC(dynamicString) \
886 const grem::detail::BlockProfiler GREM_PRIVATE_PROFILING_CONCAT_INDIRECT(GREM_private_blockProfiler, __LINE__) { \
887 grem::detail::StaticOrDynamicString::createStaticFromStringView(std::source_location::current().function_name()), \
888 grem::detail::StaticOrDynamicString::createDynamic(dynamicString) \
890#define GREM_PROFILE_FUNCTION() \
891 const grem::detail::BlockProfiler GREM_PRIVATE_PROFILING_CONCAT_INDIRECT(GREM_private_blockProfiler, __LINE__) { \
892 grem::detail::StaticOrDynamicString::createStaticFromStringView(std::source_location::current().function_name()), \
893 grem::detail::StaticOrDynamicString::createStaticFromStringView( \
894 grem::detail::getQualifiedShortFunctionName(std::source_location::current().function_name(), __func__)) \
896#define GREM_PROFILE_CONSTRUCTOR_BEGIN() \
897 grem::detail::BlockProfiler GREM_private_constructorProfiler { \
898 grem::detail::StaticOrDynamicString::createStaticFromStringView(std::source_location::current().function_name()), \
899 grem::detail::StaticOrDynamicString::createStaticFromStringView(grem::detail::getUnqualifiedFunctionName(std::source_location::current().function_name())) \
901#define GREM_PROFILE_CONSTRUCTOR_END() \
902 const grem::detail::BlockProfilerStopper GREM_private_constructorProfilerStopper { \
903 GREM_private_constructorProfiler \
906#define GREM_PROFILER_SET_THREAD_INFO(threadName, threadIndex, parentThreadID) ((void)0)
907#define GREM_PROFILER_BEGIN_FRAME() ((void)0)
908#define GREM_PROFILER_END_FRAME() ((void)0)
909#define GREM_PROFILER_SAVE_NEXT_N_FRAMES(frameCount, outputFilepathPrefix, outputFormats) ((void)0)
910#define GREM_PROFILER_SAVE_NEXT_FRAME(outputFilepathPrefix, outputFormats) ((void)0)
911#define GREM_PROFILE_BLOCK(staticString) ((void)0)
912#define GREM_PROFILE_BLOCK_DYNAMIC(dynamicString) ((void)0)
913#define GREM_PROFILE_FUNCTION() ((void)0)
914#define GREM_PROFILE_CONSTRUCTOR_BEGIN() \
915 struct GREM_private_constructorProfiler {}
916#define GREM_PROFILE_CONSTRUCTOR_END() \
917 struct GREM_private_constructorProfilerStopper {}
#define GREM_MATCH(...)
Definition Variant.hpp:1997
#define GREM_CASE(...)
Definition Variant.hpp:1998
#define GREM_ASSERT(expression)
Definition assertions.hpp:77
size_type size() const noexcept
Definition json.hpp:7995
reference emplace_back(Args &&... args)
Definition json.hpp:8243
json::ObjectBase< std::allocator > Object
JSON object type using the default allocator.
Definition json.hpp:389
json::ArrayBase< std::allocator > Array
JSON array type using the default allocator.
Definition json.hpp:522
GREM_ALWAYS_INLINE constexpr T convertHostEndianToLittleEndian(T value)
Convert a value in host-endian byte order to the corresponding value in little-endian byte order.
Definition fundamentals.hpp:505
Clock::time_point TimePoint
Definition Clock.hpp:26
std::ratio< Num, Den > Ratio
Definition time.hpp:19
GREM_ALWAYS_INLINE void lock(Lockable1 &lock1, Lockable2 &lock2, LockableN &... lockN)
Definition synchronization.hpp:1268
constexpr auto move(input_range auto &&range, auto outputIterator)
Definition algorithms.hpp:669
GREM_ALWAYS_INLINE constexpr vec< 1, T > GREM_VECTORCALL operator|(vec< 1, T > a, vec< 1, T > b)
Definition math.hpp:1752
GREM_ALWAYS_INLINE constexpr UnsignedInteger roundUpToMultiple(UnsignedInteger value, UnsignedInteger n)
Get the smallest multiple of n that is not greater than a given value.
Definition fundamentals.hpp:822
BitBufferBase<> BitBuffer
Definition BitBuffer.hpp:700
std::chrono::duration< Rep, Period > DurationBase
Definition time.hpp:39
StringBase< char, std::char_traits< char >, std::allocator< char > > String
Definition String.hpp:17
ProfileFormat
Format to save profile data in.
Definition profiling.hpp:53
@ JSON
Generic JSON format.
Definition profiling.hpp:55
@ TRACE_EVENT_FORMAT
Trace Event Format compatible with Perfetto and Chromium's about:tracing.
Definition profiling.hpp:56
@ BINARY
Generic binary format.
Definition profiling.hpp:54
constexpr bool contains(input_range auto &&range, const auto &value)
Definition algorithms.hpp:299
GREM_ALWAYS_INLINE constexpr vec< 1, T > GREM_VECTORCALL operator~(vec< 1, T > a)
Definition math.hpp:1751
StringViewBase< char, std::char_traits< char > > StringView
Definition StringView.hpp:16
constexpr bool allOf(input_range auto &&range, auto predicate)
Definition algorithms.hpp:226
auto asBytes(Span< T, N > s) noexcept
Definition Span.hpp:359