[Openmp-commits] [PATCH] D42162: [OMPT] Update api_calls testcase
Simon Convent via Phabricator via Openmp-commits
openmp-commits at lists.llvm.org
Wed Jan 17 02:12:41 PST 2018
sconvent updated this revision to Diff 130111.
sconvent retitled this revision from "[OMPT] Only use ompt_ functions when testing OMPT in api_calls testcase" to "[OMPT] Update api_calls testcase".
sconvent edited the summary of this revision.
https://reviews.llvm.org/D42162
Files:
runtime/test/ompt/misc/api_calls.c
Index: runtime/test/ompt/misc/api_calls.c
===================================================================
--- runtime/test/ompt/misc/api_calls.c
+++ runtime/test/ompt/misc/api_calls.c
@@ -6,11 +6,11 @@
#include <sched.h>
#undef __USE_GNU
-void print_list(char* function_name, int list[])
+void print_list(char* function_name, int size, int list[])
{
printf("%" PRIu64 ": %s(0)=(%d", ompt_get_thread_data()->value, function_name, list[0]);
int i;
- for(i = 1; i < omp_get_place_num_procs(0); i++)
+ for(i = 1; i < size; i++)
{
printf(",%d", list[i]);
}
@@ -24,22 +24,26 @@
printf("%" PRIu64 ": omp_get_num_places()=%d\n", ompt_get_thread_data()->value, omp_get_num_places());
printf("%" PRIu64 ": ompt_get_num_places()=%d\n", ompt_get_thread_data()->value, ompt_get_num_places());
- int omp_ids[omp_get_place_num_procs(0)];
+ int omp_ids_size = omp_get_place_num_procs(0);
+ int omp_ids[omp_ids_size];
omp_get_place_proc_ids(0, omp_ids);
- print_list("omp_get_place_proc_ids" ,omp_ids);
- int ompt_ids[omp_get_place_num_procs(0)];
- ompt_get_place_proc_ids(0, omp_get_place_num_procs(0), ompt_ids);
- print_list("ompt_get_place_proc_ids", ompt_ids);
+ print_list("omp_get_place_proc_ids", omp_ids_size, omp_ids);
+ int ompt_ids_size = ompt_get_place_proc_ids(0, 0, NULL);
+ int ompt_ids[ompt_ids_size];
+ ompt_get_place_proc_ids(0, ompt_ids_size, ompt_ids);
+ print_list("ompt_get_place_proc_ids", ompt_ids_size, ompt_ids);
printf("%" PRIu64 ": omp_get_place_num()=%d\n", ompt_get_thread_data()->value, omp_get_place_num());
printf("%" PRIu64 ": ompt_get_place_num()=%d\n", ompt_get_thread_data()->value, ompt_get_place_num());
- int omp_nums[omp_get_partition_num_places()];
+ int omp_nums_size = omp_get_partition_num_places();
+ int omp_nums[omp_nums_size];
omp_get_partition_place_nums(omp_nums);
- print_list("omp_get_partition_place_nums" ,omp_nums);
- int ompt_nums[omp_get_partition_num_places()];
- ompt_get_partition_place_nums(omp_get_partition_num_places(), ompt_nums);
- print_list("ompt_get_partition_place_nums", ompt_nums);
+ print_list("omp_get_partition_place_nums", omp_nums_size, omp_nums);
+ int ompt_nums_size = ompt_get_partition_place_nums(0, NULL);
+ int ompt_nums[ompt_nums_size];
+ ompt_get_partition_place_nums(ompt_nums_size, ompt_nums);
+ print_list("ompt_get_partition_place_nums", ompt_nums_size, ompt_nums);
printf("%" PRIu64 ": sched_getcpu()=%d\n", ompt_get_thread_data()->value, sched_getcpu());
printf("%" PRIu64 ": ompt_get_proc_id()=%d\n", ompt_get_thread_data()->value, ompt_get_proc_id());
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D42162.130111.patch
Type: text/x-patch
Size: 2674 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20180117/b71468fc/attachment.bin>
More information about the Openmp-commits
mailing list