Пример #1
0
void workload(TYPE force_x[nAtoms],
               TYPE force_y[nAtoms],
               TYPE force_z[nAtoms],
               TYPE position_x[nAtoms],
               TYPE position_y[nAtoms],
               TYPE position_z[nAtoms],
               int32_t NL[nAtoms*maxNeighbors]) {
#pragma HLS INTERFACE m_axi port=force_x offset=slave bundle=gmem1
#pragma HLS INTERFACE m_axi port=force_y offset=slave bundle=gmem1
#pragma HLS INTERFACE m_axi port=force_z offset=slave bundle=gmem1
#pragma HLS INTERFACE m_axi port=position_x offset=slave bundle=gmem1
#pragma HLS INTERFACE m_axi port=position_y offset=slave bundle=gmem1
#pragma HLS INTERFACE m_axi port=position_z offset=slave bundle=gmem1
#pragma HLS INTERFACE m_axi port=NL offset=slave bundle=gmem2
#pragma HLS INTERFACE s_axilite port=force_x bundle=control
#pragma HLS INTERFACE s_axilite port=force_y bundle=control
#pragma HLS INTERFACE s_axilite port=force_z bundle=control
#pragma HLS INTERFACE s_axilite port=position_x bundle=control
#pragma HLS INTERFACE s_axilite port=position_y bundle=control
#pragma HLS INTERFACE s_axilite port=position_z bundle=control
#pragma HLS INTERFACE s_axilite port=NL bundle=control
#pragma HLS INTERFACE s_axilite port=return bundle=control
	md_kernel(force_x, force_y, force_z, position_x, position_y, position_z, NL);
	return;
}
Пример #2
0
int main(){
    printf("here");
    int i, iter, j, totalPairs;
    iter = 0; 

    srand(8650341L);

    printf("here");
    TYPE position_x[nAtoms];
    TYPE position_y[nAtoms];
    TYPE position_z[nAtoms];
    TYPE force_x[nAtoms];
    TYPE force_y[nAtoms];
    TYPE force_z[nAtoms];
    TYPE NL[nAtoms][maxNeighbors];
    int neighborList[size];

    printf("here");
    for  (i = 0; i < nAtoms; i++)
    {
        position_x[i] = rand();
        position_y[i] = rand();
        position_z[i] = rand();
        force_x[i] = rand();
        force_y[i] = rand();
        force_z[i] = rand();
    }

    
    printf("here");
    for(i=0; i<nAtoms; i++){
        for(j = 0; j < maxNeighbors; ++j){
            NL[i][j] = 0;
        }
    }
    printf("here");
    totalPairs = buildNeighborList(position_x, position_y, position_z, NL);

    for(i=0; i<nAtoms; i++){
        for(j = 0; j < maxNeighbors; ++j)
            neighborList[i*maxNeighbors + j] = NL[i][j];
    }

    //Function Call
    for(iter = 0; iter< MAX_ITERATION; iter++) {
        md_kernel(force_x, force_y, force_z, position_x, position_y, position_z, neighborList);
    }
    return 0;
}
Пример #3
0
void run_benchmark( void *vargs ) {
  struct bench_args_t *args = (struct bench_args_t *)vargs;
  md_kernel( args->force_x, args->force_y, args->force_z,
             args->position_x, args->position_y, args->position_z,
             args->NL );
}