]> git.ipfire.org Git - thirdparty/gcc.git/commit
[libgomp, nvptx] Remove hard-coded const in nvptx_open_device
authorvries <vries@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 8 Aug 2018 14:26:19 +0000 (14:26 +0000)
committervries <vries@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 8 Aug 2018 14:26:19 +0000 (14:26 +0000)
commit143979be19d08df153a16aa3b38ece98dc96a855
tree6f046c7dfeb9031d0554fb3b7834326cf89427f1
parentcd3d21c58d36be9a32b4c01152558d40b4a3a8eb
[libgomp, nvptx] Remove hard-coded const in nvptx_open_device

CU_DEVICE_ATTRIBUTE_MAX_REGISTERS_PER_MULTIPROCESSOR is defined in cuda driver
api version 6.0 and higher.

Currently nvptx_open_device uses a hard-coded constant instead.

This patch fixes that by:
- defining CU_DEVICE_ATTRIBUTE_MAX_REGISTERS_PER_MULTIPROCESSOR to the hardcoded
  constant at toplevel, if not present in cuda.h, and
- using CU_DEVICE_ATTRIBUTE_MAX_REGISTERS_PER_MULTIPROCESSOR in nvptx_open_device

Build on x86_64 with nvptx accelerator and reg-tested libgomp.

2018-08-08  Tom de Vries  <tdevries@suse.de>

* plugin/plugin-nvptx.c
(CU_DEVICE_ATTRIBUTE_MAX_REGISTERS_PER_MULTIPROCESSOR): Define.
(nvptx_open_device): Use
CU_DEVICE_ATTRIBUTE_MAX_REGISTERS_PER_MULTIPROCESSOR.

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