// Copyright Advanced Micro Devices, Inc., or its affiliates.
// SPDX-License-Identifier: MIT

#pragma once
#include <rocRoller/KernelGraph/Transforms/GraphTransform.hpp>

namespace rocRoller
{
    namespace KernelGraph
    {
        /**
         * @brief Rewrite KernelGraph to
     *
     *   (1) Set the initial seed of random number generator via SeedPRNG operation
     *
     *   (2) Update the seed each time when the random number generator gets used.
     *       This ensures different random values get generated by new seed values.
         *
     * @ingroup Transformations
    */
        class AddPRNG : public GraphTransform
        {
        public:
            AddPRNG(ContextPtr context)
                : m_context(context)
            {
            }

            KernelGraph apply(KernelGraph const& original) override;

            std::string name() const override
            {
                return "AddPRNG";
            }

        private:
            ContextPtr m_context;
        };
    }
}
