brintos

brintos / llvm-project-archived public Read only

0
0
Text · 644 B · 4f7d761 Raw
22 lines · c
1// RUN: %libomptarget-compile-generic2// RUN:   env OMP_TARGET_OFFLOAD=disabled %libomptarget-run-generic 2>&1 | %fcheck-generic3 4#include <omp.h>5#include <stdio.h>6 7// Sanity checks to make sure that this works and is thread safe.8int main() {9  // CHECK: number of devices 010  printf("number of devices %d\n", omp_get_num_devices());11  // CHECK:initial device 012  printf("initial device %d\n", omp_get_initial_device());13  // CHECK:default device 014  printf("default device %d\n", omp_get_default_device());15  // CHECK: PASS16  if (omp_get_initial_device() == omp_get_default_device()) {17    printf("PASS\n");18    return 0;19  }20  return 1;21}22