SIMD or not SIMD - cross platform

后端 未结 6 1611
别跟我提以往
别跟我提以往 2021-02-04 08:59

I need some idea how to write a C++ cross platform implementation of a few parallelizable problems in a way so I can take advantage of SIMD (SSE, SPU, etc) if available. As well

6条回答
  •  情书的邮戳
    2021-02-04 09:22

    You might want to take a glance at my attempt at SIMD/non-SIMD:

    • vrep, a templated base class with specializations for SIMD (note how it distinguishes between floats-only SSE, and SSE2, which introduced integer vectors.).

    • More useful v4f, v4i etc classes (subclassed via intermediate v4).

    Of course it's far more geared towards 4-element vectors for rgba/xyz type calculations than SoA, so will completely run out of steam when 8-way AVX comes along, but the general principles might be useful.

提交回复
热议问题