23 int num_resources = num_devices;
27 for (
i = 0;
i < num_devices;
i++)
28 resources[
i] = devices[
i];
43#define CHECK_OR_RET_FAIL(Expr) \
46 return EXIT_FAILURE; \
52 al = omp_init_allocator(ms, 0, NULL);
57 omp_destroy_allocator(al);
65 omp_destroy_allocator(al);
74 int *all_devices = (
int *)malloc(
sizeof(
int) * num_devices);
75 for (
i = 0;
i < num_devices;
i++)
89 for (
i = 0;
i < num_devices;
i++) {
90 ms1 = omp_get_device_memspace(
i, predef);
92 ms2 = omp_get_device_memspace(
i, predef);
97 ms1 = omp_get_device_and_host_memspace(
i, predef);
99 ms2 = omp_get_device_and_host_memspace(
i, predef);
105 int *devices = &all_devices[
i];
106 ms1 = omp_get_devices_memspace(
count, devices, predef);
108 ms2 = omp_get_devices_memspace(
count, devices, predef);
113 ms1 = omp_get_devices_and_host_memspace(
count, devices, predef);
115 ms2 = omp_get_devices_and_host_memspace(
count, devices, predef);
125 ms1 = omp_get_devices_all_memspace(predef);
127 ms2 = omp_get_devices_all_memspace(predef);
140 int *all_devices = (
int *)malloc(
sizeof(
int) * num_devices);
141 for (
i = 0;
i < num_devices;
i++)
152 for (
i = 0;
i < num_devices;
i++) {
153 al = omp_get_device_allocator(
i, predef);
158 al = omp_get_device_and_host_allocator(
i, predef);
164 int *devices = &all_devices[
i];
165 al = omp_get_devices_allocator(
count, devices, predef);
170 al = omp_get_devices_and_host_allocator(
count, devices, predef);
179 al = omp_get_devices_all_allocator(predef);
194 int num_resources = omp_get_memspace_num_resources(ms);
198 for (
i = 0;
i < num_resources;
i++) {
202 int num_sub_resources = omp_get_memspace_num_resources(
sub);
207 int *resources = (
int *)malloc(
sizeof(
int) * num_resources);
208 for (
i = 0;
i < num_resources;
i++)
void const char const char int ITT_FORMAT __itt_group_sync x void const char ITT_FORMAT __itt_group_sync s void ITT_FORMAT __itt_group_sync p void ITT_FORMAT p void ITT_FORMAT p no args __itt_suppress_mode_t unsigned int void size_t ITT_FORMAT d void ITT_FORMAT p void ITT_FORMAT p __itt_model_site __itt_model_site_instance ITT_FORMAT p __itt_model_task __itt_model_task_instance ITT_FORMAT p void ITT_FORMAT p void ITT_FORMAT p void size_t ITT_FORMAT d void ITT_FORMAT p const wchar_t ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s no args void ITT_FORMAT p size_t count
void const char const char int ITT_FORMAT __itt_group_sync x void const char ITT_FORMAT __itt_group_sync s void ITT_FORMAT __itt_group_sync p void ITT_FORMAT p void ITT_FORMAT p no args __itt_suppress_mode_t unsigned int void size_t size
omp_memspace_handle_t const omp_default_mem_space
void * omp_memspace_handle_t
void * omp_allocator_handle_t
omp_memspace_handle_t const omp_null_mem_space
omp_allocator_handle_t const omp_null_allocator
int omp_get_num_devices(void)
void omp_free(void *ptr, omp_allocator_handle_t allocator)
void * omp_alloc(size_t size, omp_allocator_handle_t allocator)
void __tgt_omp_free(void *ptr, omp_allocator_handle_t allocator)
int __tgt_get_mem_resources(int num_devices, const int *devices, int host, omp_memspace_handle_t memspace, int *resources)
void * __tgt_omp_alloc(size_t size, omp_allocator_handle_t allocator)
static int test_sub_mem_space(void)
#define CHECK_OR_RET_FAIL(Expr)
int __tgt_get_num_devices(void)
static int test_mem_allocator(void)
static int test_mem_space(void)
static int test_allocator(omp_allocator_handle_t al)
static int test_user_allocator(omp_memspace_handle_t ms)