Skip to content
Snippets Groups Projects
Verified Commit 6993fa57 authored by baptiste.coudray's avatar baptiste.coudray
Browse files

Updated benchmark for GPU

parent 9cebc10b
No related branches found
No related tags found
No related merge requests found
......@@ -27,19 +27,28 @@ void init_chunk_elems(chunk_info_t *ci) {
void compute_next_chunk_elems(struct dispatch_context *dc, struct futhark_context *fc, chunk_info_t *ci) {
envelope_t *outer_envelope = get_outer_envelope(dc, fc, 1);
struct futhark_opaque_envelope_1d_i8 *fut_outer_envelope = futhark_outer_envelope_new(dc, fc, outer_envelope,
futhark_restore_opaque_envelope_1d_i8,
FUTHARK_I8);
double start0 = MPI_Wtime();
struct futhark_opaque_envelope_1d_i8 *fut_outer_envelope =
futhark_outer_envelope_new(dc, fc, outer_envelope, futhark_restore_opaque_envelope_1d_i8, FUTHARK_I8);
struct futhark_i8_1d *fut_chunk_elems = futhark_new_i8_1d(fc, ci->data, ci->dimensions[1]);
struct futhark_i8_1d *fut_next_chunk_elems;
futhark_context_sync(fc);
double finish0 = MPI_Wtime();
printf("0. nce -> %f\n", finish0 - start0);
double start1 = MPI_Wtime();
futhark_entry_next_chunk_elems(fc, &fut_next_chunk_elems, fut_chunk_elems, fut_outer_envelope);
futhark_context_sync(fc);
double finish1 = MPI_Wtime();
printf("1. nce -> %f\n", finish1 - start1);
double start2 = MPI_Wtime();
futhark_values_i8_1d(fc, fut_next_chunk_elems, ci->data);
futhark_context_sync(fc);
double finish2 = MPI_Wtime();
printf("2. values_i8 -> %f\n", finish2 - start2);
futhark_free_i8_1d(fc, fut_next_chunk_elems);
futhark_free_i8_1d(fc, fut_chunk_elems);
......@@ -61,7 +70,7 @@ int main(int argc, char *argv[]) {
struct futhark_context_config *fut_config = futhark_context_config_new();
int nb_devices = atoi(argv[1]);
#if defined(FUTHARK_BACKEND_cuda) || defined(FUTHARK_BACKEND_opencl)
#if defined(FUTHARK_BACKEND_opencl)
#if defined(FUTHARK_BACKEND_opencl)
futhark_context_config_list_devices(fut_config);
#endif
char device[4] = {0};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment