LLVM OpenMP 20.0.0git
omp_target_offload.c
Go to the documentation of this file.
1// RUN: %libomp-compile-and-run
2#include <string.h>
3#include <stdlib.h>
4
9};
10
11extern int __kmpc_get_target_offload();
12extern void kmp_set_defaults(char const *str);
13
14const char *disabled_examples[] = {
15 // Allowed inputs
16 "disabled", "DISABLED", "Disabled", "dIsAbLeD", "DiSaBlEd"};
17
18const char *default_examples[] = {
19 // Allowed inputs
20 "default", "DEFAULT", "Default", "deFAulT", "DEfaULt",
21 // These should be changed to default (failed match)
22 "mandatry", "defaults", "disable", "enabled", "mandatorynot"};
23
24const char *mandatory_examples[] = {
25 // Allowed inputs
26 "mandatory", "MANDATORY", "Mandatory", "manDatoRy", "MANdATOry"};
27
28// Return target-offload-var ICV
30#pragma omp parallel
31 {}
33}
34
35int main() {
36 int i;
37 const char *omp_target_offload = "OMP_TARGET_OFFLOAD=";
38 char buf[80];
39
40 for (i = 0; i < sizeof(disabled_examples) / sizeof(char *); ++i) {
41 strcpy(buf, omp_target_offload);
42 strcat(buf, disabled_examples[i]);
45 return EXIT_FAILURE;
46 }
47 for (i = 0; i < sizeof(default_examples) / sizeof(char *); ++i) {
48 strcpy(buf, omp_target_offload);
49 strcat(buf, default_examples[i]);
52 return EXIT_FAILURE;
53 }
54 for (i = 0; i < sizeof(mandatory_examples) / sizeof(char *); ++i) {
55 strcpy(buf, omp_target_offload);
56 strcat(buf, mandatory_examples[i]);
59 return EXIT_FAILURE;
60 }
61
62 return EXIT_SUCCESS;
63}
char buf[BUFFER_SIZE]
kmp_target_offload_kind
Definition: kmp.h:4534
#define i
Definition: kmp_stub.cpp:87
#define kmp_set_defaults
Definition: kmp_stub.cpp:45
@ tgt_mandatory
@ tgt_disabled
@ tgt_default
int get_target_offload_icv()
int __kmpc_get_target_offload()
const char * mandatory_examples[]
const char * default_examples[]
const char * disabled_examples[]
int main()