Questions tagged [simd]

Single Instruction, Multiple Data describes CPU instructions that process many operands in parallel.

Filter by
Sorted by
Tagged with
3
votes
0answers
47 views

Linear probing 16 hashmap elements in parallel using SIMD instrinsics

For my hashmap implementation, I'm caching hashes for each map element in an array of length NBUCKETS, where each element corresponds to an element in the hashmap. ...
11
votes
3answers
2k views

Hangman Bot built with performance in mind

I'm working on a bot that can use a wordlist to play hangman optimally as fast as possible. With the current implementation, the simulateGame function, which plays ...
4
votes
0answers
73 views

3D Direct Convolution Implementation in C

For my project, I've written a naive C implementation of Direct3D convolution with periodic padding on the input. Unfortunately, since I'm new to C, the performance isn't so good. By convention, all ...
5
votes
2answers
91 views

SSE Assembly vs GCC Compiler - Dot Product

I am currently taking an introductory course in computer architecture. Our goal was to write a dot-product function in x86 Assembly which would use SSE and SIMD (without AVX). I am not to that ...
1
vote
1answer
626 views

Computing tangent space basis vectors for an arbitrary mesh

This is more like a share and a request than a question. I converted Eric Lengyel's code, which calculates tangents of a mesh for the purpose of texturing and normal mapping, to support SIMD. For this ...
11
votes
1answer
357 views

AVX Vectorized Multi-threaded Mandelbrot Renderer

I wrote a Mandelbrot renderer in C++ that uses AVX intrinsics to calculate 8 pixels per thread in parallel. It can compute 1080p frames with 256 max iterations in about 40 milliseconds on a 2 core 4 ...
4
votes
0answers
72 views

4×4 cofactor in SSE

The cofactor of a 4×4 matrix can be used to convert a "regular geometry" matrix into the matrix that transforms the normals. It's an alternative to the common inverse-transpose pattern. In this post I ...
2
votes
1answer
85 views

Fast “index of minimum” for distances to points on single thread

The problem in simple words: I have three arrays of double values (x-, y- and z-coordinates) and need to find the index of the point which has minimum distance to a reference points. I do not need the ...
4
votes
2answers
151 views

SIMD Mandelbrot calculation

I was messing around with GPU compute shaders the other day and created a Mandelbrot shader. Unfortunately, Metal doesn't support double-precision in compute shaders, so beyond a certain zoom level, I ...
5
votes
2answers
372 views

Finding min value of an array using SIMD

I have the following code to find the minimum sbyte value in an array. It is using System.Runtime.Intrinsics to perform a SIMD ...
-3
votes
2answers
337 views

Converting Array of `Float32` (`float`) to Array of `UINT8` (`unsigned char`) Using AVX2 [closed]

Given input array of Float32 (float) with numElements how could one efficiently convert it ...
0
votes
1answer
176 views

Converting Array of `UINT8` (`unsigned char`) to Array of `Float32` (`float`) Using AVX2

Given input array of UINT8 (unsigned char) with numElements how could one efficiently ...
1
vote
0answers
80 views

No performance gain with SIMD 3D vector for ray tracer

I wrote two versions of vector class for my ray tracer. Non-SIMD version and SIMD version. You can find the code below. I want to ask what things should I keep in mind to get max performance with SIMD....
2
votes
1answer
766 views

SIMD product of a 4×4 matrix and a vector

I wrote a matrix class for use in a ray tracer. I already have a 'scalar' version up and running, but now I'm trying to rewrite it to use Intel SIMD Instrinsics. I realize my compiler (clang-7.0.0) ...
5
votes
1answer
362 views

AVX512 - Add two 512-bit integers using _addcarryx_u64 function

My purpose is to add two __m512i variables (c = a + b) as efficiently as possible. To do so, I'd like to use the _addcarryx_u64 ...
3
votes
1answer
187 views

Optimizations of C Code - Bilateral Filter

I'm working on a nice approximation for the Bilateral Filter. I have a working code which runs pretty fast yet still I think much can be improved. The code (C Code,...
6
votes
1answer
667 views

SIMD memcpy assembler implementation

I am fairly rusty with assembler, let alone the AT&T syntax. I would appreciate it if someone with more experience could please review the following memcpy implementation. Note that this will only ...
2
votes
0answers
48 views

Write 16x16 bitmap to frame buffer

The following code writes a 16x16 bitmap to a framebuffer using up to AVX2 instuctions. I'm sure it can be improved with AVX512 ...
1
vote
1answer
401 views

Fast affine transformations of many 3D points by one 3×4 matrix

I wrote a function to batch-transform 3D vectors by a single 3x4 matrix using SSE2: ...
7
votes
2answers
6k views

AVX SIMD in matrix multiplication

I have coded the following C function for multiplying two NxN matrices and using AVX vectors to speed up the calculation. It works but the speedup is not what is to be expected(some scalar code is ...
1
vote
0answers
72 views

Computing butterflies with better performance

I have a code that computes butterflies and from a little profiling I found out that it is a little bit slow. So, it seemed that the better way to optimize its performance is vectorizing it using ...
1
vote
2answers
882 views

OpenMP SIMD Euclidean Distance

I'm using cv::norm() to compute the L2 distance between row vectors in thousands of dimensions (at least 4096 dimensions). I'm using an AVX2 machine and ...
5
votes
0answers
293 views

Cache conscious SIMD matrix multiply of unsigned integers

The goal of the code review by order of importance (i.e. What I hope to hear from you): I've verified correctness using a straightforward matrix multiply function though I am open to those who want ...
1
vote
2answers
5k views

Hash calculation for array of long values in C#

Can the following function be improved in terms of performance? I am calculating millions of such hashes. The long array represents a record from data table where all values are encoded as long ...
1
vote
1answer
267 views

HPC kernel for DGEMM: compiler v.s. assembly

This is a correct version, for computing a small matrix multiplication: C += A * B, where C is ...
29
votes
1answer
11k views

SIMD matrix multiplication

I recently started toying with SIMD and came up with the following code for matrix multiplication. First I attempted to implement it using SIMD the same way I did in SISD, just using SIMD for things ...
4
votes
0answers
211 views

SSE optimisation for audio resampling [closed]

I'm learning SSE for the first time and trying to optimise some code. Using oprofile shows that the CPU usage in this function went down from 2.5% to 0.9% using the ...
8
votes
2answers
637 views

SSE instruction to check if byte array is zeroes C#

My fundamental problem is how to check whether byte[] is full of zeroes. I posted a range of implementations (with timings) and one clearly beats others. In fact, ...
8
votes
0answers
1k views

Bilinear interpolation using Neon intrinsics [closed]

I'm trying to do a Bilinear interpolation on the ARM Neon. However, I find that my vectorized code is slower than the regular one, on a BeagleBone Black. Any idea why this could happen? I'm using ...
7
votes
1answer
466 views

Writing SIMD libraries for C++ on FASM in x86-64 Linux

I have recently started a project of SIMD libraries development for C++ on FASM for x86-64 Linux. I would be glad to hear any opinion or feedback about the project, cleanness of the code and ...