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.
16 lines
272 B
C
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");
|
|
}
|