[all-commits] [llvm/llvm-project] 190a11: Changed omp_get_max_threads() implementation to mo...

Jon Chesterfield via All-commits all-commits at lists.llvm.org
Wed Feb 12 15:29:46 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 190a11148b756e0b650ad9c5b6cf5314e9afdd0a
      https://github.com/llvm/llvm-project/commit/190a11148b756e0b650ad9c5b6cf5314e9afdd0a
  Author: Ethan Stewart <ethan.stewart at amd.com>
  Date:   2020-02-12 (Wed, 12 Feb 2020)

  Changed paths:
    M openmp/libomptarget/deviceRTLs/common/src/omptarget.cu
    A openmp/libomptarget/deviceRTLs/nvptx/test/api/get_max_threads.c
    M openmp/libomptarget/deviceRTLs/nvptx/test/api/max_threads.c

  Log Message:
  -----------
  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




More information about the All-commits mailing list