mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-10-30 14:53:03 +00:00
Last commit from the GSoC 2013 project "Improve the acquisition sensitivity of a GNSS receiver" by Marc Molina.
Added OpenCL Acquisition blocks and tests. git-svn-id: https://svn.code.sf.net/p/gnss-sdr/code/trunk@420 64b25241-fba3-4117-9849-534c7e92360d
This commit is contained in:
29
install/math_kernel.cl
Normal file
29
install/math_kernel.cl
Normal file
@@ -0,0 +1,29 @@
|
||||
#define MUL_RE(a,b) (a.x*b.x - a.y*b.y)
|
||||
#define MUL_IM(a,b) (a.x*b.y + a.y*b.x)
|
||||
#define SUM_RE(a,b) (a.x + b.x)
|
||||
#define SUM_IM(a,b) (a.y + b.y)
|
||||
|
||||
__kernel void add_vectors(__global const float2* src1, __global const float2* src2, __global float2* dest)
|
||||
{
|
||||
int gid = get_global_id(0);
|
||||
dest[gid] = (float2)(SUM_RE(src1[gid],src2[gid]),SUM_IM(src1[gid],src2[gid]));
|
||||
}
|
||||
|
||||
__kernel void mult_vectors(__global const float2* src1, __global const float2* src2, __global float2* dest)
|
||||
{
|
||||
int gid = get_global_id(0);
|
||||
dest[gid] = (float2)(MUL_RE(src1[gid],src2[gid]),MUL_IM(src1[gid],src2[gid]));
|
||||
}
|
||||
|
||||
__kernel void conj_vector(__global const float2* src, __global float2* dest)
|
||||
{
|
||||
int gid = get_global_id(0);
|
||||
dest[gid] = ((float2)(1,-1)) * src[gid];
|
||||
}
|
||||
|
||||
__kernel void magnitude_squared(__global const float2* src, __global float* dest)
|
||||
{
|
||||
int gid = get_global_id(0);
|
||||
dest[gid] = src[gid].x*src[gid].x + src[gid].y*src[gid].y;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user