567
社区成员




#include "tbb/cache_aligned_allocator.h"
#include "mkl_vsl.h"
using namespace tbb;
int n;
int *a;
cache_aligned_allocator<int> alloc_a;
VSLStreamStatePtr stream;
void gen(int _n,int seed)
{
int status;
n=_n;
a=alloc_a.allocate(_n);
status=vslNewStream(&stream,VSL_BRNG_MCG31,seed);
status=viRngUniform(VSL_METHOD_DUNIFORM_STD,stream,_n,&(a[0]),0,(1<<28)-1);
}
size_t *constructData(size_t size){
size_t *src = alloc_a.allocate(size);
for(int i=0; i<size; i++)
src[i]=i;
random_shuffle(src, src+size);
return src;
}