Files
TheRock/rocm-systems/profilers/profiler-hub/source/writers/writer_policy_traits.hpp
T
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

77 lines
3.1 KiB
C++

// Copyright (c) Advanced Micro Devices, Inc.
// SPDX-License-Identifier: MIT
#pragma once
#include "writers/interfaces/info_registration_writer_interface.hpp"
#include "writers/interfaces/kernel_dispatch_writer_interface.hpp"
#include "writers/interfaces/memory_alloc_writer_interface.hpp"
#include "writers/interfaces/memory_copy_writer_interface.hpp"
#include "writers/interfaces/pmc_event_writer_interface.hpp"
#include "writers/interfaces/region_writer_interface.hpp"
#include <type_traits>
namespace profiler_hub
{
namespace detail
{
template <typename, typename = void>
struct has_required_type_aliases : std::false_type
{};
template <typename Policy>
struct has_required_type_aliases<Policy,
std::void_t<typename Policy::schema_tag_t,
typename Policy::insert_statements_t,
typename Policy::common_ops_t,
typename Policy::info_writer_t,
typename Policy::region_writer_t,
typename Policy::kernel_dispatch_writer_t,
typename Policy::memory_copy_writer_t,
typename Policy::memory_alloc_writer_t,
typename Policy::pmc_event_writer_t>>
: std::true_type
{};
template <typename Writer, template <typename> class Interface>
struct satisfies_interface : std::is_base_of<Interface<Writer>, Writer>
{};
template <typename Policy, typename = void>
struct has_valid_writer_interfaces : std::false_type
{};
template <typename Policy>
struct has_valid_writer_interfaces<
Policy,
std::enable_if_t<has_required_type_aliases<Policy>::value>>
: std::bool_constant<satisfies_interface<typename Policy::info_writer_t,
info_registration_writer_interface>::value &&
satisfies_interface<typename Policy::region_writer_t,
region_writer_interface>::value &&
satisfies_interface<typename Policy::kernel_dispatch_writer_t,
kernel_dispatch_writer_interface>::value &&
satisfies_interface<typename Policy::memory_copy_writer_t,
memory_copy_writer_interface>::value &&
satisfies_interface<typename Policy::memory_alloc_writer_t,
memory_alloc_writer_interface>::value &&
satisfies_interface<typename Policy::pmc_event_writer_t,
pmc_event_writer_interface>::value>
{};
} // namespace detail
template <typename Policy>
struct is_valid_writer_policy
: std::bool_constant<detail::has_required_type_aliases<Policy>::value &&
detail::has_valid_writer_interfaces<Policy>::value>
{};
template <typename Policy>
inline constexpr bool is_valid_writer_policy_v = is_valid_writer_policy<Policy>::value;
} // namespace profiler_hub