All Questions
Tagged with vectorization c
13 questions
3
votes
2
answers
111
views
C - SIMD Code to invert a transformation matrix
I am writing a maths library for a raytracer project, and so I'm trying to make my heavy operations (like matrix inverse) more optimised. After doing some research, I discovered this trick to invert a ...
4
votes
1
answer
182
views
Vectorized 16-bit addition in Standard C
The idea is to add a given 16-bit number N to each element of an array of 16-bit integers of arbitrary length, taking advantage of 64-bit integer types and instructions to perform the additions 4 at a ...
3
votes
1
answer
169
views
Matlab vs C: Tensorproduct or Vec-trick (multiple times)
I am searching for a more efficient way to calculate the so called vec-trick used in Tensor algebra, see Wikipedia.
Introduction:
Suppose you have a matrix vector multiplication, where a matrix C ...
11
votes
3
answers
2k
views
My blit function for my own graphics library
Here is a blit function for a graphics library I made.
I've built a small graphics library that uses an palette-indexed spritesheet to hold all of the game's sprites. The blit function copies parts of ...
1
vote
0
answers
141
views
Faster Tridiagonal Matrix Multiplication
I have a function that I've been trying to make faster that computes \$XA + B\$, where \$A \in \mathbb{R}^{n \times n}\$ is a tridiagonal matrix, and \$X, B \in \mathbb{R}^{m \times n}\$. In the code, ...
1
vote
0
answers
56
views
Vectorization of Mersenne Twister? [closed]
Ahoy friends.
Right now i'm selling a huge amount of HDDs and usually i used DBAN or nwipe to perform this actions.
Unfortunately the PRNG Mersenne Twister is quite slow, so i get a throughput of ...
-2
votes
2
answers
2k
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
1
answer
1k
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 ...
4
votes
1
answer
334
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,...
7
votes
3
answers
3k
views
Converting Array of Floats to UINT8 (`char`) or UINT16 (`unsigned short`) Using SSE4
The problem is given image in 32 Bit Floating Point Format (float) how to convert it to UINT8 (char) or UNIT16 (...
10
votes
2
answers
2k
views
Vectorized and Multi Threaded Image Convolution
I created code for Image Convolution. The code is in my Image Convolution GitHub Repository.
It includes the case for arbitrary Image Convolution and for Separable Kernel Convolution.
The code is a ...
10
votes
1
answer
686
views
Vectorizing the product of an array of complex numbers
I am trying to write fast/optimal code to vectorize the product of an array of complex numbers. In simple C this would be:
...
4
votes
1
answer
922
views
Implementation of MATLAB's `im2col`
The function im2col in MATLAB is very useful to vectorize Patch based Image Processing algorithms. The problem is the function isn't optimized and doesn't use C ...