LLVM OpenMP
kmp_device_env.cpp File Reference
#include "kmp.h"
#include "kmp_device_env.h"
#include "kmp_i18n.h"
#include "kmp_str.h"
#include <stdlib.h>
#include <string.h>

Go to the source code of this file.

Classes

struct  kmp_device_env_dev_node_t
struct  kmp_device_env_state_t

Enumerations

enum  kmp_dev_env_kind_t { kmp_dev_env_none = 0 , kmp_dev_env_all , kmp_dev_env_dev_default , kmp_dev_env_dev_id }

Functions

static int __kmp_device_env_count (void)
static void __kmp_device_env_assert_tables_disjoint (void)
static void __kmp_device_env_lazy_init (void)
static int __kmp_device_env_index (char const *base_name)
char const * __kmp_device_env_eligible_name (int index)
static char const * __kmp_strip_prefix_and_suffix (char const *full_name, char const *base_name, char const *suffix)
static int __kmp_is_nonneg_int (char const *s)
static int __kmp_parse_dev_id (char const *s)
static kmp_dev_env_kind_t __kmp_match_suffix (char const *full_name, char const *base, int *out_dev_id)
static kmp_dev_env_kind_t __kmp_classify_device_env_name (char const *full_name, int *out_index, int *out_dev_id)
static void __kmp_device_env_set_string (char **slot, char const *value)
static void __kmp_device_env_set_per_device (kmp_device_env_state_t *st, int device_id, char const *value)
int __kmp_device_env_record (char const *full_name, char const *value)
static kmp_device_env_state_t * __kmp_device_env_lookup (char const *base_name)
char const * __kmpc_get_device_env (char const *base_name, int device_id)
void __kmp_device_env_reset (void)

Variables

static char const *const __kmp_device_env_eligible_names []
static char const *const __kmp_device_env_denied_bases []
static kmp_device_env_state_t * __kmp_device_env_states = NULL

Enumeration Type Documentation

◆ kmp_dev_env_kind_t

Enumerator
kmp_dev_env_none 
kmp_dev_env_all 
kmp_dev_env_dev_default 
kmp_dev_env_dev_id 

Definition at line 155 of file kmp_device_env.cpp.

Function Documentation

◆ __kmp_classify_device_env_name()

kmp_dev_env_kind_t __kmp_classify_device_env_name ( char const * full_name,
int * out_index,
int * out_dev_id )
static

◆ __kmp_device_env_assert_tables_disjoint()

void __kmp_device_env_assert_tables_disjoint ( void )
static

◆ __kmp_device_env_count()

int __kmp_device_env_count ( void )
static

◆ __kmp_device_env_eligible_name()

char const * __kmp_device_env_eligible_name ( int index)

◆ __kmp_device_env_index()

int __kmp_device_env_index ( char const * base_name)
static

Definition at line 96 of file kmp_device_env.cpp.

References __kmp_device_env_eligible_names, and i.

Referenced by __kmp_device_env_lookup().

◆ __kmp_device_env_lazy_init()

void __kmp_device_env_lazy_init ( void )
static

◆ __kmp_device_env_lookup()

kmp_device_env_state_t * __kmp_device_env_lookup ( char const * base_name)
static

Definition at line 304 of file kmp_device_env.cpp.

References __kmp_device_env_index(), and __kmp_device_env_states.

Referenced by __kmpc_get_device_env().

◆ __kmp_device_env_record()

◆ __kmp_device_env_reset()

◆ __kmp_device_env_set_per_device()

◆ __kmp_device_env_set_string()

void __kmp_device_env_set_string ( char ** slot,
char const * value )
static

Definition at line 232 of file kmp_device_env.cpp.

References __kmp_str_format(), __kmp_str_free(), and value.

Referenced by __kmp_device_env_record().

◆ __kmp_is_nonneg_int()

int __kmp_is_nonneg_int ( char const * s)
static

Definition at line 130 of file kmp_device_env.cpp.

References p, and s.

Referenced by __kmp_parse_dev_id().

◆ __kmp_match_suffix()

kmp_dev_env_kind_t __kmp_match_suffix ( char const * full_name,
char const * base,
int * out_dev_id )
static

◆ __kmp_parse_dev_id()

int __kmp_parse_dev_id ( char const * s)
static

Definition at line 143 of file kmp_device_env.cpp.

References __kmp_is_nonneg_int(), p, and s.

Referenced by __kmp_match_suffix().

◆ __kmp_strip_prefix_and_suffix()

char const * __kmp_strip_prefix_and_suffix ( char const * full_name,
char const * base_name,
char const * suffix )
static

Definition at line 116 of file kmp_device_env.cpp.

Referenced by __kmp_match_suffix().

◆ __kmpc_get_device_env()

Variable Documentation

◆ __kmp_device_env_denied_bases

char const* const __kmp_device_env_denied_bases[]
static
Initial value:
= {
"OMP_DEFAULT_DEVICE",
"OMP_MAX_TASK_PRIORITY",
"OMP_TARGET_OFFLOAD",
"OMP_DISPLAY_ENV",
"OMP_DISPLAY_AFFINITY",
"OMP_AFFINITY_FORMAT",
"OMP_CANCELLATION",
"OMP_TOOL",
"OMP_TOOL_LIBRARIES",
"OMP_TOOL_VERBOSE_INIT",
"OMP_DEBUG",
NULL,
}

Definition at line 32 of file kmp_device_env.cpp.

Referenced by __kmp_classify_device_env_name(), and __kmp_device_env_assert_tables_disjoint().

◆ __kmp_device_env_eligible_names

char const* const __kmp_device_env_eligible_names[]
static

◆ __kmp_device_env_states

kmp_device_env_state_t* __kmp_device_env_states = NULL
static