-/* Copyright (C) 2015-2021 Free Software Foundation, Inc.
+/* Copyright (C) 2015-2024 Free Software Foundation, Inc.
Contributed by Alexander Monakov <amonakov@ispras.ru>
This file is part of the GNU Offloading and Multi Processing Library
#include "libgomp.h"
+/* This is set to the ICV values of current GPU during device initialization,
+ when the offload image containing this libgomp portion is loaded. */
+volatile struct gomp_offload_icvs GOMP_ADDITIONAL_ICVS;
+
void
omp_set_default_device (int device_num __attribute__((unused)))
{
int
omp_get_default_device (void)
{
- return 0;
+ return GOMP_ADDITIONAL_ICVS.default_device;
}
int
return 0;
}
+int
+omp_get_device_num (void)
+{
+ return GOMP_ADDITIONAL_ICVS.device_num;
+}
+
+int
+omp_get_max_teams (void)
+{
+ return GOMP_ADDITIONAL_ICVS.nteams;
+}
+
+void
+omp_set_num_teams (int num_teams)
+{
+ if (num_teams >= 0)
+ GOMP_ADDITIONAL_ICVS.nteams = num_teams;
+}
+
+int
+omp_get_teams_thread_limit (void)
+{
+ return GOMP_ADDITIONAL_ICVS.teams_thread_limit;
+}
+
+void
+omp_set_teams_thread_limit (int thread_limit)
+{
+ if (thread_limit >= 0)
+ GOMP_ADDITIONAL_ICVS.teams_thread_limit = thread_limit;
+}
+
ialias (omp_set_default_device)
ialias (omp_get_default_device)
ialias (omp_get_initial_device)
ialias (omp_get_num_devices)
ialias (omp_is_initial_device)
+ialias (omp_get_device_num)
+ialias (omp_get_max_teams)
+ialias (omp_set_num_teams)
+ialias (omp_get_teams_thread_limit)
+ialias (omp_set_teams_thread_limit)