Mila 0.13.48
Deep Neural Network Library
Loading...
Searching...
No Matches
OperationRegistryHelpers.ixx File Reference

Compile-time templated helpers for querying the OperationRegistry. More...

#include <string>
#include <vector>
import Compute.OperationRegistry;
import Compute.DeviceType;
import Dnn.TensorDataType;

Namespaces

namespace  Mila
 Mila main API namespace.
namespace  Mila::Dnn
namespace  Mila::Dnn::Compute

Functions

template<DeviceType TDevice, TensorDataType TDataType>
std::vector< std::string > Mila::Dnn::Compute::getRegisteredOperations ()
 Templated helper returning registered operation names for a compile-time device and tensor data type.
template<DeviceType TDevice, TensorDataType TDataType>
bool Mila::Dnn::Compute::isOperationRegistered (const std::string &operation_name)
 Templated helper that checks whether a named operation is registered for a compile-time device and tensor data type.

Detailed Description

Compile-time templated helpers for querying the OperationRegistry.

This module exports two lightweight, compile-time helpers that forward to Mila::Dnn::Compute::OperationRegistry template methods:

  • getRegisteredOperations<DeviceType, TensorDataType>() Returns the list of registered operation names for the specified compile-time device and tensor data type.
  • isOperationRegistered<DeviceType, TensorDataType>(const std::string&) Returns true if the named operation is registered for the specified compile-time device and tensor data type, false otherwise.

Notes:

  • These helpers perform no runtime device/data-type switching; they are intended for use when DeviceType and TensorDataType are known at compile time.
  • The helpers merely forward to OperationRegistry::getRegisteredOperations and OperationRegistry::isOperationRegistered and preserve the registry's semantics.
  • Keep uses in hot paths minimal to avoid unnecessary copies of returned vectors.