Files
clang-p2996/openmp/libomptarget/test/api/omp_get_num_procs.c
Joseph Huber 460840c09d [OpenMP] Support 'omp_get_num_procs' on the device (#65501)
Summary:
The `omp_get_num_procs()` function should return the amount of
parallelism availible. On the GPU, this was not defined. We have elected
to define this function as the maximum amount of wavefronts / warps that
can be simultaneously resident on the device. For AMDGPU this is the
number of CUs multiplied byth CU's per wave. For NVPTX this is the
maximum threads per SM divided by the warp size and multiplied by the
number of SMs.
2023-09-06 13:45:05 -05:00

16 lines
272 B
C

// RUN: %libomptarget-compile-run-and-check-generic
#include <stdio.h>
int omp_get_num_procs();
int main() {
int num_procs;
#pragma omp target map(from : num_procs)
{ num_procs = omp_get_num_procs(); }
// CHECK: PASS
if (num_procs > 0)
printf("PASS\n");
}