镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

A few starter generic compute kernels #254

Description

@mobiusklein

Describe the enhancement requested

I have been hand-writing a pile of generic kernels for numerical arrays and wanted to know what would be required to contribute them upstream.

So far I have implementations for:

  • public static Array Filter(Array array, BooleanArray mask)
  • public static BooleanArray Equal<T>(PrimitiveArray<T> lhs, T rhs) where T: struct, INumber<T>
  • public static BooleanArray Equal<T>(PrimitiveArray<T> lhs, PrimitiveArray<T> rhs) where T: struct, INumber<T>
  • public static Array Take(Array array, IList<int> indices)
  • public static Int64Array CastInt64<T>(PrimitiveArray<T> array) where T: struct, INumber<T>
  • public static Int32Array CastInt32<T>(PrimitiveArray<T> array) where T : struct, INumber<T>
  • public static FloatArray CastFloat<T>(PrimitiveArray<T> array) where T : struct, INumber<T>
  • public static DoubleArray CastDouble<T>(PrimitiveArray<T> array) where T : struct, INumber<T>

I also have a generic visitor for converting Large* arrays to their regular counterparts so that they may work with the other machinery in the library. I am less confident that is useful to others, or that it is truly correct.

Is there a particular pattern you would want these to follow or is the notion not suitable for the .NET ecosystem? I am less familiar with .NET as an ecosystem.

Thank you.

Activity

  1. CurtHagenlocher commented on Feb 3, 2026

    @CurtHagenlocher
    Contributor

    Thanks for your interest! This sounds very useful. I would suggest creating a new project Apache.Arrow.Operations for these kernels and perhaps we can iterate on it a bit before publishing it and locking in the APIs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions