Skip to content

Commit

Permalink
Remove team parameter from lower level API
Browse files Browse the repository at this point in the history
Remove team parameter from API functions in:
image
dsp
math

None of this was implemented and parallelism should be handled in an
upper layer API.

Signed-off-by: Ola Jeppsson <[email protected]>
  • Loading branch information
olajep committed Jun 11, 2015
1 parent a5dd374 commit 9fe7cd8
Show file tree
Hide file tree
Showing 78 changed files with 165 additions and 522 deletions.
8 changes: 2 additions & 6 deletions benchmark/example.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,14 @@ void bench_p_add(const struct p_benchmark_specification* spec)
p_add_f32(spec->mem.input_float_first,
spec->mem.input_float_second,
spec->mem.output_float,
spec->current_size,
spec->p,
spec->team);
spec->current_size);
}

void bench_p_sqrt(const struct p_benchmark_specification* spec)
{
p_sqrt_f32(spec->mem.input_float_first,
spec->mem.output_float,
spec->current_size,
spec->p,
spec->team);
spec->current_size);
}

const struct p_benchmark_item benchmark_items[] = {
Expand Down
2 changes: 0 additions & 2 deletions benchmark/wrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,6 @@ struct p_benchmark_specification
{
struct p_benchmark_raw_memory mem;
size_t current_size;
int p;
p_team_t team;
};

struct p_benchmark_item
Expand Down
5 changes: 2 additions & 3 deletions examples/base/median_task.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,10 @@ int main()

int match;
float median;
p_team_t team;

puts("Running first test");

p_median_f32(a, &median, a_n, 1, team);
p_median_f32(a, &median, a_n);

if(median==a_expected_median)
match=1;
Expand All @@ -29,7 +28,7 @@ int main()

puts("\nRunning second test");

p_median_f32(b, &median, b_n, 1, team);
p_median_f32(b, &median, b_n);

if(median==b_expected_median)
match=1;
Expand Down
8 changes: 3 additions & 5 deletions examples/base/mode_task.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

int main(int argc, char *argv[])
{
p_team_t team0;

unsigned int size_a = 10;
unsigned int size_b = 15;
unsigned int size_c = 7;
Expand All @@ -20,9 +18,9 @@ int main(int argc, char *argv[])

unsigned int i = 0;

p_mode_f32(a, &m_a, size_a, 0, team0);
p_mode_f32(b, &m_b, size_b, 0, team0);
p_mode_f32(c, &m_c, size_c, 0, team0);
p_mode_f32(a, &m_a, size_a);
p_mode_f32(b, &m_b, size_b);
p_mode_f32(c, &m_c, size_c);

printf("[");
for (i = 0; i < size_a; ++i) {
Expand Down
5 changes: 2 additions & 3 deletions examples/base/sine_task.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ int main()
int size = 1;
float a[3] = { 0.0, 0.5, 1.0 };
float b[3];
p_team_t team;
printf("Running p_sin_32f()\n");
p_sin_f32(a, b, size,1,team);
p_sin_f32(a, b, size);

return 0;
}
5 changes: 2 additions & 3 deletions examples/base/sort_task.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

int main()
{
p_team_t team;
#define FSIZE 30
int fsize = FSIZE;
float fin[FSIZE] = {
Expand Down Expand Up @@ -39,7 +38,7 @@ int main()
int i;

printf("Running p_sort_f32()\n");
p_sort_f32(fin, fout, fsize, 1, team);
p_sort_f32(fin, fout, fsize);
printf("Results:\n");
sorted = 1;
ulast = fout[0];
Expand All @@ -54,7 +53,7 @@ int main()
printf("\n");

printf("Running p_sort_u32()\n");
p_sort_u32(uin, uout, usize, 1, team);
p_sort_u32(uin, uout, usize);
printf("Results:\n");
sorted = 1;
ulast = uout[0];
Expand Down
12 changes: 5 additions & 7 deletions examples/image/filters.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ void float_to_ubyte(unsigned char *dest, float *src, int size)

int main(int argc, char *argv[])
{
p_team_t team;

float *data;
float *dest;
unsigned char *data_ub; /* ubyte data */
Expand Down Expand Up @@ -68,37 +66,37 @@ int main(int argc, char *argv[])

/* gaussian */
{
p_gauss3x3_f32(data, dest, h, w, 1, team);
p_gauss3x3_f32(data, dest, h, w);
float_to_ubyte(data_ub, dest, size);
stbi_write_tga("../dataset/lena_gaussian.tga", w-2, h-2, 1, data_ub);
}

/* harris */
{
float *tmp = malloc(size * 3 * sizeof(float));
p_harris3x3_f32(data, dest, tmp, h, w, 1, team);
p_harris3x3_f32(data, dest, tmp, h, w);
free(tmp);
float_to_ubyte(data_ub, dest, size);
stbi_write_tga("../dataset/lena_harris.tga", w-4, h-4, 1, data_ub);
}

/* sobel */
{
p_sobel3x3_f32(data, dest, h, w, 1, team);
p_sobel3x3_f32(data, dest, h, w);
float_to_ubyte(data_ub, dest, size);
stbi_write_tga("../dataset/lena_sobel.tga", w, h, 1, data_ub);
}

/* box */
{
p_box3x3_f32(data, dest, h, w, 1, team);
p_box3x3_f32(data, dest, h, w);
float_to_ubyte(data_ub, dest, size);
stbi_write_tga("../dataset/lena_box.tga", w-2, h-2, 1, data_ub);
}

/* median */
{
p_median3x3_f32(data, dest, h, w, 1, team);
p_median3x3_f32(data, dest, h, w);
float_to_ubyte(data_ub, dest, size);
stbi_write_tga("../dataset/lena_median.tga", w-2, h-2, 1, data_ub);
}
Expand Down
3 changes: 1 addition & 2 deletions examples/image/harris.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

int main(int argc, char *argv[])
{
p_team_t team;
int i, j;

float src[W*W] = {
Expand All @@ -32,7 +31,7 @@ int main(int argc, char *argv[])
float dest[W4*W4];
float tmp[W2*W2*3];

p_harris3x3_f32(src, dest, tmp, W, W, 1, team);
p_harris3x3_f32(src, dest, tmp, W, W);

/* src */
for (i = 0; i < W; i++) {
Expand Down
22 changes: 8 additions & 14 deletions include/pal_dsp.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,34 +15,28 @@
*/

/*auto correlation: r[j] = sum ( x[j+k] * x[k] ), k=0..(n-j-1) */
void p_acorr_f32(const float *x, float *r, int nx, int nr,
int p, p_team_t team);
void p_acorr_f32(const float *x, float *r, int nx, int nr);

/*convolution: r[j] = sum ( h[k] * x[j-k), k=0..(nh-1) */
void p_conv_f32(const float *x, const float *h, float *r, int nr, int nh,
int p, p_team_t team);
void p_conv_f32(const float *x, const float *h, float *r, int nr, int nh);

/*cross correlation: r[j] = sum ( x[j+k] * y[k]), k=0..(nx+ny-1) */
/* NOTE: current implementation requires nx >= ny */
void p_xcorr_f32(const float *x, const float *y, float *r, int nx, int ny,
int p, p_team_t team);
void p_xcorr_f32(const float *x, const float *y, float *r, int nx, int ny);

/*FIR filter direct form: r[j] = sum ( h[k] * x [j-k]), k=0..(nh-1) */
void p_fir_f32(const float *x, const float *h, float *r, int nx, int nh,
int p, p_team_t team);
void p_fir_f32(const float *x, const float *h, float *r, int nx, int nh);

/*FIR filter with decimation: r[j] = sum ( h[k] * x [j*D-k]), k=0..(nh-1) */
void p_firdec_f32(const float *x, const float *h, float *r,
int nx, int nh, int df, int p, p_team_t team);
int nx, int nh, int df);

/*FIR filter with inerpolation: r[j] = sum ( h[k] * x [j*D-k]), k=0..(nh-1) */
void p_firint_f32(const float *x, const float *h, float *r,
int nx, int nh, int ifactor, int p, p_team_t team);
int nx, int nh, int ifactor);

/*FIR symmetric form: */
void p_firsym_f32(const float *x, const float *h, float *r, int nx, int nh,
int p, p_team_t team);
void p_firsym_f32(const float *x, const float *h, float *r, int nx, int nh);

/*IIR filter: */
void p_iir_f32(const float *x, const float *h, float *r, int nb, int nr,
int p, p_team_t team);
void p_iir_f32(const float *x, const float *h, float *r, int nb, int nr);
32 changes: 11 additions & 21 deletions include/pal_image.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,44 +19,34 @@

/*2d convolution */
void p_conv2d_f32(const float *x, float *m, float *r, int rows, int cols,
int msize, int p, p_team_t team);
int msize);

/*2d box (i.e mean) filter(3x3) */
void p_box3x3_f32(const float *x, float *r, int rows, int cols,
int p, p_team_t team);
void p_box3x3_f32(const float *x, float *r, int rows, int cols);

/*2d gauss filter (3x3) */
void p_gauss3x3_f32(const float *x, float *r, int rows, int cols,
int p, p_team_t team);
void p_gauss3x3_f32(const float *x, float *r, int rows, int cols);

/*2d median filter (3x3) */
void p_median3x3_f32(const float *x, float *r, int rows, int cols,
int p, p_team_t team);
void p_median3x3_f32(const float *x, float *r, int rows, int cols);

/*2d laplace filter (3x3) */
void p_laplace3x3_f32(const float *x, float *r, int rows, int cols,
int p, p_team_t team);
void p_laplace3x3_f32(const float *x, float *r, int rows, int cols);

/*2d scharr filter (3x3) */
void p_scharr3x3_f32(const float *x, float *r, int rows, int cols,
int p, p_team_t team);
void p_scharr3x3_f32(const float *x, float *r, int rows, int cols);

/*2d prewitt filter (3x3) */
void p_prewitt3x3_f32(const float *x, float *r, int rows, int cols,
int p, p_team_t team);
void p_prewitt3x3_f32(const float *x, float *r, int rows, int cols);

/*2d sum of absolute differences (8x8), returns scalar */
void p_sad8x8_f32(const float *x, float *m, float *r, int cols,
int p, p_team_t team);
void p_sad8x8_f32(const float *x, float *m, float *r, int cols);

/*2d sum of absolute differences (16x16), returns scalar */
void p_sad16x16_f32(const float *x, float *m, float *r, int cols,
int p, p_team_t team);
void p_sad16x16_f32(const float *x, float *m, float *r, int cols);

/*2d sobel filter (3x3) */
void p_sobel3x3_f32(const float *x, float *r, int rows, int cols,
int p, p_team_t team);
void p_sobel3x3_f32(const float *x, float *r, int rows, int cols);

/*2d harris filter (3x3) */
void p_harris3x3_f32(const float *x, float *r, float *t, int rows, int cols,
int p, p_team_t team);
void p_harris3x3_f32(const float *x, float *r, float *t, int rows, int cols);
Loading

0 comments on commit 9fe7cd8

Please sign in to comment.