Esempio n. 1
0
void data_to_input(int fd, void *vdata) {
  struct bench_args_t *data = (struct bench_args_t *)vdata;

  write_section_header(fd);
  STAC(write_,TYPE,_array)(fd, data->C, 2);

  write_section_header(fd);
  STAC(write_,TYPE,_array)(fd, data->orig, SIZE);
}
Esempio n. 2
0
void data_to_output(int fd, void *vdata) {
  struct bench_args_t *data = (struct bench_args_t *)vdata;

  write_section_header(fd);
  STAC(write_,TYPE,_array)(fd, data->force_x, n_atoms);

  write_section_header(fd);
  STAC(write_,TYPE,_array)(fd, data->force_y, n_atoms);

  write_section_header(fd);
  STAC(write_,TYPE,_array)(fd, data->force_z, n_atoms);
}
Esempio n. 3
0
void input_to_data(int fd, void *vdata) {
  struct bench_args_t *data = (struct bench_args_t *)vdata;
  char *p, *s;
  // Load input string
  p = readfile(fd);

  s = find_section_start(p,1);
  STAC(parse_,TYPE,_array)(s, data->C, 2);

  s = find_section_start(p,2);
  STAC(parse_,TYPE,_array)(s, data->orig, SIZE);
}
Esempio n. 4
0
void data_to_input(int fd, void *vdata) {
  struct bench_args_t *data = (struct bench_args_t *)vdata;

  write_section_header(fd);
  STAC(write_,TYPE,_array)(fd, data->nzval, N*L);

  write_section_header(fd);
  write_int32_t_array(fd, data->cols, N*L);

  write_section_header(fd);
  STAC(write_,TYPE,_array)(fd, data->vec, N);
}
Esempio n. 5
0
void input_to_data(int fd, void *vdata) {
  struct bench_args_t *data = (struct bench_args_t *)vdata;
  char *p, *s;
  // Zero-out everything.
  memset(vdata,0,sizeof(struct bench_args_t));

  // Load input string
  p = readfile(fd);

  s = find_section_start(p,1);
  STAC(parse_,TYPE,_array)(s, data->weights1, input_dimension*nodes_per_layer);

  s = find_section_start(p,2);
  STAC(parse_,TYPE,_array)(s, data->weights2, nodes_per_layer*nodes_per_layer);

  s = find_section_start(p,3);
  STAC(parse_,TYPE,_array)(s, data->weights3, nodes_per_layer*possible_outputs);

  s = find_section_start(p,4);
  STAC(parse_,TYPE,_array)(s, data->biases1, nodes_per_layer);

  s = find_section_start(p,5);
  STAC(parse_,TYPE,_array)(s, data->biases2, nodes_per_layer);

  s = find_section_start(p,6);
  STAC(parse_,TYPE,_array)(s, data->biases3, possible_outputs);

  s = find_section_start(p,7);
  STAC(parse_,TYPE,_array)(s, data->training_data, training_sets*input_dimension);

  s = find_section_start(p,8);
  STAC(parse_,TYPE,_array)(s, data->training_targets, training_sets*possible_outputs);
  free(p);
}
Esempio n. 6
0
void data_to_input(int fd, void *vdata) {
  struct bench_args_t *data = (struct bench_args_t *)vdata;

  write_section_header(fd);
  STAC(write_,TYPE,_array)(fd, data->weights1, input_dimension*nodes_per_layer);

  write_section_header(fd);
  STAC(write_,TYPE,_array)(fd, data->weights2, nodes_per_layer*nodes_per_layer);

  write_section_header(fd);
  STAC(write_,TYPE,_array)(fd, data->weights3, nodes_per_layer*possible_outputs);

  write_section_header(fd);
  STAC(write_,TYPE,_array)(fd, data->biases1, nodes_per_layer);

  write_section_header(fd);
  STAC(write_,TYPE,_array)(fd, data->biases2, nodes_per_layer);

  write_section_header(fd);
  STAC(write_,TYPE,_array)(fd, data->biases3, possible_outputs);

  write_section_header(fd);
  STAC(write_,TYPE,_array)(fd, data->training_data, training_sets*input_dimension);

  write_section_header(fd);
  STAC(write_,TYPE,_array)(fd, data->training_targets, training_sets*possible_outputs);
}
Esempio n. 7
0
void data_to_input(int fd, void *vdata) {
  struct bench_args_t *data = (struct bench_args_t *)vdata;

  write_section_header(fd);
  write_uint8_t_array(fd, data->obs, N_OBS);

  write_section_header(fd);
  STAC(write_,TYPE,_array)(fd, data->init, N_STATES);

  write_section_header(fd);
  STAC(write_,TYPE,_array)(fd, data->transition, N_STATES*N_STATES);

  write_section_header(fd);
  STAC(write_,TYPE,_array)(fd, data->emission, N_STATES*N_TOKENS);
}
Esempio n. 8
0
void input_to_data(int fd, void *vdata) {
    struct bench_args_t *data = (struct bench_args_t *)vdata;
    char *p, *s;
    // Zero-out everything.
    memset(vdata,0,sizeof(struct bench_args_t));
    // Load input string
    p = readfile(fd);

    s = find_section_start(p,1);
    STAC(parse_,TYPE,_array)(s, data->m1, N);

    s = find_section_start(p,2);
    STAC(parse_,TYPE,_array)(s, data->m2, N);

}
Esempio n. 9
0
void data_to_input(int fd, void *vdata) {
  struct bench_args_t *data = (struct bench_args_t *)vdata;

  write_section_header(fd);
  STAC(write_,TYPE,_array)(fd, data->position_x, n_atoms);

  write_section_header(fd);
  STAC(write_,TYPE,_array)(fd, data->position_y, n_atoms);

  write_section_header(fd);
  STAC(write_,TYPE,_array)(fd, data->position_z, n_atoms);

  write_section_header(fd);
  write_int32_t_array(fd, data->NL, n_atoms*max_neighbors);

}
Esempio n. 10
0
void data_to_input(int fd, void *vdata) {
  struct bench_args_t *data = (struct bench_args_t *)vdata;

  write_section_header(fd);
  write_int32_t_array(fd, (int32_t *)(data->n_points), blockSide*blockSide*blockSide);

  write_section_header(fd);
  STAC(write_,TYPE,_array)(fd, (double *)(data->position), 3*blockSide*blockSide*blockSide*densityFactor);

}
Esempio n. 11
0
void output_to_data(int fd, void *vdata) {
  struct bench_args_t *data = (struct bench_args_t *)vdata;
  char *p, *s;
  // Zero-out everything.
  memset(vdata,0,sizeof(struct bench_args_t));
  // Load input string
  p = readfile(fd);

  s = find_section_start(p,1);
  STAC(parse_,TYPE,_array)(s, (double *)data->force, 3*blockSide*blockSide*blockSide*densityFactor);
}
Esempio n. 12
0
void input_to_data(int fd, void *vdata) {
  struct bench_args_t *data = (struct bench_args_t *)vdata;
  char *p, *s;
  // Zero-out everything.
  memset(vdata,0,sizeof(struct bench_args_t));
  // Load input string
  p = readfile(fd);

  s = find_section_start(p,1);
  parse_uint8_t_array(s, data->obs, N_OBS);

  s = find_section_start(p,2);
  STAC(parse_,TYPE,_array)(s, data->init, N_STATES);

  s = find_section_start(p,3);
  STAC(parse_,TYPE,_array)(s, data->transition, N_STATES*N_STATES);

  s = find_section_start(p,4);
  STAC(parse_,TYPE,_array)(s, data->emission, N_STATES*N_TOKENS);
}
Esempio n. 13
0
void input_to_data(int fd, void *vdata) {
  struct bench_args_t *data = (struct bench_args_t *)vdata;
  char *p, *s;
  // Zero-out everything.
  memset(vdata,0,sizeof(struct bench_args_t));
  // Load input string
  p = readfile(fd);

  s = find_section_start(p,1);
  STAC(parse_,TYPE,_array)(s, data->val, NNZ);

  s = find_section_start(p,2);
  parse_int32_t_array(s, data->cols, NNZ);

  s = find_section_start(p,3);
  parse_int32_t_array(s, data->rowDelimiters, N+1);

  s = find_section_start(p,4);
  STAC(parse_,TYPE,_array)(s, data->vec, N);
}
Esempio n. 14
0
void input_to_data(int fd, void *vdata) {
  struct bench_args_t *data = (struct bench_args_t *)vdata;
  char *p, *s;
  // Zero-out everything.
  memset(vdata,0,sizeof(struct bench_args_t));
  // Load input string
  p = readfile(fd);

  s = find_section_start(p,1);
  STAC(parse_,TYPE,_array)(s, data->position_x, n_atoms);

  s = find_section_start(p,2);
  STAC(parse_,TYPE,_array)(s, data->position_y, n_atoms);

  s = find_section_start(p,3);
  STAC(parse_,TYPE,_array)(s, data->position_z, n_atoms);

  s = find_section_start(p,4);
  parse_int32_t_array(s, data->NL, n_atoms*max_neighbors);

}
Esempio n. 15
0
void data_to_output(int fd, void *vdata) {
  struct bench_args_t *data = (struct bench_args_t *)vdata;

  write_section_header(fd);
  STAC(write_,TYPE,_array)(fd, data->out, N);
}
Esempio n. 16
0
void data_to_output(int fd, void *vdata) {
  struct bench_args_t *data = (struct bench_args_t *)vdata;

  write_section_header(fd);
  STAC(write_,TYPE,_array)(fd, (double *)data->force, 3*blockSide*blockSide*blockSide*densityFactor);
}