Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NeonBackend how to support multi thread parallel inference #798

Open
xiaotongnii opened this issue Jan 22, 2025 · 0 comments
Open

NeonBackend how to support multi thread parallel inference #798

xiaotongnii opened this issue Jan 22, 2025 · 0 comments

Comments

@xiaotongnii
Copy link

xiaotongnii commented Jan 22, 2025

NeonBackend how to support multi thread inference。
support multi thread parallel in Neon operator,like onnxruntime IntraOpNumThreads;
Or Others

NeonBackendModelContext::NeonBackendModelContext(const ModelOptions& modelOptions)
    : m_IsFastMathEnabled(false), m_NumberOfThreads(0)
{
   if (!modelOptions.empty())
   {
       ParseOptions(modelOptions, "CpuAcc", [&](std::string name, const BackendOptions::Var& value)
       {
           if (name == "FastMathEnabled")
           {
               m_IsFastMathEnabled |= ParseBool(value, false);
           }
           if (name == "NumberOfThreads")
           {
               m_NumberOfThreads |= ParseUnsignedInt(value, 0);
           }
       });
   }
}

bool NeonBackendModelContext::IsFastMathEnabled() const
{
    return m_IsFastMathEnabled;
}

unsigned int NeonBackendModelContext::GetNumberOfThreads() const
{
    return m_NumberOfThreads;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant