]> git.ipfire.org Git - thirdparty/gcc.git/commit
[nvptx] Use CUDA driver API to select default runtime launch geometry
authorvries <vries@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 13 Aug 2018 12:04:24 +0000 (12:04 +0000)
committervries <vries@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 13 Aug 2018 12:04:24 +0000 (12:04 +0000)
commitf63400aa3858d8b8f2a3b3ba5d50808478eb292b
tree0729abf2a8dd6b64d2d8313c3c16b16b428c15ab
parent06f2bd29194a2eb2336d4adfb5e99c2438557bf6
[nvptx] Use CUDA driver API to select default runtime launch geometry

The CUDA driver API starting version 6.5 offers a set of runtime functions to
calculate several occupancy-related measures, as a replacement for the occupancy
calculator spreadsheet.

This patch adds a heuristic for default runtime launch geometry, based on the
new runtime function cuOccupancyMaxPotentialBlockSize.

Build on x86_64 with nvptx accelerator and ran libgomp testsuite.

2018-08-13  Cesar Philippidis  <cesar@codesourcery.com>
    Tom de Vries  <tdevries@suse.de>

PR target/85590
* plugin/cuda/cuda.h (CUoccupancyB2DSize): New typedef.
(cuOccupancyMaxPotentialBlockSize): Declare.
* plugin/cuda-lib.def (cuOccupancyMaxPotentialBlockSize): New
CUDA_ONE_CALL_MAYBE_NULL.
* plugin/plugin-nvptx.c (CUDA_VERSION < 6050): Define
CUoccupancyB2DSize and declare
cuOccupancyMaxPotentialBlockSize.
(nvptx_exec): Use cuOccupancyMaxPotentialBlockSize to set the
default num_gangs and num_workers when the driver supports it.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263505 138bc75d-0d04-0410-961f-82ee72b054a4
libgomp/ChangeLog
libgomp/plugin/cuda-lib.def
libgomp/plugin/cuda/cuda.h
libgomp/plugin/plugin-nvptx.c