LLVM OpenMP 22.0.0git
omp60_memory_routines.c File Reference
#include <stdlib.h>
#include <omp.h>

Go to the source code of this file.

Macros

#define NUM_DEVICES   4
#define CHECK_OR_RET_FAIL(Expr)

Functions

int __tgt_get_num_devices (void)
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)
void __tgt_omp_free (void *ptr, omp_allocator_handle_t allocator)
static int test_user_allocator (omp_memspace_handle_t ms)
static int test_allocator (omp_allocator_handle_t al)
static int test_mem_space (void)
static int test_mem_allocator (void)
static int test_sub_mem_space (void)
int main ()

Macro Definition Documentation

◆ CHECK_OR_RET_FAIL

#define CHECK_OR_RET_FAIL ( Expr)
Value:
do { \
if (!(Expr)) \
return EXIT_FAILURE; \
} while (0)

Definition at line 43 of file omp60_memory_routines.c.

Referenced by main(), test_allocator(), test_mem_allocator(), test_mem_space(), test_sub_mem_space(), and test_user_allocator().

◆ NUM_DEVICES

#define NUM_DEVICES   4

Function Documentation

◆ __tgt_get_mem_resources()

int __tgt_get_mem_resources ( int num_devices,
const int * devices,
int host,
omp_memspace_handle_t memspace,
int * resources )
extern

Definition at line 18 of file omp60_memory_routines.c.

References i.

◆ __tgt_get_num_devices()

int __tgt_get_num_devices ( void )
extern

Definition at line 16 of file omp60_memory_routines.c.

References NUM_DEVICES.

◆ __tgt_omp_alloc()

void * __tgt_omp_alloc ( size_t size,
omp_allocator_handle_t allocator )
extern

Definition at line 33 of file omp60_memory_routines.c.

References size.

◆ __tgt_omp_free()

void __tgt_omp_free ( void * ptr,
omp_allocator_handle_t allocator )
extern

Definition at line 37 of file omp60_memory_routines.c.

◆ main()

◆ test_allocator()

int test_allocator ( omp_allocator_handle_t al)
static

Definition at line 61 of file omp60_memory_routines.c.

References CHECK_OR_RET_FAIL, omp_alloc(), and omp_free().

Referenced by test_mem_allocator().

◆ test_mem_allocator()

int test_mem_allocator ( void )
static

◆ test_mem_space()

int test_mem_space ( void )
static

◆ test_sub_mem_space()

int test_sub_mem_space ( void )
static

Definition at line 189 of file omp60_memory_routines.c.

References CHECK_OR_RET_FAIL, i, NUM_DEVICES, omp_default_mem_space, omp_null_mem_space, and sub.

Referenced by main().

◆ test_user_allocator()

int test_user_allocator ( omp_memspace_handle_t ms)
static

Definition at line 50 of file omp60_memory_routines.c.

References CHECK_OR_RET_FAIL, omp_alloc(), omp_free(), and omp_null_allocator.

Referenced by test_mem_space().