Junnosuke Kado

Results 52 comments of Junnosuke Kado

Unfortunately, Matft is 5 times slower than numpy... Matft; ```swift do{ let a = Matft.arange(start: -10*10*10*10*10*5, to: 10*10*10*10*10*5, by: 1, shape: [10,10,10,10,10,10]) self.measure { let _ = a[a>0] } /*...

I think [this parts](https://github.com/jjjkkkjjj/Matft/blob/b1d339c9d095583e08253a5c3401d1a9419bf92d/Sources/Matft/core/function/binary_operation.swift#L346) cause above slowness

[Gather](https://developer.apple.com/documentation/accelerate/vdsp/3600623-gather) may be useful [Compress](https://developer.apple.com/documentation/accelerate/vdsp/3600616-compress) may be useful too

Should use `boolean` as storedType?

The commit [394d3a4](https://github.com/jjjkkkjjj/Matft/commit/a33e4be020ccb601de27c1f845fe9246c0608253) is invalid. These function must be declared outside the function like this; ```swift public static func clip(_ mfarray: MfArray, min: T? = nil, max: T? = nil)...

Use this [commit](https://github.com/jjjkkkjjj/Matft/commit/823604eb94228f68623103a06ea6cd11c6da972d)‘s function and stored bool. bool -> UInt8(cast only) -> Float(conversion) Float or Double -> UInt8(toBool_by_vDSP and conversion) -> bool(cast only) However, vDSP can handle Floating point types...

https://gain-performance.com/ume/ may be useful Call c++ from Swift? https://mike-neck.hatenadiary.com/entry/2018/12/02/080000

stride simd sample; ```c++ // GATHERU UME_FORCE_INLINE SIMDVec_u & gatheru(uint64_t const * baseAddr, uint64_t stride) { #if defined (__AVX512DQ__) __m512i t0 = _mm512_set1_epi64(stride); __m512i t1 = _mm512_setr_epi64(0, 1, 2, 3,...

Try ‘withMemoryRebound’ in [evdsp_sign ](https://github.com/jjjkkkjjj/Matft/blob/c5e2e3b4fe4041c23bdfd20e642d9c77aab7dea2/Sources/Matft/util/library/extvDSP.swift#L28) like [this](https://stackoverflow.com/questions/53890044/casting-an-float-to-simd-float4-in-swift)

https://docs.opencv.org/3.1.0/d3/d63/classcv_1_1Mat.html#a5fafc033e089143062fd31015b5d0f40 > Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. Instead, they just initialize the matrix header that points to...