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

CpuMath Enhancement: Remove any unnecessary Contracts.Assert covered by Span<T> in hardware intrinsics APIs #827

Open
briancylui opened this issue Sep 5, 2018 · 0 comments
Labels
P3 Doc bugs, questions, minor issues, etc.

Comments

@briancylui
Copy link
Contributor

briancylui commented Sep 5, 2018

Style changes needed to solve part of #823

Details

  • In src\Microsoft.ML.CpuMath\CpuMathUtils.netcoreapp.cs, Span<T> might already do the checks (Contracts.Assert) in the public functions. Reference:
    public static void Scale(float a, float[] dst, int offset, int count)
    {
    Contracts.AssertNonEmpty(dst);
    Contracts.Assert(count > 0);
    Contracts.Assert(offset >= 0);
    Contracts.Assert(offset < (dst.Length - count));
    Scale(a, new Span<float>(dst, offset, count));
    }
@briancylui briancylui changed the title Remove any unnecessary Contracts.Assert covered by Span<T> in hardware intrinsics APIs CpuMath Enhancement: Remove any unnecessary Contracts.Assert covered by Span<T> in hardware intrinsics APIs Sep 6, 2018
@Lynx1820 Lynx1820 added the P3 Doc bugs, questions, minor issues, etc. label Jan 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P3 Doc bugs, questions, minor issues, etc.
Projects
None yet
Development

No branches or pull requests

2 participants