http://www.accelereyes.com/docs_alpha/g ... tarted.htm

- Code: Select all
`int main(void)`

{

// generate random values

int m = 10000; // Length of Signal

int n = 500; // Length of Kernel

int k = 10; // Number of Signals to convolve

float *d_signal, *d_filter, *d_result;

// Generate 'k' random signals each of length m

af_randu_S(&d_signal, m * k);

// Generate one random kernel to convolve the signals with

af_randu_S(&d_filter, n * 1);

// Allocate space for result

af_malloc(&d_result, (m + n - 1) * k * sizeof(float));

// Perform the convolutions

af_conv_SS(d_result, // output

m, d_signal, k, // Signal size, pointer, number of signals

n, d_filter, 1, // Kernel size, pointer, number of kernels

1); // (FULL: 1, SAME: 0, VALID: -1)

return 0;

}

This doesn't compile because ad_randu_S takes a single pointer as the first argument. I'm assuming that it doesn't do the allocation for those variables, so I don't know how this example would have worked. Can you post a working example of convolution using these functions instead of the convolution() wrapper? Thanks