llvm-project/openmp/libomptarget/deviceRTLs/nvptx
Ethan Stewart 190a11148b Changed omp_get_max_threads() implementation to more closely match spec description.
Summary: The 5.0 spec states, "The omp_get_max_threads routine returns an upper bound on the number of threads that could be used to form a new team if a parallel construct without a num_threads clause were encountered after execution returns from this routine." The attached test shows Max Threads: 96, Num Threads: 128 without the proposed change. The number of threads should not exceed the (max) nthreads ICV, hence we should return the higher SPMD thread number even when omp_get_max_threads() is called in a generic kernel. This change does fail the api test, max_threads.c, because now it would return 64 instead of 32.

Reviewers: jdoerfert, ABataev, grokos, JonChesterfield

Reviewed By: jdoerfert

Subscribers: openmp-commits

Tags: #openmp

Differential Revision: https://reviews.llvm.org/D74092
2020-02-12 23:29:34 +00:00
..
docs
src [nfc][libomptarget] Refactor nvptx/target_impl.cu 2020-01-14 19:27:45 +00:00
test Changed omp_get_max_threads() implementation to more closely match spec description. 2020-02-12 23:29:34 +00:00
CMakeLists.txt [libomptarget][nfc] Extract function from data_sharing, move to common 2019-12-18 19:39:35 +00:00