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); }
void data_to_input(int fd, void *vdata) { struct bench_args_t *data = (struct bench_args_t *)vdata; write_section_header(fd); write_string(fd, data->pattern, PATTERN_SIZE); write_section_header(fd); write_string(fd, data->input, STRING_SIZE); }
void data_to_input(int fd, void *vdata) { struct bench_args_t *data = (struct bench_args_t *)vdata; // Section 1 write_section_header(fd); write_uint8_t_array(fd, data->k, 32); // Section 2 write_section_header(fd); write_uint8_t_array(fd, data->buf, 16); }
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); }
void data_to_output(int fd, void *vdata) { struct bench_args_t *data = (struct bench_args_t *)vdata; write_section_header(fd); write_string(fd, data->alignedA, ALEN+BLEN); write_section_header(fd); write_string(fd, data->alignedB, ALEN+BLEN); write_section_header(fd); }
void data_to_input(int fd, void *vdata) { struct bench_args_t *data = (struct bench_args_t *)vdata; write_section_header(fd); write_string(fd, data->seqA, ALEN); write_section_header(fd); write_string(fd, data->seqB, BLEN); write_section_header(fd); }
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); }
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); }
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); }
status_t MetadataSection::Execute(ReportRequestSet* requests) const { ProtoOutputStream proto; IncidentMetadata metadata = requests->metadata(); proto.write(FIELD_TYPE_ENUM | IncidentMetadata::kDestFieldNumber, metadata.dest()); proto.write(FIELD_TYPE_INT32 | IncidentMetadata::kRequestSizeFieldNumber, metadata.request_size()); proto.write(FIELD_TYPE_BOOL | IncidentMetadata::kUseDropboxFieldNumber, metadata.use_dropbox()); for (auto iter = requests->allSectionStats().begin(); iter != requests->allSectionStats().end(); iter++) { IncidentMetadata::SectionStats stats = iter->second; uint64_t token = proto.start(FIELD_TYPE_MESSAGE | IncidentMetadata::kSectionsFieldNumber); proto.write(FIELD_TYPE_INT32 | IncidentMetadata::SectionStats::kIdFieldNumber, stats.id()); proto.write(FIELD_TYPE_BOOL | IncidentMetadata::SectionStats::kSuccessFieldNumber, stats.success()); proto.write(FIELD_TYPE_INT32 | IncidentMetadata::SectionStats::kReportSizeBytesFieldNumber, stats.report_size_bytes()); proto.write(FIELD_TYPE_INT64 | IncidentMetadata::SectionStats::kExecDurationMsFieldNumber, stats.exec_duration_ms()); proto.write(FIELD_TYPE_INT32 | IncidentMetadata::SectionStats::kDumpSizeBytesFieldNumber, stats.dump_size_bytes()); proto.write(FIELD_TYPE_INT64 | IncidentMetadata::SectionStats::kDumpDurationMsFieldNumber, stats.dump_duration_ms()); proto.write(FIELD_TYPE_BOOL | IncidentMetadata::SectionStats::kTimedOutFieldNumber, stats.timed_out()); proto.write(FIELD_TYPE_BOOL | IncidentMetadata::SectionStats::kIsTruncatedFieldNumber, stats.is_truncated()); proto.end(token); } for (ReportRequestSet::iterator it = requests->begin(); it != requests->end(); it++) { const sp<ReportRequest> request = *it; if (request->fd < 0 || request->err != NO_ERROR) { continue; } write_section_header(request->fd, id, proto.size()); if (!proto.flush(request->fd)) { ALOGW("Failed to write metadata to fd %d", request->fd); // we don't fail if we can't write to a single request's fd. } } if (requests->mainFd() >= 0) { write_section_header(requests->mainFd(), id, proto.size()); if (!proto.flush(requests->mainFd())) { ALOGW("Failed to write metadata to dropbox fd %d", requests->mainFd()); return -1; } } return NO_ERROR; }
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); }
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); }
status_t HeaderSection::Execute(ReportRequestSet* requests) const { for (ReportRequestSet::iterator it = requests->begin(); it != requests->end(); it++) { const sp<ReportRequest> request = *it; const vector<vector<uint8_t>>& headers = request->args.headers(); for (vector<vector<uint8_t>>::const_iterator buf = headers.begin(); buf != headers.end(); buf++) { if (buf->empty()) continue; // So the idea is only requests with negative fd are written to dropbox file. int fd = request->fd >= 0 ? request->fd : requests->mainFd(); write_section_header(fd, id, buf->size()); WriteFully(fd, (uint8_t const*)buf->data(), buf->size()); // If there was an error now, there will be an error later and we will remove // it from the list then. } } return NO_ERROR; }
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); }
void data_to_output(int fd, void *vdata) { struct bench_args_t *data = (struct bench_args_t *)vdata; write_section_header(fd); // No section header write_int32_t_array(fd, data->n_matches, 1); }
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); }
void data_to_output(int fd, void *vdata) { struct bench_args_t *data = (struct bench_args_t *)vdata; write_section_header(fd); write_uint8_t_array(fd, data->path, N_OBS); }