allocation.cpp 384 Bytes
Newer Older
perdacherMartin's avatar
perdacherMartin committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22

#include "allocation.h"


void * ddr_alloc(size_t bytes){
    return _mm_malloc(bytes, ALIGNMENT);
}

void ddr_free(void *ptrs){
    _mm_free(ptrs);
}

void random_init(double *array, const int N, const int D){
    short unsigned int seed = 3;
    int i;

    #pragma omp parallel for firstprivate(seed)
    for ( i=0 ; i < N * D ; i++ ){
        array[i] = erand48(&seed);
    }

}