# SIMD: Am I holding it wrong?

**URL:** <https://forums.swift.org/t/simd-am-i-holding-it-wrong/67251>\
**Category:** Using Swift\
**Tags:** simd\
**Created:** [September 13, 2023, 1:07am UTC](https://forums.swift.org/t/simd-am-i-holding-it-wrong/67251 "2023-09-13T01:07:36Z")\
**Posts on this page:** 1\
**Showing post:** 12

<div class="post-metadata">

**Author:** ![taylorswift](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/taylorswift/32/43413_2.png) [@taylorswift](https://forums.swift.org/u/taylorswift)\
**Post date:** [September 13, 2023, 5:22pm UTC](https://forums.swift.org/t/simd-am-i-holding-it-wrong/67251/12 "2023-09-13T17:22:54Z")

</div>

> [@scanon](#):
>
> The other alternative is to just write concrete code if you don't actually need generics, which applies to most people who aren't writing general-purpose libraries =)

oh my, this brings back a memory of a time i worked on a spherical geo project that we decided to write in `Float` thinking it would be easier to interface with the GPU-side of the project that only spoke `Float`. then halfway through we discovered `Float` was nowhere near precise enough for spherical algorithms so we had to migrate the whole thing to `Double`. which wasn’t _that_ bad since it only involved a bunch of find-and-replaces (FloatVector –\> DoubleVector, etc) and rewrapping some overflowing lines. but my point is it's hard to anticipate ahead of time what floating point specialization you need unless you've already got a ton of experience with numerics. anyway, just a random anecdote.

> [@scanon](#):
>
> So long as you can stay on the happy path, this is sort-of true, but if one existential or unspecialized generic entry point slips in somewhere, then everything thereafter will go through protocol dispatch.

yeah, this is definitely still a [major pain point](https://forums.swift.org/t/nested-generic-trouble/63152/46) with swift generics.

---

_[View the full topic](https://forums.swift.org/t/simd-am-i-holding-it-wrong/67251)._
